Skip to content

Commit 3c4f827

Browse files
committed
Merge remote-tracking branch 'origin/v7' into fix-merge-e0f3b649b0-into-v7
2 parents 954687d + 794301d commit 3c4f827

303 files changed

Lines changed: 6915 additions & 17925 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/manual-testing/SKILL.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Run a manual test of the current change end-to-end and output repro
55

66
## Step 1: Understand the change
77

8-
Review the current diff to identify what SDK behavior changed and what events/fields need to be verified.
8+
If you don't have the PR changes in memory, review all commits in the PR to identify what SDK behavior changed and what events/fields need to be verified.
99

1010
## Step 2: Start the dev server
1111

@@ -52,6 +52,13 @@ yarn dev-server intake <selector> | jq '<field>'
5252

5353
Use `yarn dev-server intake --help` to find the right selector.
5454

55+
To evaluate JavaScript on the page (e.g. to inspect `window` state set by `beforeSend`), switch focus back to tab 0 first, then use `agent-browser eval`:
56+
57+
```bash
58+
agent-browser tab 0
59+
agent-browser eval 'window.someValue'
60+
```
61+
5562
## Step 5: Verify the output matches expectations, then present the test instructions
5663

5764
Output a self-contained bash snippet with the exact commands run and the expected output. This goes directly into the PR "Test instructions" section.

.gitlab-ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ variables:
66
CI_IMAGE: '$BUILD_STABLE_REGISTRY/ci/$APP:$CURRENT_CI_IMAGE'
77
GIT_REPOSITORY: 'git@github.com:DataDog/browser-sdk.git'
88
MAIN_BRANCH: 'main'
9-
NEXT_MAJOR_BRANCH: 'v7'
9+
NEXT_MAJOR_BRANCH: ''
1010
CHROME_PACKAGE_VERSION: 148.0.7778.96-1
1111
FF_TIMESTAMPS: 'true' # Enable timestamps for gitlab-ci logs
1212

@@ -374,11 +374,10 @@ deploy-next-major-canary:
374374
- .next-major-branch
375375
script:
376376
- export BUILD_MODE=canary
377-
- VERSION=$(node -p -e "require('./package.json').version")
378377
- yarn
379378
- yarn build:bundle
380-
- node ./scripts/deploy/deploy.ts prod v${VERSION%%.*}-canary root
381-
- node ./scripts/deploy/upload-source-maps.ts v${VERSION%%.*}-canary root
379+
- node ./scripts/deploy/deploy.ts prod ${NEXT_MAJOR_BRANCH}-canary root
380+
- node ./scripts/deploy/upload-source-maps.ts ${NEXT_MAJOR_BRANCH}-canary root
382381

383382
deploy-manual:
384383
stage: deploy

AGENTS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ For deeper context, see:
8989
- Test framework: Jasmine + Karma. Spec files co-located with implementation: `feature.ts``feature.spec.ts`
9090
- Focus tests with `fit()` / `fdescribe()`, skip with `xit()` / `xdescribe()`
9191
- Use `registerCleanupTask()` for cleanup, NOT `afterEach()`
92+
- Prefer `collectAsyncCalls(spy, n)` over `waitFor(() => spy.calls.count() > 0)` for waiting on spy calls
93+
- Don't destructure methods from `spy.calls` (e.g., `argsFor`, `mostRecent`) - use `calls.argsFor()` to avoid `@typescript-eslint/unbound-method` errors
9294
- Mock values/functions: wrap with `mockable()` in source, use `replaceMockable()` or `replaceMockableWithSpy()` in tests (auto-cleanup)
9395

9496
### Naming Conventions
@@ -118,6 +120,12 @@ For deeper context, see:
118120

119121
Use gitmoji conventions — see `docs/DEVELOPMENT.md` for the full reference.
120122

123+
## Manual Testing with Chrome MCP
124+
125+
`yarn dev` serves the sandbox at `http://localhost:8080` (increments port if busy). The sandbox page (`sandbox/index.html`) loads the SDK bundles and calls `DD_LOGS.init()` / `DD_RUM.init()`.
126+
127+
To test with specific config options (e.g. `forwardErrorsToLogs: true`), just edit `sandbox/index.html` temporarily. The dev server reloads on change, so navigate to `http://localhost:8080` after saving and use `evaluate_script` to run test code.
128+
121129
## Git Workflow
122130

123131
- Branch naming: `<username>/<feature>` (e.g., `john.doe/fix-session-bug`)

CHANGELOG.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,82 @@
1515
1616
---
1717

18+
## v7.0.0
19+
20+
This is the v7 major release. It removes deprecated options and legacy code paths accumulated over the v6 line, modernizes the build, and ships a more reliable session manager.
21+
22+
- **Smaller, faster bundle** — dropping legacy browser shims and switching to ESM dynamic imports reduces the SDK footprint on modern browsers.
23+
- **Better privacy out of the box** — safer default privacy settings mean less risk of capturing sensitive content without explicit configuration.
24+
- **More reliable sessions** — modernized session manager with bug fixes, including around very short repetitive sessions.
25+
- **Higher-quality data** — deterministic sampling (consistent decisions across products), aborted requests no longer polluting error metrics, and a new `session_renewal` view loading type to better understand session boundaries.
26+
- **A cleaner API** — deprecated options and beta flags removed; what's left is the supported, stable surface going forward.
27+
28+
**Migrating from v6:**
29+
30+
- Follow the [v6 → v7 migration guide](https://github.com/DataDog/documentation/blob/8ed5928d4cf04351f6ec6f6e8d605267def58351/content/en/real_user_monitoring/guide/browser-sdk-upgrade.md) in the Datadog documentation.
31+
- For automated assistance, use the [`upgrade-browser-sdk-v7` Claude Code skill](https://github.com/DataDog/browser-sdk/blob/main/.claude/skills/upgrade-browser-sdk-v7/SKILL.md) shipped in this repo.
32+
33+
**Public Changes:**
34+
35+
- 💥 remove fake resource timing for document resources ([#4406](https://github.com/DataDog/browser-sdk/pull/4406)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
36+
- 💥 add `session_renewal` view loading type for session-renewed views ([#4478](https://github.com/DataDog/browser-sdk/pull/4478)) [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE]
37+
- 💥 always collect early requests ([#4285](https://github.com/DataDog/browser-sdk/pull/4285)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
38+
- 💥 replace DurationVitalReference with vitalKey option in start/stopDurationVital ([#4403](https://github.com/DataDog/browser-sdk/pull/4403)) [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE]
39+
- 💥 Rename chunk files to include "datadog" prefix for cross-bundler naming ([#4391](https://github.com/DataDog/browser-sdk/pull/4391)) [RUM]
40+
- 💥 Remove deprecated `strategy` from plugin API ([#4382](https://github.com/DataDog/browser-sdk/pull/4382)) [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE]
41+
- 💥 [RUM-8693] Decouple forwardErrorsToLogs from console.error log capture ([#4356](https://github.com/DataDog/browser-sdk/pull/4356)) [LOGS]
42+
- 💥 remove trackBfcacheViews and track bfcache restores by default ([#4228](https://github.com/DataDog/browser-sdk/pull/4228)) [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE]
43+
- 💥 default privacy settings to improve privacy out of the box ([#4279](https://github.com/DataDog/browser-sdk/pull/4279)) [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE]
44+
- 💥 Remove FID (First Input Delay) tracking ([#4223](https://github.com/DataDog/browser-sdk/pull/4223)) [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE]
45+
- 💥 [RUM-970] do not collect network errors for aborted requests ([#4225](https://github.com/DataDog/browser-sdk/pull/4225)) [LOGS]
46+
- 💥 [RUM-14058] Use tree walker for action name computation ([#3972](https://github.com/DataDog/browser-sdk/pull/3972)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
47+
- 💥 enable propagateTraceBaggage by default ([#4226](https://github.com/DataDog/browser-sdk/pull/4226)) [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE]
48+
- 💥 use ESM dynamic imports for CDN async chunks ([#4217](https://github.com/DataDog/browser-sdk/pull/4217))
49+
- 💥 drop old-browser compatibility code for ES2020 baseline ([#4428](https://github.com/DataDog/browser-sdk/pull/4428)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
50+
- 💥 remove internalAnalyticsSubdomain and INTAKE_SITE_FED_STAGING ([#4354](https://github.com/DataDog/browser-sdk/pull/4354)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
51+
- 💥 remove betaTrackActionsInShadowDom and make shadow DOM action tracking the default ([#4355](https://github.com/DataDog/browser-sdk/pull/4355)) [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE]
52+
- 💥 Remove deprecated allowFallbackToLocalStorage option ([#4329](https://github.com/DataDog/browser-sdk/pull/4329)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
53+
- 💥 [RUM-11273] Remove usePciIntake option ([#4335](https://github.com/DataDog/browser-sdk/pull/4335)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
54+
- 💥 Remove old cookie migration ([#4198](https://github.com/DataDog/browser-sdk/pull/4198)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
55+
- 💥 Remove betaEncodeCookieOptions and always encode cookie options ([#4195](https://github.com/DataDog/browser-sdk/pull/4195)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
56+
-[RUM-15280] Expose DEFAULT_TRACKED_RESOURCE_HEADERS on RumPublicApi ([#4523](https://github.com/DataDog/browser-sdk/pull/4523)) [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE]
57+
- ✨ Make nuxt package public ([#4520](https://github.com/DataDog/browser-sdk/pull/4520)) [RUM-NUXT]
58+
-[PANA-6624] Enable the new session replay serialization algorithm by default ([#4507](https://github.com/DataDog/browser-sdk/pull/4507)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
59+
- ✨ Rename session store key to `_dd_s_v2` with legacy migration ([#4459](https://github.com/DataDog/browser-sdk/pull/4459)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
60+
- ✨ make all sampling decisions deterministic ([#4194](https://github.com/DataDog/browser-sdk/pull/4194)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
61+
- 🐛 [PANA-7217] Limit the size of the string table in session replay recordings ([#4544](https://github.com/DataDog/browser-sdk/pull/4544)) [RUM]
62+
- 🐛 don't adopt another tab's session when it replaces ours directly ([#4537](https://github.com/DataDog/browser-sdk/pull/4537)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
63+
- 🐛 fix session lifetime bugs for long-lived pages and multi-tab scenarios ([#4531](https://github.com/DataDog/browser-sdk/pull/4531)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
64+
- 🐛 fix regexp for cookie parsing ([#4527](https://github.com/DataDog/browser-sdk/pull/4527)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
65+
- 🐛 Prevent cross-tab session adoption after expiry ([#4475](https://github.com/DataDog/browser-sdk/pull/4475)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
66+
- 🐛 make sure we never send data for very old sessions ([#4462](https://github.com/DataDog/browser-sdk/pull/4462)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
67+
- 🐛 Ignore cookie observable updates missing the c marker ([#4437](https://github.com/DataDog/browser-sdk/pull/4437)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
68+
- 🐛 Add telemetry debug for Cookie Store API set failures ([#4432](https://github.com/DataDog/browser-sdk/pull/4432)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
69+
- 🐛 Fix InvalidStateError when tracing buffered XHR requests ([#4423](https://github.com/DataDog/browser-sdk/pull/4423)) [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE]
70+
- 📝 Add Claude Code skill for v6 to v7 SDK migration ([#4486](https://github.com/DataDog/browser-sdk/pull/4486))
71+
72+
**Internal Changes:**
73+
74+
- 👷 Renovate: tweak memory ([#4539](https://github.com/DataDog/browser-sdk/pull/4539))
75+
- 👷 Use 15-minute cache for next major canary S3 uploads ([#4476](https://github.com/DataDog/browser-sdk/pull/4476))
76+
- 👷 bump rum-vue version to 7.0.0-alpha.0 ([#4351](https://github.com/DataDog/browser-sdk/pull/4351)) [RUM-VUE]
77+
- 👷 Bump rum-nextjs version to 7.0.0-alpha.0 ([#4295](https://github.com/DataDog/browser-sdk/pull/4295)) [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE]
78+
- 🔧 use NEXT_MAJOR_BRANCH variable for canary deploy versioning ([#4407](https://github.com/DataDog/browser-sdk/pull/4407))
79+
- 🔧 Decouple v7 SDK artifact version from package.json version ([#4401](https://github.com/DataDog/browser-sdk/pull/4401)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
80+
- 🔧 Bump @datadog/browser-rum-angular to 7.0.0-alpha.0 ([#4394](https://github.com/DataDog/browser-sdk/pull/4394)) [RUM-ANGULAR]
81+
- 🔧 fix root package.json version ([#4286](https://github.com/DataDog/browser-sdk/pull/4286))
82+
- 🤖 bring v7 upgrade skill to `main` ([#4541](https://github.com/DataDog/browser-sdk/pull/4541))
83+
- ♻️ Replace BoundedBuffer with BufferedObservable and track dropped data via telemetry ([#4489](https://github.com/DataDog/browser-sdk/pull/4489)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
84+
- 📈 Add telemetry metric for session manager init duration ([#4488](https://github.com/DataDog/browser-sdk/pull/4488)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
85+
- ♻️ Route fetch, XHR, and console through bufferedDataObservable ([#4470](https://github.com/DataDog/browser-sdk/pull/4470)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
86+
- ♻️ Refactor startSessionManager to return a Promise instead of using a callback ([#4438](https://github.com/DataDog/browser-sdk/pull/4438)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
87+
- ♻️ decouple session change notification from state reading ([#4457](https://github.com/DataDog/browser-sdk/pull/4457)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
88+
- 🔍 add cookie value and debug context to session renewal event ([#4433](https://github.com/DataDog/browser-sdk/pull/4433)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
89+
- ♻️ Rewrite SessionManager with reactive strategy interface ([#4348](https://github.com/DataDog/browser-sdk/pull/4348)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
90+
- ♻️ Simplify session managers by removing product-specific wrappers ([#4204](https://github.com/DataDog/browser-sdk/pull/4204)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
91+
- ♻️ Make session manager injectable and isolate for v7 rewrite ([#4157](https://github.com/DataDog/browser-sdk/pull/4157)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
92+
- ♻️ Async session manager ([#4131](https://github.com/DataDog/browser-sdk/pull/4131)) [LOGS] [RUM] [RUM-ANGULAR] [RUM-NEXTJS] [RUM-NUXT] [RUM-SLIM] [RUM-VUE] [WORKER]
93+
1894
## v6.33.0
1995

2096
**Public Changes:**

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ Datadog provides one CDN bundle per [site][70]:
3535

3636
| Site | logs | rum | rum-slim |
3737
| ------- | -------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------ |
38-
| US1 | https://www.datadoghq-browser-agent.com/us1/v6/datadog-logs.js | https://www.datadoghq-browser-agent.com/us1/v6/datadog-rum.js | https://www.datadoghq-browser-agent.com/us1/v6/datadog-rum-slim.js |
39-
| US3 | https://www.datadoghq-browser-agent.com/us3/v6/datadog-logs.js | https://www.datadoghq-browser-agent.com/us3/v6/datadog-rum.js | https://www.datadoghq-browser-agent.com/us3/v6/datadog-rum-slim.js |
40-
| US5 | https://www.datadoghq-browser-agent.com/us5/v6/datadog-logs.js | https://www.datadoghq-browser-agent.com/us5/v6/datadog-rum.js | https://www.datadoghq-browser-agent.com/us5/v6/datadog-rum-slim.js |
41-
| EU1 | https://www.datadoghq-browser-agent.com/eu1/v6/datadog-logs.js | https://www.datadoghq-browser-agent.com/eu1/v6/datadog-rum.js | https://www.datadoghq-browser-agent.com/eu1/v6/datadog-rum-slim.js |
42-
| AP1 | https://www.datadoghq-browser-agent.com/ap1/v6/datadog-logs.js | https://www.datadoghq-browser-agent.com/ap1/v6/datadog-rum.js | https://www.datadoghq-browser-agent.com/ap1/v6/datadog-rum-slim.js |
43-
| US1-FED | https://www.datadoghq-browser-agent.com/datadog-logs-v6.js | https://www.datadoghq-browser-agent.com/datadog-rum-v6.js | https://www.datadoghq-browser-agent.com/datadog-rum-slim-v6.js |
38+
| US1 | https://www.datadoghq-browser-agent.com/us1/v7/datadog-logs.js | https://www.datadoghq-browser-agent.com/us1/v7/datadog-rum.js | https://www.datadoghq-browser-agent.com/us1/v7/datadog-rum-slim.js |
39+
| US3 | https://www.datadoghq-browser-agent.com/us3/v7/datadog-logs.js | https://www.datadoghq-browser-agent.com/us3/v7/datadog-rum.js | https://www.datadoghq-browser-agent.com/us3/v7/datadog-rum-slim.js |
40+
| US5 | https://www.datadoghq-browser-agent.com/us5/v7/datadog-logs.js | https://www.datadoghq-browser-agent.com/us5/v7/datadog-rum.js | https://www.datadoghq-browser-agent.com/us5/v7/datadog-rum-slim.js |
41+
| EU1 | https://www.datadoghq-browser-agent.com/eu1/v7/datadog-logs.js | https://www.datadoghq-browser-agent.com/eu1/v7/datadog-rum.js | https://www.datadoghq-browser-agent.com/eu1/v7/datadog-rum-slim.js |
42+
| AP1 | https://www.datadoghq-browser-agent.com/ap1/v7/datadog-logs.js | https://www.datadoghq-browser-agent.com/ap1/v7/datadog-rum.js | https://www.datadoghq-browser-agent.com/ap1/v7/datadog-rum-slim.js |
43+
| US1-FED | https://www.datadoghq-browser-agent.com/datadog-logs-v7.js | https://www.datadoghq-browser-agent.com/datadog-rum-v7.js | https://www.datadoghq-browser-agent.com/datadog-rum-slim-v7.js |
4444

4545
[1]: https://github.githubassets.com/favicons/favicon.png
4646
[2]: https://imgix.datadoghq.com/img/favicons/favicon-32x32.png

developer-extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@datadog/browser-sdk-developer-extension",
3-
"version": "6.33.0",
3+
"version": "7.0.0",
44
"private": true,
55
"scripts": {
66
"build": "wxt build",

developer-extension/src/content-scripts/main.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -172,19 +172,11 @@ function loadSdkScriptFromURL(url: string) {
172172
if (xhr.status === 200) {
173173
let sdkCode = xhr.responseText
174174

175-
// Webpack expects the script to be loaded with a `<script src="...">` tag to get its URL to
176-
// know where to load the relative chunks. By loading it with an XHR and evaluating it in an
177-
// inline script tag, Webpack does not know where to load the chunks from.
178-
//
179-
// Let's replace Webpack logic that breaks with our own logic to define the URL. It's not
180-
// pretty, but loading the script this way isn't either, so...
181-
//
182-
// We'll probably have to revisit when using actual `import()` expressions instead of relying on
183-
// Webpack runtime to load the chunks.
184-
sdkCode = sdkCode.replace(
185-
'if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");',
186-
`if (!scriptUrl) scriptUrl = ${JSON.stringify(url)};`
187-
)
175+
// Webpack chunks are loaded via ESM dynamic imports with relative paths (e.g. `import('./chunks/...')`).
176+
// Since this script is injected inline rather than loaded via `<script src>`, relative import()
177+
// paths would resolve against the page URL instead of the SDK URL. Replace them with absolute URLs.
178+
const baseUrl = url.slice(0, url.lastIndexOf('/') + 1)
179+
sdkCode = sdkCode.replaceAll(/\bimport\(['"]\.\/['"]/g, `import('${baseUrl}'`)
188180

189181
const script = document.createElement('script')
190182
script.type = 'text/javascript'

developer-extension/src/panel/sampler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isSampled } from '@datadog/browser-rum-core'
1+
import { isSampled } from '@datadog/browser-core'
22

33
export function computeRumTrackingType(
44
sessionId: string,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "browser-sdk",
3-
"version": "6.33.0",
3+
"version": "7.0.0",
44
"description": "browser SDK",
55
"private": true,
66
"workspaces": [

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@datadog/browser-core",
3-
"version": "6.33.0",
3+
"version": "7.0.0",
44
"license": "Apache-2.0",
55
"main": "cjs/index.js",
66
"module": "esm/index.js",

0 commit comments

Comments
 (0)