| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
//cc @nodejs/modules-active-members |
Sorry, something went wrong.
|
I'd like to suggest fast-tracking this if there are no objections. |
Sorry, something went wrong.
|
(Adding my 👍 to the comment above assuming it's a fast-track vote comment.) |
Sorry, something went wrong.
There was a problem hiding this comment.
Would like a few more approvals before we land.
Lgtm
Sorry, something went wrong.
|
/cc @nodejs/modules-active-members |
Sorry, something went wrong.
|
CI: https://ci.nodejs.org/job/node-test-pull-request/26634/ edit: rerun windows https://ci.nodejs.org/job/node-test-commit-windows-fanned/31266/ |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
PR-URL: #30501 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
PR-URL: #30501 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
PR-URL: #30501 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
PR-URL: #30501 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
| Back | FazBrowse Home | New Git URL |
Up until now the ES module resolver still supports loading .json and .node files outside of ES module scopes (with "type": "module"), mainly for backwards compatibility with the CJS resolver.
This PR locks down that behaviour to ensure we are shipping the stricter semantics that don't permit users to just import JSON modules directly. The goal here is that if something like the module types proposal takes off, then we haven't already locked in ecosystem semantics that assume JSON imports.
The reason this is important is because right now the unflagged implementation will allow an .mjs file to import JSON, which once people start using will tend to make this a difficult thing to remove.
If we get compatibility bugs, we can certainly relax this stance though, but our general approach to the implementation up until now has been to try to be conservative with the semantics to avoid wrong paths, which has so far served us well.
For the main entry into Node.js we have an explicit isMain check which will always support non-extensions for bin use cases and these types of files.
The change is actually just the simple change at https://github.com/nodejs/node/pull/30501/files#diff-8e67f407bc32a0569e25d7ecaff6e494L1308, the rest is mostly just taking a chance to refactor the resolver logic a bit while retaining the same semantics.
Checklist