🚨 Prevent re-exporting values from @datadog/js-core - #4970
🚨 Prevent re-exporting values from @datadog/js-core#4970BenoitZugmeyer wants to merge 3 commits into
Conversation
Bundles Sizes Evolution
|
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: b3d9d1a | Docs | View more details | Give us feedback! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 110a317b54
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Re-exporting values from @datadog/js-core makes them look like they belong to the re-exporting package. Add a local ESLint rule that flags any `export ... from "@datadog/js-core..."` and tells consumers to import the value directly from @datadog/js-core instead.
110a317 to
c730f95
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c730f953a6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Remove `export ... from "@datadog/js-core/..."` re-exports from browser-core, browser-logs, browser-rum, and browser-rum-slim entry points and update all internal consumers to import the values directly from @datadog/js-core/util instead.
c730f95 to
b3d9d1a
Compare
Motivation
Re-exporting values from
@datadog/js-corethrough other packages (e.g.@datadog/browser-core) makes them appear as if they belong to the re-exporting package. This creates misleading import paths for consumers and blurs package boundaries. Consumers should import these values directly from@datadog/js-coreso the source of each utility is explicit.Changes
disallow-re-exports-from-other-packages) that flags anyexport ... from "@datadog/js-core..."and reports a message directing consumers to import from@datadog/js-coredirectly@datadog/js-corere-exports frombrowser-core,browser-logs,browser-rum, andbrowser-rum-slimentry points@datadog/js-core/utilyarn typecheckcovers thebrowser-rum-nextjspackageTest instructions
yarn lintand confirm nodisallow-re-exports-from-other-packagesviolations are reportedyarn typecheckand confirm it passesDD_LOGS.init()/DD_RUM.init()) since entry points no longer re-exportProxyFn,Site,ConsoleApiName, etc.Checklist