Skip to content

feat(sveltekit): Use magicast to insert Sentry.init and vite plugin#257

Merged
Lms24 merged 1 commit intolms/sveltekit-supportfrom
lms/just-ast-things
Apr 21, 2023
Merged

feat(sveltekit): Use magicast to insert Sentry.init and vite plugin#257
Lms24 merged 1 commit intolms/sveltekit-supportfrom
lms/just-ast-things

Conversation

@Lms24
Copy link
Copy Markdown
Member

@Lms24 Lms24 commented Apr 20, 2023

So.. We might get into trouble for this but magicast is super nice IMO!

This PR replaces the "old" init call injection approach with using magicast to modify the file. It's a bit hacky as magicast doesn't provide proper API to do this but it works overall pretty well and I have a better feeling about it than using regex for it (we'll see if that holds up 😅)

Furthermore, this PR uses the super-nice top-level magicast helper addVitePlugin to add our plugin constructor to the vite config. This brings the manual setup down to two steps!

#skip-changelog

ref #244

@Lms24 Lms24 requested a review from lforst April 20, 2023 12:48
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 20, 2023

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against cbd6f61

@Lms24 Lms24 self-assigned this Apr 20, 2023
@Lms24 Lms24 force-pushed the lms/just-ast-things branch from ae578cc to cbd6f61 Compare April 20, 2023 12:51
@Lms24 Lms24 merged commit 753065f into lms/sveltekit-support Apr 21, 2023
@Lms24 Lms24 deleted the lms/just-ast-things branch April 21, 2023 09:58
Lms24 added a commit that referenced this pull request Apr 21, 2023
…#257)

Replace the "old" init call injection approach with using magicast to modify the file
Lms24 added a commit that referenced this pull request May 3, 2023
…#257)

Replace the "old" init call injection approach with using magicast to modify the file
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.

2 participants