Skip to content

💥 Rename chunk files to include "datadog" prefix for cross-bundler naming#4391

Merged
thomas-lebeau merged 3 commits intov7from
thomas.lebeau/v7-datadog-chunk-naming
Mar 26, 2026
Merged

💥 Rename chunk files to include "datadog" prefix for cross-bundler naming#4391
thomas-lebeau merged 3 commits intov7from
thomas.lebeau/v7-datadog-chunk-naming

Conversation

@thomas-lebeau
Copy link
Copy Markdown
Collaborator

@thomas-lebeau thomas-lebeau commented Mar 25, 2026

Motivation

Chunk files produced by the SDK (recorder, profiler) use generic names like recorder-<hash> and profiler-<hash>. These can collide with chunks from other libraries or the application itself. Prefixing them with datadog- makes them easily identifiable and avoids naming conflicts across bundlers.

Changes

  • Rename startRecording.ts to datadog-recorder.ts and profiler.ts to datadog-profiler.ts
  • Update webpack chunk names from recorder/profiler to datadogRecorder/datadogProfiler
  • Update deploy scripts, bundle size computation, and associated tests to match the new naming convention

Test instructions

  • yarn build && yarn build:apps and verify:
    • [webpack] the chunk files under packages/rum/bundle/chunks/ are named datadogRecorder_<hash>-datadog-rum.js and datadogProfiler_<hash>-datadog-rum.js
    • [vite/rollup] the chunk files under developer-extension/dist/chrome-mv3/chunks are named datadogRecorder_<hash>.js and datadogProfiler_<hash>.js
  • Run yarn test:unit --spec scripts/deploy/deploy.spec.ts to verify deploy tests pass
  • bundle size evolution comment still work as expected

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

@cit-pr-commenter-54b7da
Copy link
Copy Markdown

cit-pr-commenter-54b7da Bot commented Mar 25, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum N/A 172.16 KiB N/A N/A N/A
Rum Profiler N/A 6.19 KiB N/A N/A N/A
Rum Recorder N/A 26.97 KiB N/A N/A N/A
Logs N/A 56.50 KiB N/A N/A N/A
Rum Slim N/A 129.50 KiB N/A N/A N/A
Worker N/A 23.63 KiB N/A N/A N/A
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
addglobalcontext N/A 0.0049 N/A
addaction N/A 0.0161 N/A
adderror N/A 0.0166 N/A
addtiming N/A 0.0034 N/A
startview N/A 0.0145 N/A
startstopsessionreplayrecording N/A 0.0007 N/A
logmessage N/A 0.0175 N/A
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
addglobalcontext N/A 33.45 KiB N/A
addaction N/A 58.80 KiB N/A
addtiming N/A 34.38 KiB N/A
adderror N/A 63.46 KiB N/A
startstopsessionreplayrecording N/A 33.70 KiB N/A
startview N/A 464.25 KiB N/A
logmessage N/A 50.29 KiB N/A

🔗 RealWorld

@datadog-official
Copy link
Copy Markdown

datadog-official Bot commented Mar 25, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 0.00%
Overall Coverage: 77.29% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: ae34631 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@thomas-lebeau thomas-lebeau force-pushed the thomas.lebeau/v7-datadog-chunk-naming branch 2 times, most recently from ea0a10c to d4fd13b Compare March 25, 2026 15:14
@thomas-lebeau thomas-lebeau marked this pull request as ready for review March 25, 2026 15:41
@thomas-lebeau thomas-lebeau requested a review from a team as a code owner March 25, 2026 15:41
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b20a529b8c

ℹ️ 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".

Comment thread packages/rum/src/boot/lazyLoadRecorder.ts Outdated
@thomas-lebeau thomas-lebeau force-pushed the thomas.lebeau/v7-datadog-chunk-naming branch from b20a529 to 971e47e Compare March 25, 2026 16:20
@thomas-lebeau thomas-lebeau force-pushed the thomas.lebeau/v7-datadog-chunk-naming branch from 971e47e to 0169de5 Compare March 25, 2026 16:25
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: could we stick with the naming convention and use datadogRecorder.ts?

Use camelCase for lazy-loaded source files (datadogRecorder, datadogProfiler)
to follow project naming conventions. Remove webpackChunkName magic comments
since webpack derives chunk names from filenames. Unify chunk filename separator
to hyphen in both dev and prod builds.
@thomas-lebeau thomas-lebeau force-pushed the thomas.lebeau/v7-datadog-chunk-naming branch from d6e6858 to ae34631 Compare March 26, 2026 06:53
@thomas-lebeau thomas-lebeau merged commit 2ab4cf8 into v7 Mar 26, 2026
19 checks passed
@thomas-lebeau thomas-lebeau deleted the thomas.lebeau/v7-datadog-chunk-naming branch March 26, 2026 08:52
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 26, 2026
@mormubis
Copy link
Copy Markdown
Contributor

startRecording.spec.ts was renamed to datadog-recorder.spec.ts, but profiler.spec.ts kept its old name. Is this intentional?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants