Skip to content

feat(react-router): Add build-time config #15406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
move telemetry option
  • Loading branch information
chargome committed Feb 26, 2025
commit 066d5065d2e0479421019cd346f4a993d9baa99a
13 changes: 3 additions & 10 deletions packages/react-router/src/vite/makeCustomSentryVitePlugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,16 @@ import type { SentryReactRouterBuildOptions } from './types';
* Create a custom subset of sentry's vite plugins
*/
export async function makeCustomSentryVitePlugins(options: SentryReactRouterBuildOptions): Promise<Plugin[]> {
const {
debug,
sourceMapsUploadOptions,
unstable_sentryVitePluginOptions,
bundleSizeOptimizations,
authToken,
org,
project,
} = options;
const { debug, unstable_sentryVitePluginOptions, bundleSizeOptimizations, authToken, org, project, telemetry } =
options;

const sentryVitePlugins = sentryVitePlugin({
authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,
bundleSizeOptimizations,
debug: debug ?? false,
org: org ?? process.env.SENTRY_ORG,
project: project ?? process.env.SENTRY_PROJECT,
telemetry: sourceMapsUploadOptions?.telemetry ?? true,
telemetry: telemetry ?? true,
_metaOptions: {
telemetry: {
metaFramework: 'react-router',
Expand Down
16 changes: 8 additions & 8 deletions packages/react-router/src/vite/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ type SourceMapsOptions = {
*/
enabled?: boolean;

/**
* If this flag is `true`, the Sentry plugin will collect some telemetry data and send it to Sentry.
* It will not collect any sensitive or user-specific data.
*
* @default true
*/
telemetry?: boolean;

/**
* A glob or an array of globs that specifies the build artifacts that should be deleted after the artifact
* upload to Sentry has been completed.
Expand Down Expand Up @@ -139,6 +131,14 @@ export type SentryReactRouterBuildOptions = {
*/
sourceMapsUploadOptions?: SourceMapsOptions;

/**
* If this flag is `true`, the Sentry plugin will collect some telemetry data and send it to Sentry.
* It will not collect any sensitive or user-specific data.
*
* @default true
*/
telemetry?: boolean;

/**
* Options to further customize the Sentry Vite Plugin (@sentry/vite-plugin) behavior directly.
* Options specified in this object take precedence over the options specified in
Expand Down
Loading