Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update build requirements in CONTRIBUTING.md (#12766)
- Loading branch information
1 parent
bf523da
commit 87f264c
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87f264c
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.
@JLHwung I failed to bootstrap on Node 12.16.3 and 14.11.0...mjs changes have broken things.
Bootstrapping succeeded with 12.22.1 and 14.17.3. I don't know exactly what the correct fix would be
On 12.16.3:
On 14.11.0:
87f264c
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.
I guess we could always update this note at the very least to those versions? Maybe make a pr for it
87f264c
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.
@hzoo okay I found this comment: nodejs/node#32137 (comment)
I'll test on those versions...
87f264c
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.
Good catch. On CI we build Babel on latest node version (now v16). Chances are it might break in older versions and we forget to update build requirements. Maybe we should just specify building requires latest node current?
87f264c
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.
Maybe just pick versions and add CI tasks to make sure bootstrapping works on those versions of node? That way the version isn't constantly up in the air and we get early warning if something breaks dev compatibility
It would be good to make the bootstrap script check the node version and error out if it's less than the targeted compatible versions, to reduce confusion for first-time contributors. (With a flag to bypass that if we want to debug whether it works on lower versions). I could PR that if you're interested
87f264c
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.
We use latest node on CI for performance and freedom to refactor build scripts. Babel used to build in every supported node versions, but later we extracted the build step to improve CI running time. The build scripts will be constantly run by contributors. As long as we are happy to try out latest node versions, I don't think we need an extra CI step.
That sounds great! We used to specify the minimal building node versions by
engines.node
of the rootpackage.json
, which is supported in Yarn 1. However, Yarn 2 does not support the engine check. If we are going to bring it back, the node version can be put there.@merceyz I am not sure if
engines.node
check is in the scope of yarn constraints, WDYT?87f264c
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.
@JLHwung
Bootstrapping takes a minute or so, why not just add that to the Node 12 and 14 test tasks? Investigating this has cost me at least 30 minutes.
Is 30 minutes confusion for many new contributors worth a change as mundane as converting a bunch of requires to imports?
It seems reckless to me if anyone can use new node features without warning in build scripts, without anyone being aware of the history of those new features, as happened in this case. I think it saves time and disruption to only refactor once in awhile.
Also checking if the user has the latest version of node installed before each build script would fail if a dev is away from internet. To avoid that you have to pick a fixed version of node.
87f264c
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.
Maybe I misunderstand though, maybe by "latest node" you just mean >=16? I was thinking you mean literally the absolute latest version of node on any given day
87f264c
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.
Constraints is more for enforcing the project itself not the environment it runs under 馃