Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
if: github.event_name == 'merge_group'
run: echo "CLA verification not needed for merge queue - already checked on PR"

- uses: DataDog/dd-octo-sts-action@08f2144903ced3254a3dafec2592563409ba2aa0 # v1.0.1
- uses: DataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80 # v1.0.3
if: github.event_name != 'merge_group'
id: octo-sts
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0

- name: Initialize CodeQL
uses: github/codeql-action/init@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2
uses: github/codeql-action/init@fe4161a26a8629af62121b670040955b330f9af2 # v4.31.6
with:
languages: javascript
config-file: .github/codeql-config.yml

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2
uses: github/codeql-action/analyze@fe4161a26a8629af62121b670040955b330f9af2 # v4.31.6
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
variables:
CURRENT_STAGING: staging-50
APP: 'browser-sdk'
CURRENT_CI_IMAGE: 93
CURRENT_CI_IMAGE: 94
BUILD_STABLE_REGISTRY: 'registry.ddbuild.io'
CI_IMAGE: '$BUILD_STABLE_REGISTRY/ci/$APP:$CURRENT_CI_IMAGE'
GIT_REPOSITORY: 'git@github.com:DataDog/browser-sdk.git'
Expand Down
382 changes: 191 additions & 191 deletions .yarn/releases/yarn-4.11.0.cjs → .yarn/releases/yarn-4.12.0.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.11.0.cjs
yarnPath: .yarn/releases/yarn-4.12.0.cjs
defaultSemverRangePrefix: ''
nodeLinker: node-modules

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:24.11.0-bookworm-slim
FROM node:24.11.1-bookworm-slim

ARG CHROME_PACKAGE_VERSION

Expand Down
10 changes: 5 additions & 5 deletions developer-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
"dev": "wxt"
},
"devDependencies": {
"@types/chrome": "0.1.27",
"@types/react": "19.2.2",
"@types/react-dom": "19.2.2",
"@types/chrome": "0.1.31",
"@types/react": "19.2.7",
"@types/react-dom": "19.2.3",
"@wxt-dev/module-react": "1.1.5",
"typescript": "5.9.3"
},
"dependencies": {
"@datadog/browser-core": "workspace:*",
"@datadog/browser-logs": "workspace:*",
"@datadog/browser-rum": "workspace:*",
"@mantine/core": "8.3.7",
"@mantine/hooks": "8.3.7",
"@mantine/core": "8.3.9",
"@mantine/hooks": "8.3.9",
"@tabler/icons-react": "3.35.0",
"clsx": "2.1.1",
"react": "19.2.0",
Expand Down
2 changes: 1 addition & 1 deletion developer-extension/src/panel/facets.constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Represents the path of a field in an event object. The special value '$eventSource' represent the
// event source (rum, logs, ...)
export type FieldPath = string
export type FieldValue = string | number | null | boolean | object
export type FieldValue = string | number | null | boolean | Record<string, unknown>
export type FieldMultiValue = FieldValue | FieldValue[]

// For now, facet values are only strings (we don't support number pickers etc.)
Expand Down
11 changes: 6 additions & 5 deletions developer-extension/src/panel/hooks/useEvents/facetRegistry.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getEventSource, type SdkEvent } from '../../sdkEvent'
import { createLogger } from '../../../common/logger'
import { FACET_ROOT } from '../../facets.constants'
import type { FacetValue, FieldPath, FieldMultiValue, FieldValue } from '../../facets.constants'
import { FACET_ROOT } from '../../facets.constants'

const logger = createLogger('facetRegistry')

Expand Down Expand Up @@ -117,15 +117,16 @@ export function getAllFields(event: object) {
getAllFieldsRecursively(item, path)
}
} else if (typeof value === 'object' && value !== null) {
const typedValue = value as Record<string, unknown>
if (path !== undefined) {
// Store the intermediary field
pushField(path, value)
pushField(path, typedValue)
}
// Recurse inside objects, building the path on the way
for (const key in value) {
if (Object.prototype.hasOwnProperty.call(value, key)) {
for (const key in typedValue) {
if (Object.prototype.hasOwnProperty.call(typedValue, key)) {
const itemPath = path === undefined ? key : `${path}.${key}`
const itemValue = (value as { [key: string]: unknown })[key]
const itemValue = (typedValue as { [key: string]: unknown })[key]
getAllFieldsRecursively(itemValue, itemPath)
}
}
Expand Down
17 changes: 10 additions & 7 deletions developer-extension/src/panel/hooks/useSdkInfos.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { useEffect, useState } from 'react'
import type { RumInternalContext, Context } from '@datadog/browser-core'
import type { LogsInitConfiguration } from '@datadog/browser-logs'
import type { RumInitConfiguration } from '@datadog/browser-rum'
import { createLogger } from '../../common/logger'
import { evalInWindow } from '../evalInWindow'

Expand All @@ -9,16 +12,16 @@ const REFRESH_INFOS_INTERVAL = 2000
export interface SdkInfos {
rum?: {
version?: string
config?: object & { site?: string }
internalContext?: object & { session: { id: string } }
globalContext?: object
user: object
config?: RumInitConfiguration
internalContext?: RumInternalContext
globalContext?: Context
user: Context
}
logs?: {
version?: string
config?: object & { site?: string }
globalContext?: object
user: object
config?: LogsInitConfiguration
globalContext?: Context
user: Context
}
cookie?: {
id?: string
Expand Down
2 changes: 1 addition & 1 deletion developer-extension/src/panel/hooks/useSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async function loadSettingsFromStorage() {
const storage = await chrome.storage.local.get()
settings = Object.fromEntries(
Object.entries(DEFAULT_SETTINGS).map(([name, defaultValue]) => [name, storage[name] ?? defaultValue])
) as Settings
) as unknown as Settings
if (settings) {
syncSettingsWithSessionStorage(settings)
}
Expand Down
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@
"@eslint/js": "9.39.1",
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
"@playwright/test": "1.56.1",
"@swc/core": "1.15.1",
"@types/chrome": "0.1.27",
"@swc/core": "1.15.3",
"@types/chrome": "0.1.31",
"@types/connect-busboy": "1.0.3",
"@types/cors": "2.8.19",
"@types/express": "5.0.5",
"@types/jasmine": "3.10.18",
"@types/node": "24.10.0",
"@types/node": "24.10.1",
"@types/node-forge": "1.3.14",
"ajv": "8.17.1",
"browserstack-local": "1.5.8",
Expand All @@ -66,11 +66,11 @@
"eslint-module-utils": "2.12.1",
"eslint-plugin-import": "2.32.0",
"eslint-plugin-jasmine": "4.2.2",
"eslint-plugin-jsdoc": "61.1.12",
"eslint-plugin-jsdoc": "61.4.1",
"eslint-plugin-unicorn": "62.0.0",
"express": "5.1.0",
"globals": "16.5.0",
"html-webpack-plugin": "5.6.4",
"html-webpack-plugin": "5.6.5",
"http-server": "14.1.1",
"jasmine-core": "3.99.1",
"json-schema-to-typescript": "bcaudan/json-schema-to-typescript#bcaudan/add-readonly-support",
Expand All @@ -83,28 +83,28 @@
"karma-sourcemap-loader": "0.4.0",
"karma-spec-reporter": "0.0.36",
"karma-webpack": "5.0.0",
"lerna": "9.0.0",
"lerna": "9.0.3",
"minimatch": "10.1.1",
"node-forge": "1.3.2",
"prettier": "3.6.2",
"puppeteer": "24.29.1",
"prettier": "3.7.3",
"puppeteer": "24.31.0",
"swc-loader": "0.2.6",
"terser-webpack-plugin": "5.3.14",
"ts-loader": "9.5.4",
"tsconfig-paths-webpack-plugin": "4.2.0",
"typedoc": "0.28.14",
"typedoc": "0.28.15",
"typescript": "5.9.3",
"typescript-eslint": "8.46.3",
"webpack": "5.102.1",
"typescript-eslint": "8.48.0",
"webpack": "5.103.0",
"webpack-cli": "6.0.1",
"webpack-dev-middleware": "7.4.5"
},
"resolutions": {
"puppeteer-core@npm:21.11.0/ws": "8.17.1"
},
"volta": {
"node": "24.11.0",
"yarn": "4.11.0"
"node": "24.11.1",
"yarn": "4.12.0"
},
"packageManager": "yarn@4.11.0"
"packageManager": "yarn@4.12.0"
}
6 changes: 3 additions & 3 deletions packages/core/src/tools/instrumentMethod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type PostCallCallback<TARGET extends { [key: string]: any }, METHOD extends keyo
* })
* })
*/
export function instrumentMethod<TARGET extends { [key: string]: any }, METHOD extends keyof TARGET & string>(
export function instrumentMethod<TARGET extends { [key: string]: any }, METHOD extends keyof TARGET>(
targetPrototype: TARGET,
method: METHOD,
onPreCall: (this: null, callInfos: InstrumentedMethodCall<TARGET, METHOD>) => void,
Expand All @@ -76,7 +76,7 @@ export function instrumentMethod<TARGET extends { [key: string]: any }, METHOD e
let original = targetPrototype[method]

if (typeof original !== 'function') {
if (method in targetPrototype && method.startsWith('on')) {
if (method in targetPrototype && typeof method === 'string' && method.startsWith('on')) {
original = noop as TARGET[METHOD]
} else {
return { stop: noop }
Expand All @@ -85,7 +85,7 @@ export function instrumentMethod<TARGET extends { [key: string]: any }, METHOD e

let stopped = false

const instrumentation = function (this: TARGET): ReturnType<TARGET[METHOD]> | undefined {
const instrumentation = function (this: TARGET): ReturnType<TARGET[METHOD]> {
if (stopped) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call
return original.apply(this, arguments as unknown as Parameters<TARGET[METHOD]>)
Expand Down
20 changes: 9 additions & 11 deletions packages/core/src/tools/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,31 @@ export function monitored<T extends (...params: any[]) => unknown>(
descriptor: TypedPropertyDescriptor<T>
) {
const originalMethod = descriptor.value!
descriptor.value = function (this: any, ...args: Parameters<T>) {
descriptor.value = function (this: ThisParameterType<T>, ...args: Parameters<T>) {
const decorated = onMonitorErrorCollected ? monitor(originalMethod) : originalMethod
return decorated.apply(this, args) as ReturnType<T>
} as T
}

export function monitor<T extends (...args: any[]) => any>(fn: T): T {
return function (this: any) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return callMonitored(fn, this, arguments as unknown as Parameters<T>)
export function monitor<T extends (...args: any[]) => unknown>(fn: T): T {
return function (this: ThisParameterType<T>, ...args: Parameters<T>) {
return callMonitored(fn, this, args)
} as unknown as T // consider output type has input type
}

export function callMonitored<T extends (...args: any[]) => any>(
export function callMonitored<T extends (...args: any[]) => unknown>(
fn: T,
context: ThisParameterType<T>,
args: Parameters<T>
): ReturnType<T> | undefined
export function callMonitored<T extends (this: void) => any>(fn: T): ReturnType<T> | undefined
export function callMonitored<T extends (...args: any[]) => any>(
export function callMonitored<T extends (this: void) => unknown>(fn: T): ReturnType<T> | undefined
export function callMonitored<T extends (...args: any[]) => unknown>(
fn: T,
context?: any,
args?: any
): ReturnType<T> | undefined {
try {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return fn.apply(context, args)
return fn.apply(context, args) as ReturnType<T>
} catch (e) {
monitorError(e)
}
Expand All @@ -65,7 +63,7 @@ export function monitorError(e: unknown) {
}
}

export function displayIfDebugEnabled(...args: any[]) {
export function displayIfDebugEnabled(...args: unknown[]) {
if (debugMode) {
display.error('[MONITOR]', ...args)
}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/tools/serialisation/sanitize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { detachToJsonMethod } from './jsonStringify'

// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
type PrimitivesAndFunctions = string | number | boolean | undefined | null | symbol | bigint | Function
type ExtendedContextValue = PrimitivesAndFunctions | object | ExtendedContext | ExtendedContextArray
type ExtendedContextValue = PrimitivesAndFunctions | ExtendedContext | ExtendedContextArray
interface ExtendedContext {
[key: string]: ExtendedContextValue
}
Expand Down Expand Up @@ -177,7 +177,7 @@ function sanitizeProcessor(
const currentPath = key !== undefined ? `${parentPath}.${key}` : parentPath
const target = Array.isArray(sourceToSanitize) ? ([] as ContextArray) : ({} as Context)
visitedObjectsWithPath.set(sourceAsObject, currentPath)
queue.push({ source: sourceToSanitize as ExtendedContext | ExtendedContextArray, target, path: currentPath })
queue.push({ source: sourceToSanitize, target, path: currentPath })

return target
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/emulate/mockXhr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function withXhr({
}

export class MockXhr extends MockEventTarget {
public static onSend: (xhr: MockXhr) => void | undefined
public static onSend: (xhr: MockXhr) => void
public response: string | undefined = undefined
public responseText: string | undefined = undefined
public status: number | undefined = undefined
Expand Down
7 changes: 2 additions & 5 deletions packages/core/test/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@
* ```
*/
export function callbackAddsInstrumentation(callback: () => void) {
const existingMethods: Array<[any, string, unknown]> = []
const existingMethods: Array<[any, PropertyKey, unknown]> = []
const expectation = {
callback,
toMethod<TARGET extends { [key: string]: any }, METHOD extends keyof TARGET & string>(
target: TARGET,
method: METHOD
) {
toMethod<TARGET extends { [key: string]: any }, METHOD extends keyof TARGET>(target: TARGET, method: METHOD) {
existingMethods.push([target, method, target[method]])
return expectation
},
Expand Down
2 changes: 1 addition & 1 deletion packages/flagging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
"access": "public"
},
"devDependencies": {
"webpack": "5.102.1"
"webpack": "5.103.0"
}
}
4 changes: 2 additions & 2 deletions packages/rum-core/src/domain/waitPageActivityEnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function isExcludedMutation(mutation: RumMutationRecord): boolean {

return Boolean(
targetElement &&
isElementNode(targetElement) &&
targetElement.matches(`[${EXCLUDED_MUTATIONS_ATTRIBUTE}], [${EXCLUDED_MUTATIONS_ATTRIBUTE}] *`)
isElementNode(targetElement) &&
targetElement.matches(`[${EXCLUDED_MUTATIONS_ATTRIBUTE}], [${EXCLUDED_MUTATIONS_ATTRIBUTE}] *`)
)
}
10 changes: 5 additions & 5 deletions packages/rum-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
}
},
"devDependencies": {
"@types/react": "19.2.2",
"@types/react-dom": "19.2.2",
"@types/react": "19.2.7",
"@types/react-dom": "19.2.3",
"react": "19.2.0",
"react-dom": "19.2.0",
"react-router": "7.9.5",
"react-router-dom": "7.9.5",
"react-router-dom-6": "npm:react-router-dom@6.30.1"
"react-router": "7.9.6",
"react-router-dom": "7.9.6",
"react-router-dom-6": "npm:react-router-dom@6.30.2"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"access": "public"
},
"devDependencies": {
"webpack": "5.102.1"
"webpack": "5.103.0"
}
}
4 changes: 2 additions & 2 deletions scripts/dev-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function createStaticSandboxApp(): express.Application {
entry: `${packagePath}/src/entries/main.ts`,
filename: packageName === 'worker' ? 'worker.js' : `datadog-${packageName}.js`,
})
)!
)
)
)
}
Expand Down Expand Up @@ -69,7 +69,7 @@ function createReactApp(): express.Application {
plugins: [new HtmlWebpackPlugin({ publicPath: '/react-app/' })],
mode: 'development',
})
)!
)
)
)

Expand Down
Loading