Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
"packages/wasm"
],
"devDependencies": {
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-node-resolve": "^13.1.3",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^3.0.1",
"@rollup/plugin-sucrase": "^4.0.3",
"@rollup/plugin-typescript": "^8.3.1",
Expand Down
3 changes: 2 additions & 1 deletion packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"dependencies": {
"@sentry/core": "7.41.0",
"@sentry/replay": "7.41.0",
"@sentry/tracing": "7.41.0",
"@sentry/types": "7.41.0",
"@sentry/utils": "7.41.0",
"tslib": "^1.9.3"
Expand Down Expand Up @@ -46,7 +47,7 @@
},
"scripts": {
"build": "run-p build:transpile build:bundle build:types",
"build:dev": "yarn build",
"build:dev": "run-p build:transpile build:types",
"build:bundle": "rollup --config rollup.bundle.config.js",
"build:transpile": "rollup -c rollup.npm.config.js",
"build:types": "tsc -p tsconfig.types.json",
Expand Down
3 changes: 3 additions & 0 deletions packages/browser/rollup.npm.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ export default makeNPMConfigVariants(
makeBaseNPMConfig({
// packages with bundles have a different build directory structure
hasBundles: true,
packageSpecificConfig: {
external: ['@sentry/tracing/browser'],
},
}),
);
4 changes: 4 additions & 0 deletions packages/browser/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ export { makeBrowserOfflineTransport } from './transports/offline';
export { onProfilingStartRouteTransaction } from './profiling/hubextensions';
export { BrowserProfilingIntegration } from './profiling/integration';
// __ROLLUP_EXCLUDE_BROWSER_PROFILING_FROM_BUNDLES_END__

// __ROLLUP_EXCLUDE_BROWSER_TRACING_FROM_BUNDLES_BEGIN__
export { addTracingExtensions, BrowserTracing, instrumentOutgoingRequests } from '@sentry/tracing/browser';
// __ROLLUP_EXCLUDE_BROWSER_TRACING_FROM_BUNDLES_END__
2 changes: 1 addition & 1 deletion packages/browser/test/unit/profiling/integration.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getCurrentHub } from '@sentry/browser';
import { getCurrentHub } from '@sentry/core';
import type { Event } from '@sentry/types';
import { TextDecoder, TextEncoder } from 'util';

Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"access": "public"
},
"dependencies": {
"@rollup/plugin-commonjs": "24.0.0",
"@rollup/plugin-commonjs": "24.0.1",
"@sentry/core": "7.41.0",
"@sentry/integrations": "7.41.0",
"@sentry/node": "7.41.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/tracing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
".": {
"import": "./build/npm/esm/index.js",
"require": "./build/npm/cjs/index.js",
"types": "./build/npm/types/index.d.ts"
"default": "./build/npm/cjs/index.js"
},
"./node": {
"import": "./build/npm/esm/node/index.js",
"require": "./build/npm/cjs/node/index.js",
"types": "./build/npm/types/node/index.d.ts"
"default": "./build/npm/cjs/node/index.js"
},
"./browser": {
"import": "./build/npm/esm/browser/index.js",
"require": "./build/npm/cjs/browser/index.js",
"types": "./build/npm/types/browser/index.d.ts"
"default": "./build/npm/browser/node/index.js"
}
},
"typesVersions": {
Expand Down
4 changes: 3 additions & 1 deletion packages/tracing/src/browser/browsertracing.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable max-lines */
import type { Hub, IdleTransaction } from '@sentry/core';
import { Hub, IdleTransaction, addTracingExtensions } from '@sentry/core';
import { extractTraceparentData, startIdleTransaction, TRACING_DEFAULTS } from '@sentry/core';
import type { EventProcessor, Integration, Transaction, TransactionContext, TransactionSource } from '@sentry/types';
import { baggageHeaderToDynamicSamplingContext, getDomElement, logger } from '@sentry/utils';
Expand Down Expand Up @@ -165,6 +165,8 @@ export class BrowserTracing implements Integration {
private _latestRouteSource?: TransactionSource;

public constructor(_options?: Partial<BrowserTracingOptions>) {
addTracingExtensions();

this.options = {
...DEFAULT_BROWSER_TRACING_OPTIONS,
..._options,
Expand Down
1 change: 1 addition & 0 deletions packages/tracing/src/exports/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export {
extractTraceparentData,
getActiveTransaction,
hasTracingEnabled,
addTracingExtensions,
IdleTransaction,
Span,
// eslint-disable-next-line deprecation/deprecation
Expand Down
14 changes: 10 additions & 4 deletions rollup/bundleHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export function makeBaseBundleConfig(options) {
includeReplay,
includeOffline,
includeBrowserProfiling,
includeBrowserTracing,
} = options;

const nodeResolvePlugin = makeNodeResolvePlugin();
Expand All @@ -43,8 +44,9 @@ export function makeBaseBundleConfig(options) {
const licensePlugin = makeLicensePlugin(licenseTitle);
const tsPlugin = makeTSPlugin(jsVersion.toLowerCase());
const excludeReplayPlugin = makeExcludeBlockPlugin('REPLAY');
const excludeOfflineTransport = makeExcludeBlockPlugin('OFFLINE');
const excludeBrowserProfiling = makeExcludeBlockPlugin('BROWSER_PROFILING');
const excludeOfflineTransportPlugin = makeExcludeBlockPlugin('OFFLINE');
const excludeBrowserProfilingPlugin = makeExcludeBlockPlugin('BROWSER_PROFILING');
const excludeBrowserTracingPlugin = makeExcludeBlockPlugin('BROWSER_TRACING');

// The `commonjs` plugin is the `esModuleInterop` of the bundling world. When used with `transformMixedEsModules`, it
// will include all dependencies, imported or required, in the final bundle. (Without it, CJS modules aren't included
Expand All @@ -66,11 +68,15 @@ export function makeBaseBundleConfig(options) {
}

if (!includeOffline) {
standAloneBundleConfig.plugins.push(excludeOfflineTransport);
standAloneBundleConfig.plugins.push(excludeOfflineTransportPlugin);
}

if (!includeBrowserProfiling) {
standAloneBundleConfig.plugins.push(excludeBrowserProfiling);
standAloneBundleConfig.plugins.push(excludeBrowserProfilingPlugin);
}

if (!includeBrowserTracing) {
standAloneBundleConfig.plugins.push(excludeBrowserTracingPlugin);
}

// used by `@sentry/integrations` and `@sentry/wasm` (bundles which need to be combined with a stand-alone SDK bundle)
Expand Down
44 changes: 18 additions & 26 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3741,10 +3741,10 @@
dependencies:
web-streams-polyfill "^3.1.1"

"@rollup/plugin-commonjs@24.0.0":
version "24.0.0"
resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-24.0.0.tgz#fb7cf4a6029f07ec42b25daa535c75b05a43f75c"
integrity sha512-0w0wyykzdyRRPHOb0cQt14mIBLujfAv6GgP6g8nvg/iBxEm112t3YPPq+Buqe2+imvElTka+bjNlJ/gB56TD8g==
"@rollup/plugin-commonjs@24.0.1", "@rollup/plugin-commonjs@^24.0.1":
version "24.0.1"
resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-24.0.1.tgz#d54ba26a3e3c495dc332bd27a81f7e9e2df46f90"
integrity sha512-15LsiWRZk4eOGqvrJyu3z3DaBu5BhXIMeWnijSRvd8irrrg9SHpQ1pH+BUK4H6Z9wL9yOxZJMTLU+Au86XHxow==
dependencies:
"@rollup/pluginutils" "^5.0.1"
commondir "^1.0.1"
Expand Down Expand Up @@ -3779,19 +3779,6 @@
magic-string "^0.25.7"
resolve "^1.17.0"

"@rollup/plugin-commonjs@^21.0.1":
version "21.0.1"
resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-21.0.1.tgz#1e57c81ae1518e4df0954d681c642e7d94588fee"
integrity sha512-EA+g22lbNJ8p5kuZJUYyhhDK7WgJckW5g4pNN7n4mAFUM96VuwUnNT3xr2Db2iCZPI1pJPbGyfT5mS9T1dHfMg==
dependencies:
"@rollup/pluginutils" "^3.1.0"
commondir "^1.0.1"
estree-walker "^2.0.1"
glob "^7.1.6"
is-reference "^1.2.1"
magic-string "^0.25.7"
resolve "^1.17.0"

"@rollup/plugin-json@^4.0.0", "@rollup/plugin-json@^4.1.0":
version "4.1.0"
resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-4.1.0.tgz#54e09867ae6963c593844d8bd7a9c718294496f3"
Expand All @@ -3811,17 +3798,17 @@
is-module "^1.0.0"
resolve "^1.19.0"

"@rollup/plugin-node-resolve@^13.1.3":
version "13.1.3"
resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.1.3.tgz#2ed277fb3ad98745424c1d2ba152484508a92d79"
integrity sha512-BdxNk+LtmElRo5d06MGY4zoepyrXX1tkzX2hrnPEZ53k78GuOMWLqmJDGIIOPwVRIFZrLQOo+Yr6KtCuLIA0AQ==
"@rollup/plugin-node-resolve@^15.0.1":
version "15.0.1"
resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.0.1.tgz#72be449b8e06f6367168d5b3cd5e2802e0248971"
integrity sha512-ReY88T7JhJjeRVbfCyNj+NXAG3IIsVMsX9b5/9jC98dRP8/yxlZdz7mHZbHk5zHr24wZZICS5AcXsFZAXYUQEg==
dependencies:
"@rollup/pluginutils" "^3.1.0"
"@types/resolve" "1.17.1"
builtin-modules "^3.1.0"
"@rollup/pluginutils" "^5.0.1"
"@types/resolve" "1.20.2"
deepmerge "^4.2.2"
is-builtin-module "^3.2.0"
is-module "^1.0.0"
resolve "^1.19.0"
resolve "^1.22.1"

"@rollup/plugin-node-resolve@^9.0.0":
version "9.0.0"
Expand Down Expand Up @@ -4856,6 +4843,11 @@
dependencies:
"@types/node" "*"

"@types/resolve@1.20.2":
version "1.20.2"
resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.20.2.tgz#97d26e00cd4a0423b4af620abecf3e6f442b7975"
integrity sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==

"@types/rimraf@^2.0.2", "@types/rimraf@^2.0.3":
version "2.0.4"
resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-2.0.4.tgz#403887b0b53c6100a6c35d2ab24f6ccc042fec46"
Expand Down Expand Up @@ -14989,7 +14981,7 @@ is-buffer@~2.0.3:
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191"
integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==

is-builtin-module@^3.1.0:
is-builtin-module@^3.1.0, is-builtin-module@^3.2.0:
version "3.2.1"
resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-3.2.1.tgz#f03271717d8654cfcaf07ab0463faa3571581169"
integrity sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==
Expand Down