Open DarthGigi opened 1 month ago
Hey @DarthGigi thanks for writing in and apologies for the late reply!
Why is Sentry changing my markup? Isn't it supposed to just change it's own stuff and only in when transforming the files
Hmm that's also a weird one. I'll check what's going wrong here.
Same here. Migration script deletes or rewrites random seeming sections of our codebase. I tried to figure out which option ("transformer") is responsible, but more than one seem to trigger this.
Even if you only Add migration comments
, the script will rewrite over 400 files and break 150 of them.
Environment
Svelte/Kit
Steps to Reproduce
pnpx @sentry/migr8@latest
Apply all transformations
Expected Result
The migrate command changes the files that are actually necessary to be changed and in the right way
Actual Result
For each component I have in my
routes
folder, I get the following error:This is because for some reason![Screenshot 2024-05-16 at 9 43 31@2x](https://github.com/getsentry/sentry-migr8/assets/47110839/12cfc6f3-db5c-406a-9824-b2898c82012a)
</string>
is being added just before</script>
when transforming the files:This doesn't happen in sveltekit's route files (+layout and +page.svelte) files, however, it does in
+error.svelte
files.Another thing is that for some reason it tries to "fix" self-closing elements. If we have
<div />
for example, it changes it to<div></div>
, while it is true that<div />
is not valid HTML, this should not apply to components:Why is Sentry changing my markup? Isn't it supposed to just change it's own stuff and only in
<script>
tags?Another thing you can see in the screenshot is that Sentry added
</svelte:window>
to the bottom of the file:<svelte:window/>
does not accept children, so it must be always closed/self closed without anything as it's child<svelte:window/>
is already closed, why does Sentry think it's not?This migrate command changed about 170 files (mostly .svelte files since I'm using shadcn svelte components) which makes it not worth going over the stuff that Sentry changed to actually migrate from v7 to v8 and to check if there are any todo's left.
Feel free to change the title of this issue to a more fitting one.