Skip to content

feat(react-router): Create a Vite plugin that injects sentryConfig into the global vite config #16197

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 2 commits into from
May 6, 2025

Conversation

RulaKhaled
Copy link
Member

@RulaKhaled RulaKhaled commented May 5, 2025

Fixes: #15520

Add a new plugin makeConfigInjectorPlugin within our existing vite plugin that updates the global vite config with sentry options

  • [ ✅] If you've added code that should be tested, please add tests.
  • [ ✅] Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

@RulaKhaled RulaKhaled requested a review from chargome May 5, 2025 15:26
@chargome chargome changed the title feat: Create a Vite plugin that injects sentryConfig into the global vite config feat(react-router): Create a Vite plugin that injects sentryConfig into the global vite config May 6, 2025
Copy link
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

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

Nice! 🚀

@chargome
Copy link
Member

chargome commented May 6, 2025

Could you just add a sentence to the PR description what this does (for the changelog) and open a pr in our docs repo?

@RulaKhaled
Copy link
Member Author

Could you just add a sentence to the PR description what this does (for the changelog) and open a pr in our docs repo?

getsentry/sentry-docs#13610

@RulaKhaled RulaKhaled marked this pull request as ready for review May 6, 2025 09:02
@RulaKhaled RulaKhaled merged commit a04f3cc into develop May 6, 2025
31 of 32 checks passed
@RulaKhaled RulaKhaled deleted the rola/config-injector branch May 6, 2025 09:10
RulaKhaled added a commit to getsentry/sentry-docs that referenced this pull request May 8, 2025
<!-- Use this checklist to make sure your PR is ready for merge. You may
delete any sections you don't need. -->

## DESCRIBE YOUR PR

Should document changes made in
getsentry/sentry-javascript#16197

TL;DR: Users no longer need to pass SentryOptions to the Vite global
config—this is now handled under the hood by the React Router Vite
plugin.

<img width="762" alt="Screenshot 2025-05-06 at 10 44 20 AM"
src="https://github.com/user-attachments/assets/e7618662-dcc2-45c0-abed-c4c71a259762"
/>


## LEGAL BOILERPLATE

<!-- Sentry employees and contractors can delete or ignore this section.
-->

Look, I get it. The entity doing business as "Sentry" was incorporated
in the State of Delaware in 2015 as Functional Software, Inc. and is
gonna need some rights from me in order to utilize my contributions in
this here PR. So here's the deal: I retain all rights, title and
interest in and to my contributions, and by keeping this boilerplate
intact I confirm that Sentry can use, modify, copy, and redistribute my
contributions, under Sentry's choice of terms.

## EXTRA RESOURCES

- [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RR7] Add vite plugin for updating sentry options in vite config
2 participants