Skip to content
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

feat: support node: prefix for Node.js core modules in runtime code #18316

Merged
merged 4 commits into from
Apr 12, 2024

Conversation

alexander-akait
Copy link
Member

@alexander-akait alexander-akait commented Apr 11, 2024

What kind of change does this PR introduce?

fixes #18277

Did you add tests for your changes?

Yes

Does this PR introduce a breaking change?

No, because we generate it only when your env supported it

What needs to be documented once your changes are merged?

Yes

Shorty:

We generate node: prefix for import ... from "module" only when your env supported it and it is only abour webpack runtime code. We need document that you can disable it using the output.environment.nodePrefixForCoreModules option

@webpack-bot
Copy link
Contributor

webpack-bot commented Apr 11, 2024

For maintainers only:

  • This needs to be documented (issue in webpack/webpack.js.org will be filed when merged)
  • This needs to be backported to webpack 4 (issue will be created when merged)

@alexander-akait
Copy link
Member Author

@vankop I want to drop azure CI, it is slow and often failed, what do you think?

@vankop
Copy link
Member

vankop commented Apr 12, 2024

you are right, but ci speed in general slow.. maybe keep it for stability, we can force merge anyway.

/^(async-)?node(\d+(?:\.(\d+))?)?$/,
(asyncFlag, major, minor) => {
/^(async-)?node((\d+)(?:\.(\d+))?)?$/,
(asyncFlag, _, major, minor) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bugfix, before when you have 14.18 - major was 14.18 and minor was 18, so if you have node14.8 in your target, you always have true, same here for other places

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how this work before 🙈

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like nobody used it before 😄

@alexander-akait alexander-akait merged commit e97af9b into main Apr 12, 2024
30 of 47 checks passed
@alexander-akait alexander-akait deleted the issue-18277 branch April 12, 2024 13:31
@webpack-bot
Copy link
Contributor

I've created an issue to document this in webpack/webpack.js.org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement ability to use "node:" prefixes for Node.js core modules
3 participants