-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
refactor(build): remove quotes from preload marker #16562
Conversation
Run & review this pull request in StackBlitz Codeflow. |
Hmm, you're right. I didn't think that esbuild could break the I wonder if it's better to skip strings altogether though and use a plain |
Maybe a plain |
/ecosystem-ci run Checking the ecosystem for this to see if it works. If it does, I think we can further improve the code since we're no longer dealing with quotes. |
This comment was marked as outdated.
This comment was marked as outdated.
📝 Ran ecosystem CI on
✅ analogjs, astro, histoire, ladle, laravel, marko, nuxt, previewjs, quasar, qwik, rakkas, remix, sveltekit, unocss, vike, vite-plugin-pwa, vite-plugin-react, vite-plugin-react-pages, vite-plugin-react-swc, vite-plugin-svelte, vite-plugin-vue, vite-setup-catalogue, vitepress |
Seems like this strategy works fine too. I think we can polish up the code a bit to no longer refer it as quotes. |
replace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This LGTM. I'll let others have a review on this too in case I miss something.
I think the idea behind the quotes was originally to keep the code as a valid module. Maybe we should use |
Do you mean that , an undefined variable |
It may break if there is a plugin that is checking that all variables are properly defined. I don't know if we are respecting this in all our replacements though, just trying to understand why we have been using quotes so far. I like the idea that our plugins are generating a valid module at each step. |
Isn't using plain I suppose the only risk here is that EDIT: Using |
I think that, |
U R correct, |
…ELOAD__" This reverts commit 5b4ff2a.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the noise, ya, it looks safe to directly use an undefined variable here. I'm a bit puzzled as to why the quotes were added then. I'm good with doing this change 👍🏼
I'll queue this for the next minor then to be safe 👍 |
Description
relaxing
preloadMarkerWithQuote
reg to replace str like this :"__VITE_PRELOA\
D\
__"
But , there will be some performance problems.
fixes #16529