-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
process: fix process.features.typescript
when Amaro is unavailable
#55323
process: fix process.features.typescript
when Amaro is unavailable
#55323
Conversation
Review requested:
|
$ ./node -p process.config.variables.node_use_amaro
false
$ ./node -p process.features.typescript
false
$ 🎉 FWIW, with (and without) this PR I get this: $ ./node --experimental-transform-types -p process.features.typescript
node:internal/bootstrap/realm:429
if (!mod) throw new TypeError(`Missing internal module '${id}'`);
^
TypeError: Missing internal module 'internal/deps/amaro/dist/index'
at requireBuiltin (node:internal/bootstrap/realm:429:19)
at loadTypeScriptParser (node:internal/modules/helpers:346:19)
at stripTypeScriptTypes (node:internal/modules/helpers:368:17)
at node:internal/main/eval_string:27:3
Node.js v23.0.0-pre
$ If I try to use node/lib/internal/modules/helpers.js Line 346 in accb239
Just running with the experimental options but dropping into the REPL doesn't throw: $ ./node --experimental-transform-types
Welcome to Node.js v23.0.0-pre.
Type ".help" for more information.
> (node:95351) ExperimentalWarning: Type Stripping is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
> |
I think that's because it assumes the string you pass is TS. Can you try the following instead: echo 'console.log(process.features.typescript)' > file.cjs
./node --experimental-transform-types file.cjs |
👍 $ echo 'console.log(process.features.typescript)' > file.cjs
$ ./node --experimental-transform-types file.cjs
false
(node:96078) ExperimentalWarning: Type Stripping is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created) I think we probably still want some kind of guard, or maybe make the experimental options conditional on Amaro being used, but that could be done in (yet another) follow on PR. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #55323 +/- ##
==========================================
- Coverage 88.41% 88.41% -0.01%
==========================================
Files 652 652
Lines 186762 186740 -22
Branches 36099 36036 -63
==========================================
- Hits 165123 165099 -24
- Misses 14902 14908 +6
+ Partials 6737 6733 -4
|
I added the guard in this open PR #55282 |
This comment has been minimized.
This comment has been minimized.
Commit Queue failed- Loading data for nodejs/node/pull/55323 ✔ Done loading data for nodejs/node/pull/55323 ----------------------------------- PR info ------------------------------------ Title process: fix `process.features.typescript` when Amaro is unavailable (#55323) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch aduh95:process.features.typescript--without-amaro -> nodejs:main Labels process, author ready, needs-ci, strip-types Commits 3 - process: fix `process.features.typescript` when Amaro is unavailable - fixup! process: fix `process.features.typescript` when Amaro is unava… - fixup! process: fix `process.features.typescript` when Amaro is unava… Committers 1 - Antoine du Hamel <[email protected]> PR-URL: https://github.com/nodejs/node/pull/55323 Reviewed-By: Marco Ippolito <[email protected]> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/55323 Reviewed-By: Marco Ippolito <[email protected]> -------------------------------------------------------------------------------- ℹ This PR was created on Tue, 08 Oct 2024 16:49:34 GMT ✔ Approvals: 1 ✔ - Marco Ippolito (@marco-ippolito) (TSC): https://github.com/nodejs/node/pull/55323#pullrequestreview-2359200332 ✘ This PR needs to wait 105 more hours to land (or 0 hours if there is one more approval) ✔ Last GitHub CI successful ℹ Last Full PR CI on 2024-10-10T20:46:07Z: https://ci.nodejs.org/job/node-test-pull-request/63037/ - Querying data for job/node-test-pull-request/63037/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/11287733011 |
Landed in f98d9c1 |
PR-URL: #55323 Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Richard Lau <[email protected]>
PR-URL: nodejs#55323 Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Richard Lau <[email protected]>
Fixes: #55320 (comment)