GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Start Node ESM stable version at Node16 by DanielRosenwasser · Pull Request #48879 · microsoft/TypeScript Conversation
Member
Today Node 16 provides two really nice characteristics:
This PR starts our minimum stable version of Node targeting and resolution to Node 16 instead of Node 12. There is a caveat which Wesley Wigham (@weswigham) pointed out, which is that top-level Fixes #48646
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, this check is wrong and the tests reflect that. Should it be
Suggested change
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Normally we still emit warnings of some kind when using experimental features, which would still be in all stable versions of node, at least until nodejs/node#42875 ships in the next version of node 18.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Newest updates give a better error message when you have TLA in a CJS module. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ger experimental.
|
Most recent changes remove the error message for importing a JSON module under Node16 and NodeNext. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
A decent amount of stuff seems to already use/support Node 12. Should we keep it undocumented and provide an error when using it, but continue supporting it otherwise? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I mean, as I said back in the issue, I'm all for having newer stable versions to match the node versions people wanna target, alongside the existing versions we support, in the same way we build out a new esXXXX target every year (potentially if only to match up that node version to the correct esXXXX target automatically). If we only do even-numbered (and thus LTS) node versions, we should only need to add one every year or so as well. Sounds like we have fairly good reasons to have both node16 and node18, in addition to 12, since 16 has all those fun es2022 features and 18 has stablized tla and JSON imports, while 12 already has some use. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Spoke with Anders Hejlsberg (@ahejlsberg) and Andrew Branch (@andrewbranch) on this. We could just say Node18 as the initial minimum target which would simplify a bit for us; however, like you've mentioned, Node 18 can get more and it's not yet the active LTS. So let's start with Node 16 and if we see anything that diverges, we can add a Node18 target down the line. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Consensus was on not providing a workaround for nightly-only users. Either you have nightly TS in a lockfile or you've signed yourself up to staying up-to-date. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Just remember that any perceived simplicity from initially supporting fewer explicit node versions is very likely a short-lived pipe dream at best - we will have to add more, the same way we add esXXXX targets every year. The kind of big-bang module system update that happened with the esm transition is not how node usually does development, usually you get more minor changes each release, as we can already see between 12, 14, 16, and 18. (And the only reason we didn't see a need to update the commonjs resolver for so long is because all those minor resolver changes were being banked up for the node 12 esm drop - even the cjs ones.) If the issue is the perceived complexity or messaging of many targets, that can is only being kicked, not fundamentally solved. IMO, a longer term more complete solution would be following in the footsteps of... pretty much every js transforming tool in the js community (eg, babel via preset-env, rollup's target argument), and taking arbitrary engine versions/ranges and mapping them automatically to our internal feature flags (eg, es target, module (resolution), and emit features). That would be more predictable into the future, imo. Messaging is probably simpler: 'specify all desired target runtimes, eg |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
See microsoft/TypeScript#48879 for background
| @@ -134,296 +134,33 @@ Output:: | |||
|
|
|||
| [[90m12:00:26 AM[0m] Building project '/src/src-types/tsconfig.json'... | |||
|
|
|||
| [[90m12:00:33 AM[0m] Project 'src/src-dogs/tsconfig.json' is out of date because output file 'src/src-dogs/dog.js' does not exist | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Can you fix the tests to modify lib file so there are no errors are we are really testing the scenario.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Created #48974
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -16,7 +16,7 @@ export type TheNum = 42; | |||
| export type { TheNum } from './const.cjs'; | |||
|
|
|||
| //// [/user/username/projects/myproject/packages/pkg2/tsconfig.json] | |||
| {"compilerOptions":{"composite":true,"outDir":"build","module":"node12"}} | |||
| {"compilerOptions":{"composite":true,"outDir":"build","module":"node16"}} | |||
|
|
|||
| //// [/user/username/projects/myproject/packages/pkg2/package.json] | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Same for this
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Switch fromnode12 to node16 to avoid top-level await issues
There was an error while loading. Please reload this page.