Skip to content

Commit d5e236e

Browse files
authored
Merge branch 'master' into yoann/add-submit-log-flag
2 parents 27d4c05 + f089133 commit d5e236e

31 files changed

Lines changed: 488 additions & 19 deletions

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ packages/plugins/error-tracking @yoannmoin
2323

2424
# Rum
2525
packages/plugins/rum @yoannmoinet
26+
packages/plugins/rum/src/privacy @DataDog/rum-browser
2627

2728
# Analytics
2829
packages/plugins/analytics @yoannmoinet

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
uses: actions/cache@v4
2929
with:
3030
path: packages/published/**/dist
31-
key: ${{ matrix.node }}-cache-build-${{ hashFiles('packages/published/**', 'yarn.lock') }}
31+
key: ${{ matrix.node }}-cache-build-${{ hashFiles('packages/published/**', 'yarn.lock', 'packages/tools/src/rollupConfig.mjs') }}
3232

3333
- name: Configure Datadog Test Optimization
3434
uses: datadog/test-visibility-github-action@v2
Binary file not shown.
Binary file not shown.

LICENSES-3rdparty.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ Component,Origin,Licence,Copyright
119119
@datadog/browser-core,npm,Apache-2.0,(https://www.npmjs.com/package/@datadog/browser-core)
120120
@datadog/browser-rum,virtual,Apache-2.0,(https://www.npmjs.com/package/@datadog/browser-rum)
121121
@datadog/browser-rum-core,npm,Apache-2.0,(https://www.npmjs.com/package/@datadog/browser-rum-core)
122+
@datadog/js-instrumentation-wasm,npm,MIT,(https://github.com/datadog/js-instrumentation-wasm#readme)
122123
@esbuild/darwin-arm64,npm,MIT,(https://www.npmjs.com/package/@esbuild/darwin-arm64)
123124
@esbuild/darwin-x64,npm,MIT,(https://www.npmjs.com/package/@esbuild/darwin-x64)
124125
@esbuild/linux-x64,npm,MIT,(https://www.npmjs.com/package/@esbuild/linux-x64)

packages/core/src/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// This file is partially generated.
66
// Anything between #imports-injection-marker and #types-injection-marker
77
// will be updated using the 'yarn cli integrity' command.
8-
98
import type { TrackedFilesMatcher } from '@dd/internal-git-plugin/trackedFilesMatcher';
109
/* eslint-disable arca/import-ordering */
1110
// #imports-injection-marker

packages/plugins/rum/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
"toBuild": {
1515
"rum-browser-sdk": {
1616
"entry": "./src/built/rum-browser-sdk.ts"
17+
},
18+
"privacy-helpers": {
19+
"format": [
20+
"cjs",
21+
"esm"
22+
],
23+
"entry": "./src/built/privacy-helpers.ts"
1724
}
1825
},
1926
"exports": {
@@ -24,7 +31,9 @@
2431
"typecheck": "tsc --noEmit"
2532
},
2633
"dependencies": {
34+
"@datadog/js-instrumentation-wasm": "0.9.4",
2735
"@dd/core": "workspace:*",
36+
"@rollup/pluginutils": "5.1.4",
2837
"chalk": "2.3.1"
2938
},
3039
"devDependencies": {
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the MIT License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
/* eslint-env browser */
6+
/* global globalThis */
7+
const globalAny: any = globalThis;
8+
globalAny.$DD_ALLOW = new Set();
9+
10+
export function $(newValues: string[] | TemplateStringsArray) {
11+
const initialSize = globalAny.$DD_ALLOW.size;
12+
newValues.forEach((value) => globalAny.$DD_ALLOW.add(value));
13+
if (globalAny.$DD_ALLOW.size !== initialSize) {
14+
if (globalAny.$DD_ALLOW_OBSERVERS) {
15+
globalAny.$DD_ALLOW_OBSERVERS.forEach((cb: () => void) => cb());
16+
}
17+
}
18+
19+
return newValues;
20+
}

packages/plugins/rum/src/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { InjectPosition } from '@dd/core/types';
77
import path from 'path';
88

99
import { CONFIG_KEY, PLUGIN_NAME } from './constants';
10+
import { getPrivacyPlugin } from './privacy';
1011
import { getInjectionValue } from './sdk';
1112
import type { RumOptions, RumOptionsWithSdk, RumPublicApi, RumInitConfiguration } from './types';
1213
import { validateOptions } from './validate';
@@ -54,5 +55,13 @@ export const getPlugins: GetPlugins = ({ options, context }) => {
5455
});
5556
}
5657

58+
if (validatedOptions.privacy) {
59+
// Add the privacy plugin.
60+
const privacyPlugin = getPrivacyPlugin(validatedOptions.privacy);
61+
if (privacyPlugin) {
62+
plugins.push(privacyPlugin);
63+
}
64+
}
65+
5766
return plugins;
5867
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the MIT License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
import type { PluginName } from '@dd/core/types';
6+
7+
export const PLUGIN_NAME: PluginName = 'datadog-rum-privacy-plugin' as const;
8+
export const PRIVACY_HELPERS_MODULE_ID = '\0datadog:privacy-helpers';

0 commit comments

Comments
 (0)