-
Notifications
You must be signed in to change notification settings - Fork 0
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
Unflag --experimental-strip-types
#17
Comments
|
For number 3, it would be amazing to have a tool (published under |
Created a checklist feel free to edit/suggest points |
Hi, I'm the maintainer of unjs/jiti (used by Nuxt, Nitro, ESLint, ...). A while ago, we released v2, which is being widely adopted. In v2, we have enabled a new native mode (opt-in) that depends on runtime type-stripping and only adds a few resolutions add-ons mainly to ease up tooling transition to full-native support and eventually phasing out the need of custom loader. (this feature being backported to supported Node.js releases, certainly speeds this up for us!) We also run tests against Node.js with One other note to add, jiti does not read or depend on |
Astro isn't currently ready to test the new flag, unfortunately. The CLI binary entry point is a JavaScript file (not a TS file), and all our internal modules are pulled from the As a quick test, I renamed our binary to |
Since TypeScript shipped support (via transpilation) for Explicit Resource Management, the I'm not aware of any way to disable support for Some ideas:
|
That falls in the same category of decorators, Node.js will not polyfill until V8 supports them. We might document it as a generic rule. @kdy1 is it the current swc policy right? |
@marco-ippolito have you considered something like option 3 that I proposed above for these syntactic issues? I think the benefit of that would be to fail fast while also giving the opportunity to provide a more meaningful and self-describing error. node --experimental-strip-types -e "(() => { using test = { [Symbol.dispose]() }; })()"
(node:6400) ERROR: --experimental-strip-types is incompatible with the `using` keyword. See: https://nodejs.org/docs/... |
That would also mean to time the swc release (or unflag something) with the v8 update so that we don't block users from using (🥁 ) the new feature. Imho probably not worth it as long as we document it, its like running |
@ematipico if you need some support, or accept PRs I could help |
I see what you mean. Perhaps there's an opportunity for |
I disagree here. Folks who are likely to be users of this flag are ones who are authoring TypeScript. Part of the benefit of authoring TypeScript is the immediate feedback loop from the language services. For users who are not experts in the nuances of transpilation and type-stripping will not get the early feedback they expect and will be confused. Anyway, it's a small thing in service of a more delightful user experience. I understand if it creates too much of a lift. |
Preventing the use of select features because they have a larger downlevel than others seems very much out of the scope of Node.js. If you use these features with strip types (or similar), you aren't even publishing the downleveled code, you're just running it in-memory. Banning these features seems much more like a personal preference and can be pretty easily done in a linter. A runtime is just there to run the user's code. A runtime could even choose to use a transpilation approach to implement newer features and the effect would be the same. |
I agree with both of you on a technical level but feel convinced that the broader user-base that will want to adopt type stripping won't understand what's going on. I'm thinking there's an opportunity to avoid issues being filed across TS and Node.js repos if the docs + implementation adopt a proactive strategy for informing users of these edge cases. |
I agree with @jakebailey that we probably don't need to take any extra steps to prevent feature usage. The reason is that Node/Amaro already uses So it would feel odd to add more error checking that was specific to Conversely, I would support auditing to ensure any errors are consistent across |
To clarify, marking it as stable means that instead of Or does that mean the option will not even be necessary, and that users will be able to directly execute |
This plan is for the unflagging: |
Marking as stable also means further breaking changes would only happen in major releases. |
Issue to track the work needed to unflag
--experimental-strip-types
, blockers and other considerations.@nodejs/typescript
moduleResolution
and other TS configurations. doc: add suggested tsconfig for type stripping node#55534The text was updated successfully, but these errors were encountered: