Skip to content
Closed
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
962 changes: 962 additions & 0 deletions deno.lock

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions packages/browser/rollup.bundle.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,55 @@ const tracingReplayFeedbackBaseBundleConfig = makeBaseBundleConfig({
outputFileBase: () => 'bundles/bundle.tracing.replay.feedback',
});

const loggerBaseBundleConfig = makeBaseBundleConfig({
bundleType: 'standalone',
entrypoints: ['src/index.bundle.logger.ts'],
licenseTitle: '@sentry/browser (Logger)',
outputFileBase: () => 'bundles/bundle.logger',
});

const tracingLoggerBaseBundleConfig = makeBaseBundleConfig({
bundleType: 'standalone',
entrypoints: ['src/index.bundle.tracing.logger.ts'],
licenseTitle: '@sentry/browser (Performance Monitoring and Logger)',
outputFileBase: () => 'bundles/bundle.tracing.logger',
});

const replayLoggerBaseBundleConfig = makeBaseBundleConfig({
bundleType: 'standalone',
entrypoints: ['src/index.bundle.replay.logger.ts'],
licenseTitle: '@sentry/browser (Replay and Logger)',
outputFileBase: () => 'bundles/bundle.replay.logger',
});

const feedbackLoggerBaseBundleConfig = makeBaseBundleConfig({
bundleType: 'standalone',
entrypoints: ['src/index.bundle.feedback.logger.ts'],
licenseTitle: '@sentry/browser (Feedback and Logger)',
outputFileBase: () => 'bundles/bundle.feedback.logger',
});

const tracingReplayLoggerBaseBundleConfig = makeBaseBundleConfig({
bundleType: 'standalone',
entrypoints: ['src/index.bundle.tracing.replay.logger.ts'],
licenseTitle: '@sentry/browser (Performance Monitoring, Replay, and Logger)',
outputFileBase: () => 'bundles/bundle.tracing.replay.logger',
});

const replayFeedbackLoggerBaseBundleConfig = makeBaseBundleConfig({
bundleType: 'standalone',
entrypoints: ['src/index.bundle.replay.feedback.logger.ts'],
licenseTitle: '@sentry/browser (Replay, Feedback, and Logger)',
outputFileBase: () => 'bundles/bundle.replay.feedback.logger',
});

const tracingReplayFeedbackLoggerBaseBundleConfig = makeBaseBundleConfig({
bundleType: 'standalone',
entrypoints: ['src/index.bundle.tracing.replay.feedback.logger.ts'],
licenseTitle: '@sentry/browser (Performance Monitoring, Replay, Feedback, and Logger)',
outputFileBase: () => 'bundles/bundle.tracing.replay.feedback.logger',
});

builds.push(
...makeBundleConfigVariants(baseBundleConfig),
...makeBundleConfigVariants(tracingBaseBundleConfig),
Expand All @@ -112,6 +161,13 @@ builds.push(
...makeBundleConfigVariants(tracingReplayBaseBundleConfig),
...makeBundleConfigVariants(replayFeedbackBaseBundleConfig),
...makeBundleConfigVariants(tracingReplayFeedbackBaseBundleConfig),
...makeBundleConfigVariants(loggerBaseBundleConfig),
...makeBundleConfigVariants(tracingLoggerBaseBundleConfig),
...makeBundleConfigVariants(replayLoggerBaseBundleConfig),
...makeBundleConfigVariants(feedbackLoggerBaseBundleConfig),
...makeBundleConfigVariants(tracingReplayLoggerBaseBundleConfig),
...makeBundleConfigVariants(replayFeedbackLoggerBaseBundleConfig),
...makeBundleConfigVariants(tracingReplayFeedbackLoggerBaseBundleConfig),
);

export default builds;
15 changes: 15 additions & 0 deletions packages/browser/src/index.bundle.feedback.logger.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { browserTracingIntegrationShim, replayIntegrationShim } from '@sentry-internal/integration-shims';
import { feedbackAsyncIntegration } from './feedbackAsync';

export * from './index.bundle.base';

export { logger } from '@sentry/core';

export { getFeedback, sendFeedback } from '@sentry-internal/feedback';

export {
browserTracingIntegrationShim as browserTracingIntegration,
feedbackAsyncIntegration as feedbackAsyncIntegration,
feedbackAsyncIntegration as feedbackIntegration,
replayIntegrationShim as replayIntegration,
};
16 changes: 16 additions & 0 deletions packages/browser/src/index.bundle.logger.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {
browserTracingIntegrationShim,
feedbackIntegrationShim,
replayIntegrationShim,
} from '@sentry-internal/integration-shims';

export * from './index.bundle.base';

export { logger } from '@sentry/core';

export {
browserTracingIntegrationShim as browserTracingIntegration,
feedbackIntegrationShim as feedbackAsyncIntegration,
feedbackIntegrationShim as feedbackIntegration,
replayIntegrationShim as replayIntegration,
};
Copy link

Choose a reason for hiding this comment

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

Missing integration or E2E tests for new feature

Low Severity · BugBot Rules

Per the rules file in the user instructions: "When reviewing a feat PR, check if the PR includes at least one integration or E2E test. If neither of the two are present, add a comment, recommending to add one." This PR adds 7 new logger bundle variants but doesn't include any integration or E2E tests to verify the bundles work correctly and export the expected APIs. Adding tests would help catch issues like the missing feedback integration exports in the tracing.replay.feedback.logger bundle.

Fix in Cursor Fix in Web

16 changes: 16 additions & 0 deletions packages/browser/src/index.bundle.replay.feedback.logger.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { browserTracingIntegrationShim } from '@sentry-internal/integration-shims';
import { feedbackAsyncIntegration } from './feedbackAsync';

export * from './index.bundle.base';

export { logger } from '@sentry/core';

export { getFeedback, sendFeedback } from '@sentry-internal/feedback';

export { replayIntegration, getReplay } from '@sentry-internal/replay';

export {
browserTracingIntegrationShim as browserTracingIntegration,
feedbackAsyncIntegration as feedbackAsyncIntegration,
feedbackAsyncIntegration as feedbackIntegration,
};
13 changes: 13 additions & 0 deletions packages/browser/src/index.bundle.replay.logger.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { browserTracingIntegrationShim, feedbackIntegrationShim } from '@sentry-internal/integration-shims';

export * from './index.bundle.base';

export { logger } from '@sentry/core';

export { replayIntegration, getReplay } from '@sentry-internal/replay';

export {
browserTracingIntegrationShim as browserTracingIntegration,
feedbackIntegrationShim as feedbackAsyncIntegration,
feedbackIntegrationShim as feedbackIntegration,
};
33 changes: 33 additions & 0 deletions packages/browser/src/index.bundle.tracing.logger.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { registerSpanErrorInstrumentation } from '@sentry/core';
import { feedbackIntegrationShim, replayIntegrationShim } from '@sentry-internal/integration-shims';

registerSpanErrorInstrumentation();

export * from './index.bundle.base';

export {
getActiveSpan,
getRootSpan,
startSpan,
startInactiveSpan,
startSpanManual,
startNewTrace,
withActiveSpan,
getSpanDescendants,
setMeasurement,
logger,
} from '@sentry/core';

export {
browserTracingIntegration,
startBrowserTracingNavigationSpan,
startBrowserTracingPageLoadSpan,
} from './tracing/browserTracingIntegration';
export { reportPageLoaded } from './tracing/reportPageLoaded';
export { setActiveSpanInBrowser } from './tracing/setActiveSpan';

export {
feedbackIntegrationShim as feedbackAsyncIntegration,
feedbackIntegrationShim as feedbackIntegration,
replayIntegrationShim as replayIntegration,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { registerSpanErrorInstrumentation } from '@sentry/core';
import { feedbackIntegrationShim } from '@sentry-internal/integration-shims';
Copy link

Choose a reason for hiding this comment

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

Bug: The index.bundle.tracing.replay.feedback.logger.ts file imports the shim but fails to export feedbackIntegration, preventing users of this bundle from initializing the feedback feature.
Severity: CRITICAL

🔍 Detailed Analysis

The bundle file index.bundle.tracing.replay.feedback.logger.ts is intended to provide full feedback functionality, as indicated by its name. However, while it exports helper functions like getFeedback and sendFeedback, it incorrectly imports feedbackIntegrationShim and fails to export the main feedbackIntegration or feedbackAsyncIntegration. Consequently, users attempting to initialize Sentry with Sentry.feedbackIntegration() in this bundle will encounter a runtime error because the function will be undefined, making the feedback feature unusable.

💡 Suggested Fix

In index.bundle.tracing.replay.feedback.logger.ts, replace the import of feedbackIntegrationShim with feedbackAsyncIntegration from ./feedbackAsync. Then, add an export statement like export { feedbackAsyncIntegration as feedbackAsyncIntegration, feedbackAsyncIntegration as feedbackIntegration } to correctly expose the integration.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: packages/browser/src/index.bundle.tracing.replay.feedback.logger.ts#L2

Potential issue: The bundle file `index.bundle.tracing.replay.feedback.logger.ts` is
intended to provide full feedback functionality, as indicated by its name. However,
while it exports helper functions like `getFeedback` and `sendFeedback`, it incorrectly
imports `feedbackIntegrationShim` and fails to export the main `feedbackIntegration` or
`feedbackAsyncIntegration`. Consequently, users attempting to initialize Sentry with
`Sentry.feedbackIntegration()` in this bundle will encounter a runtime error because the
function will be undefined, making the feedback feature unusable.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 8475823


registerSpanErrorInstrumentation();

export * from './index.bundle.base';

export {
getActiveSpan,
getRootSpan,
startSpan,
startInactiveSpan,
startSpanManual,
startNewTrace,
withActiveSpan,
getSpanDescendants,
setMeasurement,
logger,
} from '@sentry/core';

export {
browserTracingIntegration,
startBrowserTracingNavigationSpan,
startBrowserTracingPageLoadSpan,
} from './tracing/browserTracingIntegration';
export { reportPageLoaded } from './tracing/reportPageLoaded';
export { setActiveSpanInBrowser } from './tracing/setActiveSpan';

export { getFeedback, sendFeedback } from '@sentry-internal/feedback';

export { replayIntegration, getReplay } from '@sentry-internal/replay';
Copy link

Choose a reason for hiding this comment

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

Missing feedback integration exports in tracing.replay.feedback.logger bundle

High Severity

The bundle.tracing.replay.feedback.logger bundle is missing the feedback integration exports. It imports feedbackIntegrationShim but never uses it, and it doesn't import feedbackAsyncIntegration from ./feedbackAsync or export feedbackAsyncIntegration/feedbackIntegration. Comparing with index.bundle.tracing.replay.feedback.ts, this file needs to import feedbackAsyncIntegration and export it as both feedbackAsyncIntegration and feedbackIntegration. Without this, users of this bundle won't have access to the feedback integration despite the bundle name suggesting otherwise.

Fix in Cursor Fix in Web

31 changes: 31 additions & 0 deletions packages/browser/src/index.bundle.tracing.replay.logger.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { registerSpanErrorInstrumentation } from '@sentry/core';
import { feedbackIntegrationShim } from '@sentry-internal/integration-shims';

registerSpanErrorInstrumentation();

export * from './index.bundle.base';

export {
getActiveSpan,
getRootSpan,
startSpan,
startInactiveSpan,
startSpanManual,
startNewTrace,
withActiveSpan,
getSpanDescendants,
setMeasurement,
logger,
} from '@sentry/core';

export {
browserTracingIntegration,
startBrowserTracingNavigationSpan,
startBrowserTracingPageLoadSpan,
} from './tracing/browserTracingIntegration';
export { reportPageLoaded } from './tracing/reportPageLoaded';
export { setActiveSpanInBrowser } from './tracing/setActiveSpan';

export { feedbackIntegrationShim as feedbackAsyncIntegration, feedbackIntegrationShim as feedbackIntegration };

export { replayIntegration, getReplay } from '@sentry-internal/replay';