-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
fix: specify own Node version as target when bundling config files #17307
Conversation
Run & review this pull request in StackBlitz Codeflow. |
esbuild was not removing import attributes for dynamic imports
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.
This looks fine to me. I remember discussing with @patak-dev that we could derive from process.versions.node
but decided otherwise to prevent potential compat issues. The linked issue seems to be a good argument to derive it still.
I have noticed that the tests in this PR are not working (dynamic imports are not modified by esbuild at all!), and I am wondering what I should do about it. |
requires Node >= v18.20.0, >= v20.10.0, or >= v22.0.0
CI failed, but I think it will succeed on re-run (I don't have permission to do that). |
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.
but is it acceptable for the tests not to pass in the old (<= v18.19.x, <= v20.9.x) Node.js?
Could we add some node version checks so that we skip testing this case in older versions, and so it doesn't fail for devs using an older node version locally? (I think I saw some checks you did in the previous commits)
By splitting the test file, the import attributes test can now be run conditionally. Tested with v18.12.0, v18.19.0, v18.20.0, v20.12.0, and v22.0.0. |
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.
Looks great! Thanks for updating the PR. I think the test for now is fine and should be enough.
/ecosystem-ci run |
📝 Ran ecosystem CI on
✅ histoire, ladle, laravel, marko, previewjs, quasar, qwik, rakkas, remix, sveltekit, unocss, vite-plugin-pwa, vite-plugin-react, vite-plugin-react-swc, vite-plugin-svelte, vite-plugin-vue, vite-setup-catalogue, vitepress |
The analog fail seems to be something on their end. I think this is ready to go in the next minor. |
Description
fixes #17291
I am uncertain if it is safe to specify
node${process.versions.node}
fortarget
.At least esbuild supports a notation like
node22.2.0
andnode99.999.9999
, but I am not sure about the following points:process.versions.node
is always present and in X.Y.Z format (at least bun seemed to have this)