Skip to content
Closed
Show file tree
Hide file tree
Changes from 6 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
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,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 Expand Up @@ -115,7 +115,8 @@
"typescript": "3.8.3"
},
"resolutions": {
"**/agent-base": "5"
"**/agent-base": "5",
"**/jest-resolve": "29.5.0"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have to bump this so that we get around jestjs/jest#9771, which requires Jest >= 28

},
"version": "0.0.0",
"name": "sentry-javascript"
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'],
},
}),
);
7 changes: 7 additions & 0 deletions packages/browser/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,10 @@ 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__
// Need to disable import/no-unresolved since it does not work with the exports field
// https://github.com/import-js/eslint-plugin-import/issues/1810
// eslint-disable-next-line import/no-unresolved
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
Loading