Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into nazim/react-timings
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitZugmeyer committed Nov 20, 2024
2 parents bef5db5 + 7ea12b0 commit 5d48861
Show file tree
Hide file tree
Showing 89 changed files with 1,844 additions and 1,251 deletions.
20 changes: 17 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
variables:
CURRENT_STAGING: staging-42
CURRENT_STAGING: staging-47
APP: 'browser-sdk'
CURRENT_CI_IMAGE: 74
CURRENT_CI_IMAGE: 75
BUILD_STABLE_REGISTRY: 'registry.ddbuild.io'
CI_IMAGE: '$BUILD_STABLE_REGISTRY/ci/$APP:$CURRENT_CI_IMAGE'
GIT_REPOSITORY: '[email protected]:DataDog/browser-sdk.git'
MAIN_BRANCH: 'main'
NEXT_MAJOR_BRANCH: 'v6'
CHROME_PACKAGE_VERSION: 130.0.6723.58-1
CHROME_PACKAGE_VERSION: 131.0.6778.69-1

cache:
key:
Expand Down Expand Up @@ -85,6 +85,19 @@ stages:
refs:
- tags

###########################################################################################################################
# Resource allocation
###########################################################################################################################

.resource-allocation-4-cpus:
variables:
WORKERS: 2
KUBERNETES_CPU_REQUEST: 4
KUBERNETES_CPU_LIMIT: 4
KUBERNETES_MEMORY_REQUEST: 16Gi
KUBERNETES_MEMORY_LIMIT: 16Gi
NODE_OPTIONS: '--max-old-space-size=16000'

########################################################################################################################
# CI image
########################################################################################################################
Expand Down Expand Up @@ -266,6 +279,7 @@ e2e-bs:
extends:
- .base-configuration
- .bs-allowed-branches
- .resource-allocation-4-cpus
interruptible: true
resource_group: browserstack
timeout: 35 minutes
Expand Down
725 changes: 367 additions & 358 deletions .yarn/releases/yarn-4.5.0.cjs → .yarn/releases/yarn-4.5.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
yarnPath: .yarn/releases/yarn-4.5.0.cjs
yarnPath: .yarn/releases/yarn-4.5.1.cjs
defaultSemverRangePrefix: ''
nodeLinker: node-modules

Expand Down
91 changes: 78 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,84 @@
---

## v5.31.1

**Public Changes:**

- 🐛 skip worker timing when no worker is used ([#3147](https://github.com/DataDog/browser-sdk/pull/3147)) [RUM] [RUM-REACT] [RUM-SLIM]
- ⚗️🐛 [RUM-6226] fix for empty splats ([#3142](https://github.com/DataDog/browser-sdk/pull/3142)) [RUM-REACT]

## v5.31.0

**Public Changes:**

- 🐛 Use EventTarget.prototype.addEventListener instead of the method ([#3137](https://github.com/DataDog/browser-sdk/pull/3137)) [LOGS] [RUM] [RUM-REACT] [RUM-SLIM] [WORKER]
- [RUM-6801] Collect resource worker processing time ([#3118](https://github.com/DataDog/browser-sdk/pull/3118)) [RUM] [RUM-REACT] [RUM-SLIM]
- Fix trackViewsManually JS doc comment ([#3117](https://github.com/DataDog/browser-sdk/pull/3117)) [RUM] [RUM-REACT] [RUM-SLIM]

**Internal Changes:**

- 👷 Update all non-major dependencies ([#3139](https://github.com/DataDog/browser-sdk/pull/3139))
- 👷 Bump chrome to 131.0.6778.69-1 ([#3127](https://github.com/DataDog/browser-sdk/pull/3127))
- ✅ Fix test cleanup tasks order ([#3141](https://github.com/DataDog/browser-sdk/pull/3141)) [LOGS] [RUM] [RUM-REACT] [RUM-SLIM] [WORKER]

## v5.30.1

**Public Changes:**

- 🐛 [RUM-6226][rum-react] improve routes wildcard substitution ([#3105](https://github.com/DataDog/browser-sdk/pull/3105)) [RUM-REACT]
- ⚡️ [RUM-6929] delay resource collection ([#3102](https://github.com/DataDog/browser-sdk/pull/3102)) [LOGS] [RUM] [RUM-REACT] [RUM-SLIM] [WORKER]
- Add @session.id in Logs along to @session_id ([#3125](https://github.com/DataDog/browser-sdk/pull/3125)) [LOGS]

**Internal Changes:**

- 👷 do not include staging bump commit to changelog ([#3129](https://github.com/DataDog/browser-sdk/pull/3129))
- 👷 Update all non-major dependencies ([#3106](https://github.com/DataDog/browser-sdk/pull/3106)) [RUM-REACT] [WORKER]

## v5.30.0

**Public Changes:**

- ✨ add new privacy rule for autocomplete password value ([#3094](https://github.com/DataDog/browser-sdk/pull/3094)) [RUM] [RUM-REACT] [RUM-SLIM]
-[RUM-5090] Collect ressource protocol ([#3087](https://github.com/DataDog/browser-sdk/pull/3087)) [RUM] [RUM-REACT] [RUM-SLIM]
- 🐛 allow untrusted event for httpRequest xhr event listeners ([#3123](https://github.com/DataDog/browser-sdk/pull/3123)) [LOGS] [RUM] [RUM-REACT] [RUM-SLIM] [WORKER]

**Internal Changes:**

- 👷 [RUM-6562] Enable and rename update view name API ([#3099](https://github.com/DataDog/browser-sdk/pull/3099)) [LOGS] [RUM] [RUM-REACT] [RUM-SLIM] [WORKER]
- 👷 Update all non-major dependencies ([#3082](https://github.com/DataDog/browser-sdk/pull/3082)) [RUM-REACT]
- 👷[IR-30972] Include older version intake urls matching ([#3059](https://github.com/DataDog/browser-sdk/pull/3059)) [LOGS] [RUM] [RUM-REACT] [RUM-SLIM] [WORKER]
- 👷 disable datadog static analysis ([#3091](https://github.com/DataDog/browser-sdk/pull/3091))
- ✅👷 kill browserstack execution early ([#3096](https://github.com/DataDog/browser-sdk/pull/3096))

## v5.29.1

**Internal Changes:**

- 👷 CI - Enable yarn strategy on the repository ([#3079](https://github.com/DataDog/browser-sdk/pull/3079))
- 👷 publish chrome extension to all users ([#3084](https://github.com/DataDog/browser-sdk/pull/3084))
- 👷 CI - assign static resources for e2e-bs job ([#3080](https://github.com/DataDog/browser-sdk/pull/3080))
- 👷 Enable reduced Session Replay data batch time limit ([#3088](https://github.com/DataDog/browser-sdk/pull/3088)) [LOGS] [RUM] [RUM-REACT] [RUM-SLIM] [WORKER]

## v5.29.0

**Public Changes:**

- 🐛 [RUM-6483] Investigate reducing the batch time limit for Replay ([#3077](https://github.com/DataDog/browser-sdk/pull/3077)) [LOGS] [RUM] [RUM-REACT] [RUM-SLIM] [WORKER]

**Internal Changes:**

- 👷 Bump chrome to 130.0.6723.58-1 ([#3074](https://github.com/DataDog/browser-sdk/pull/3074))
- 👷 skip merge into next major on scheduled pipelines ([#3075](https://github.com/DataDog/browser-sdk/pull/3075))
- 👷 Update all non-major dependencies ([#3070](https://github.com/DataDog/browser-sdk/pull/3070)) [RUM-REACT]
- 👷 Update dependency eslint-plugin-unicorn to v56 ([#3071](https://github.com/DataDog/browser-sdk/pull/3071))
- 🔧 [RUM-6226] tweak rum-react dependencies ([#3054](https://github.com/DataDog/browser-sdk/pull/3054)) [RUM-REACT]
- ♻️ Use registerCleanupTask for mock cleanups ([#3069](https://github.com/DataDog/browser-sdk/pull/3069)) [LOGS] [RUM] [RUM-REACT] [RUM-SLIM] [WORKER]
- ♻️ [RUM-5101] Use registerCleanupTask for interceptor cleanup ([#3065](https://github.com/DataDog/browser-sdk/pull/3065)) [LOGS] [RUM] [RUM-REACT] [RUM-SLIM] [WORKER]
- [RUM 5088] Reduce INP Null Target ([#2950](https://github.com/DataDog/browser-sdk/pull/2950)) [LOGS] [RUM] [RUM-REACT] [RUM-SLIM] [WORKER]
- ♻️ [RUM-5101] Use registerCleanupTask for fetch and report cleanups ([#3066](https://github.com/DataDog/browser-sdk/pull/3066)) [LOGS] [RUM] [RUM-REACT] [RUM-SLIM] [WORKER]
- ♻️ Use registerCleanupTask for zonejs cleanup ([#3060](https://github.com/DataDog/browser-sdk/pull/3060)) [LOGS] [RUM] [RUM-REACT] [RUM-SLIM] [WORKER]

## v5.28.1

**Public Changes:**
Expand All @@ -31,8 +109,6 @@
- 👷 Update Node.js to v22 ([#3049](https://github.com/DataDog/browser-sdk/pull/3049))
- 👷 sync rum-events-format ([#3053](https://github.com/DataDog/browser-sdk/pull/3053)) [LOGS] [RUM] [RUM-SLIM] [WORKER]
- 👷 Update all non-major dependencies ([#3046](https://github.com/DataDog/browser-sdk/pull/3046)) [RUM-REACT] [WORKER]
- 👷 Bump staging to staging-41
- 👷 Bump staging to staging-40
- 👷 allow release to be merged into next major feature branch ([#3043](https://github.com/DataDog/browser-sdk/pull/3043))
- 👷 bump e2e-bs ci job timeout to 35 minutes ([#3044](https://github.com/DataDog/browser-sdk/pull/3044))
- 👷 Bump chrome to 129.0.6668.58-1 ([#3035](https://github.com/DataDog/browser-sdk/pull/3035))
Expand All @@ -49,7 +125,6 @@
**Internal Changes:**

- 👷 Update all non-major dependencies ([#3030](https://github.com/DataDog/browser-sdk/pull/3030)) [RUM-REACT]
- 👷 Bump staging to staging-39
- 👷 Bump webpack from 5.76.0 to 5.94.0 in /test/app ([#3013](https://github.com/DataDog/browser-sdk/pull/3013))
- ♻️ [RUM-6278] Use performance observer for layout shift entries ([#3028](https://github.com/DataDog/browser-sdk/pull/3028)) [RUM] [RUM-SLIM]
-[RUM 4813] Remove feature flag for view specific context ([#3031](https://github.com/DataDog/browser-sdk/pull/3031)) [LOGS] [RUM] [RUM-SLIM] [WORKER]
Expand All @@ -72,11 +147,9 @@

- 👷 Update all non-major dependencies ([#2992](https://github.com/DataDog/browser-sdk/pull/2992)) [RUM-REACT] [RUM]
- 👷 timeout e2e-bs ci job after 30 minutes ([#2999](https://github.com/DataDog/browser-sdk/pull/2999))
- 👷 Bump staging to staging-38
- 👷 Bump chrome to 128.0.6613.84-1 ([#2946](https://github.com/DataDog/browser-sdk/pull/2946))
- 👷 allow job 'test-performance' to fail ([#2980](https://github.com/DataDog/browser-sdk/pull/2980))
- 👷 Update all non-major dependencies ([#2975](https://github.com/DataDog/browser-sdk/pull/2975))
- 👷 Bump staging to staging-37
- 🎨 [RUM-6203] Expose experimental features in init method ([#3006](https://github.com/DataDog/browser-sdk/pull/3006)) [RUM] [RUM-SLIM]
- 🎨 [RUM-5100] Move away from testbuilder in test files - Pt 3 ([#2952](https://github.com/DataDog/browser-sdk/pull/2952)) [RUM] [RUM-SLIM]
- ✅♻️ do not mock `navigationStart` in `mockClock` ([#2979](https://github.com/DataDog/browser-sdk/pull/2979)) [LOGS] [RUM] [RUM-SLIM] [WORKER]
Expand All @@ -98,7 +171,6 @@
- 👷 Bump micromatch from 4.0.4 to 4.0.8 ([#2970](https://github.com/DataDog/browser-sdk/pull/2970))
- 👷 add job to merge main into next major feature branch (v6) ([#2935](https://github.com/DataDog/browser-sdk/pull/2935))
- 👷 Update all non-major dependencies ([#2962](https://github.com/DataDog/browser-sdk/pull/2962)) [RUM-REACT]
- 👷 Bump staging to staging-36
- Bump micromatch from 4.0.5 to 4.0.8 in /test/app ([#2971](https://github.com/DataDog/browser-sdk/pull/2971))

## v5.25.0
Expand All @@ -122,16 +194,12 @@

- 👷 Update dependency eslint-plugin-jsdoc to v50 ([#2932](https://github.com/DataDog/browser-sdk/pull/2932))
- 👷 Update all non-major dependencies ([#2948](https://github.com/DataDog/browser-sdk/pull/2948)) [WORKER]
- 👷 Bump staging to staging-35
- 👷 Update all non-major dependencies ([#2941](https://github.com/DataDog/browser-sdk/pull/2941)) [RUM-REACT]
- 👷 Bump staging to staging-34
- 👷 use devflow to merge main into staging ([#2927](https://github.com/DataDog/browser-sdk/pull/2927))
- 👷 Update all non-major dependencies ([#2920](https://github.com/DataDog/browser-sdk/pull/2920)) [RUM] [RUM-SLIM] [RUM-REACT]
- 👷 Update dependency puppeteer to v23 ([#2933](https://github.com/DataDog/browser-sdk/pull/2933))
- 👷 Bump staging to staging-33
- 👷 upgrade gitlab runner ([#2928](https://github.com/DataDog/browser-sdk/pull/2928))
- 👷 [RUM-5673] Improve `test-performance` execution time ([#2914](https://github.com/DataDog/browser-sdk/pull/2914))
- 👷 Bump staging to staging-32
- 👷 use devflow to merge main into staging ([#2917](https://github.com/DataDog/browser-sdk/pull/2917))
- 👷 Update all non-major dependencies ([#2900](https://github.com/DataDog/browser-sdk/pull/2900))
- 👷 Update dependency eslint-plugin-unicorn to v55 ([#2901](https://github.com/DataDog/browser-sdk/pull/2901))
Expand Down Expand Up @@ -176,7 +244,6 @@
- 👷 Bump chrome to 127.0.6533.72-1 ([#2890](https://github.com/DataDog/browser-sdk/pull/2890))
- 👷 retry gitlab jobs on runner_system_failure ([#2886](https://github.com/DataDog/browser-sdk/pull/2886))
- 👷 Update all non-major dependencies ([#2881](https://github.com/DataDog/browser-sdk/pull/2881)) [RUM-REACT]
- 👷 Bump staging to staging-30
- 👷 Update dependency minimatch to v10 ([#2863](https://github.com/DataDog/browser-sdk/pull/2863))
- 👷 Update dependency glob to v11 ([#2862](https://github.com/DataDog/browser-sdk/pull/2862))
- ♻️ [RUM-5294] Use performanceObserver for navigation entries ([#2855](https://github.com/DataDog/browser-sdk/pull/2855)) [RUM] [RUM-SLIM]
Expand All @@ -196,9 +263,7 @@
**Internal Changes:**

- 👷 Update all non-major dependencies ([#2861](https://github.com/DataDog/browser-sdk/pull/2861))
- 👷 Bump staging to staging-29
- 👷 Update all non-major dependencies ([#2848](https://github.com/DataDog/browser-sdk/pull/2848))
- 👷 Bump staging to staging-28
- 👷 Update all non-major dependencies ([#2839](https://github.com/DataDog/browser-sdk/pull/2839))
- 👷 Upgrade engine.io and socket.io-adapter packages to fix ws vulnerability ([#2842](https://github.com/DataDog/browser-sdk/pull/2842))
- 🎨 Instrument fetch and XHR before trying to init consent ([#2834](https://github.com/DataDog/browser-sdk/pull/2834))
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:22.9.0-bookworm-slim
FROM node:22.11.0-bookworm-slim

ARG CHROME_PACKAGE_VERSION

Expand Down
16 changes: 8 additions & 8 deletions developer-extension/package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"name": "@datadog/browser-sdk-developer-extension",
"version": "5.28.1",
"version": "5.31.1",
"private": true,
"scripts": {
"build": "rm -rf dist && webpack --mode production",
"dev": "webpack --mode development --watch"
},
"devDependencies": {
"@tabler/icons-react": "3.19.0",
"@types/chrome": "0.0.278",
"@types/react": "18.3.11",
"@tabler/icons-react": "3.22.0",
"@types/chrome": "0.0.283",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@webextension-toolbox/webpack-webextension-plugin": "3.3.1",
"copy-webpack-plugin": "12.0.2",
"css-loader": "7.1.2",
"html-webpack-plugin": "5.6.0",
"html-webpack-plugin": "5.6.3",
"style-loader": "4.0.0",
"webpack": "5.95.0"
"webpack": "5.96.1"
},
"dependencies": {
"@datadog/browser-core": "workspace:*",
"@datadog/browser-logs": "workspace:*",
"@datadog/browser-rum": "workspace:*",
"@mantine/core": "7.13.2",
"@mantine/hooks": "7.13.2",
"@mantine/core": "7.14.1",
"@mantine/hooks": "7.14.1",
"clsx": "2.1.1",
"react": "18.3.1",
"react-dom": "18.3.1"
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"npmClient": "yarn",
"version": "5.28.1"
"version": "5.31.1"
}
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"devDependencies": {
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
"@types/chrome": "0.0.278",
"@types/chrome": "0.0.283",
"@types/connect-busboy": "1.0.3",
"@types/cors": "2.8.17",
"@types/express": "4.17.21",
Expand All @@ -55,13 +55,13 @@
"eslint-module-utils": "2.12.0",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-jasmine": "4.2.2",
"eslint-plugin-jsdoc": "50.4.1",
"eslint-plugin-jsdoc": "50.5.0",
"eslint-plugin-local-rules": "3.0.2",
"eslint-plugin-prefer-arrow": "1.2.3",
"eslint-plugin-unicorn": "56.0.0",
"express": "4.21.1",
"glob": "11.0.0",
"html-webpack-plugin": "5.6.0",
"html-webpack-plugin": "5.6.3",
"jasmine-core": "3.99.1",
"json-schema-to-typescript": "bcaudan/json-schema-to-typescript#bcaudan/add-readonly-support",
"karma": "6.4.4",
Expand All @@ -73,27 +73,27 @@
"karma-sourcemap-loader": "0.4.0",
"karma-spec-reporter": "0.0.36",
"karma-webpack": "5.0.0",
"lerna": "8.1.8",
"lerna": "8.1.9",
"minimatch": "10.0.1",
"npm-run-all": "4.1.5",
"prettier": "3.3.3",
"puppeteer": "23.5.3",
"puppeteer": "23.8.0",
"terser-webpack-plugin": "5.3.10",
"ts-loader": "9.5.1",
"ts-node": "10.9.2",
"tsconfig-paths-webpack-plugin": "4.1.0",
"tsconfig-paths-webpack-plugin": "4.2.0",
"typescript": "5.6.3",
"webdriverio": "8.40.6",
"webpack": "5.95.0",
"webpack": "5.96.1",
"webpack-cli": "5.1.4",
"webpack-dev-middleware": "7.4.2"
},
"resolutions": {
"puppeteer-core@npm:21.11.0/ws": "8.17.1"
},
"volta": {
"node": "22.9.0",
"node": "22.11.0",
"yarn": "1.22.22"
},
"packageManager": "[email protected].0"
"packageManager": "[email protected].1"
}
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@datadog/browser-core",
"version": "5.28.1",
"version": "5.31.1",
"license": "Apache-2.0",
"main": "cjs/index.js",
"module": "esm/index.js",
Expand Down
61 changes: 59 additions & 2 deletions packages/core/src/browser/addEventListener.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Configuration } from '@datadog/browser-core'
import { isIE } from '../tools/utils/browserDetection'
import type { Configuration } from '../domain/configuration'
import { createNewEvent, mockZoneJs, registerCleanupTask } from '../../test'
import type { MockZoneJs } from '../../test'
import { createNewEvent, mockZoneJs } from '../../test'
import { noop } from '../tools/utils/functionUtils'
import { addEventListener, DOM_EVENT } from './addEventListener'

Expand Down Expand Up @@ -35,6 +36,62 @@ describe('addEventListener', () => {
})
})

it('Use the EventTarget.prototype.addEventListener when the eventTarget is an instance of EventTarget', () => {
if (isIE()) {
pending('EventTarget not supported in IE')
}

// eslint-disable-next-line @typescript-eslint/unbound-method
const originalAddEventListener = EventTarget.prototype.addEventListener
// eslint-disable-next-line @typescript-eslint/unbound-method
const originalRemoveEventListener = EventTarget.prototype.removeEventListener

EventTarget.prototype.addEventListener = jasmine.createSpy()
EventTarget.prototype.removeEventListener = jasmine.createSpy()

registerCleanupTask(() => {
EventTarget.prototype.addEventListener = originalAddEventListener
EventTarget.prototype.removeEventListener = originalRemoveEventListener
})

const htmlDivElement = document.createElement('div')
htmlDivElement.addEventListener = jasmine.createSpy()
htmlDivElement.removeEventListener = jasmine.createSpy()

const { stop } = addEventListener({ allowUntrustedEvents: false }, htmlDivElement, DOM_EVENT.CLICK, noop)

const event = createNewEvent(DOM_EVENT.CLICK)
htmlDivElement.dispatchEvent(event)
stop()

// eslint-disable-next-line @typescript-eslint/unbound-method
expect(htmlDivElement.addEventListener).not.toHaveBeenCalled()
// eslint-disable-next-line @typescript-eslint/unbound-method
expect(htmlDivElement.removeEventListener).not.toHaveBeenCalled()

// eslint-disable-next-line @typescript-eslint/unbound-method
expect(EventTarget.prototype.addEventListener).toHaveBeenCalled()
// eslint-disable-next-line @typescript-eslint/unbound-method
expect(EventTarget.prototype.removeEventListener).toHaveBeenCalled()
})

it('Use the addEventListener method when the eventTarget is not an instance of EventTarget', () => {
const listener = jasmine.createSpy()

const customEventTarget = {
addEventListener: jasmine.createSpy(),
removeEventListener: jasmine.createSpy(),
} as unknown as EventTarget

const { stop } = addEventListener({ allowUntrustedEvents: false }, customEventTarget, 'change', listener)
stop()

// eslint-disable-next-line @typescript-eslint/unbound-method
expect(customEventTarget.addEventListener).toHaveBeenCalled()
// eslint-disable-next-line @typescript-eslint/unbound-method
expect(customEventTarget.removeEventListener).toHaveBeenCalled()
})

describe('Untrusted event', () => {
beforeEach(() => {
configuration = { allowUntrustedEvents: false } as Configuration
Expand Down
Loading

0 comments on commit 5d48861

Please sign in to comment.