-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
module: subpath folder mappings EOL #40121
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
Conversation
@nodejs/modules if we want to land this for v17, the cutoff is Tuesday. Alternatively this can wait until v18. |
I think it should wait. I’m very concerned about packages like mine that need to support every node minor, not just the latest ones, that currently have to either use directory mappings or would have to list thousands of export paths. This removal would force the latter if i wanted to be compatible with both this version and one of those node minors. |
@ljharb given that the warning is visible to all users, do you publish a package that just has a visible warning for those imports? Or are you shipping subpaths along with patterns so that the warning doesn't apply? Note that the EOL does not throw here so backwards compat will still work - the EOL just entirely removes the logic from applying. |
@guybedford currently I removed "exports" entirely because of the current state of things. To re-add it, I'd want to be sure that the latest major of every node had no warnings, and the latest minor of every node worked, even if with warnings. If this is possible, then I have no concerns, but based on the disruption with es-abstract that I referenced, I'm not confident it will be possible. |
@guybedford for one, many of these "past decisions" were made without fully understanding the consequences, including subpath pattern trailers, so it's wise to revisit them in light of the new information. Yes, I'd prefer to have avoided runtime deprecation warnings to consumers that are not actionable to them; i think that's incredibly harmful to the ecosystem. However, at least things still work, which is the much more important concern. This PR would make them no longer work at all. |
Co-authored-by: Voltrex <mohammadkeyvanzade94@gmail.com>
a791013
to
91e7b5c
Compare
It would be great to have more feedback on this one if possible @nodejs/modules. |
@ljharb while this deprecation has been reflected over a large number of discussions and PRs over the past year, I can appreciate that with so many decisions, discussions and PRs to track it is difficult to fully follow implications until they happen sometimes and this may be one of those cases. Regardless, the runtime deprecation has been in place for a year now, and the third-party runtime deprecation for 6 months, both of which have laid the way for this PR. I can appreciate wanting to bring new points to the argument, but it is difficult when your aim of supporting every patch version of Node.js simply makes it not possible to support certain variations of features that can be supported by restricting to semver solutions, and holding all arguments to that point does make progression on these discussions difficult, so I'm not sure what further to say here. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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 do think given the alternative being viable using *
and occasional direct path listing this seems a great change. It reduces the overall complexity of the system and makes it match across both imports
and exports
.
Return type of PACKAGE_EXPORTS_RESOLVE was changed when subpath folder mappings reached EOL. But RESOLVE_ESM_MATCH was not updated. Refs: #40121 PR-URL: #45280 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Return type of PACKAGE_EXPORTS_RESOLVE was changed when subpath folder mappings reached EOL. But RESOLVE_ESM_MATCH was not updated. Refs: #40121 PR-URL: #45280 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Return type of PACKAGE_EXPORTS_RESOLVE was changed when subpath folder mappings reached EOL. But RESOLVE_ESM_MATCH was not updated. Refs: nodejs#40121 PR-URL: nodejs#45280 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Return type of PACKAGE_EXPORTS_RESOLVE was changed when subpath folder mappings reached EOL. But RESOLVE_ESM_MATCH was not updated. Refs: #40121 PR-URL: #45280 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Return type of PACKAGE_EXPORTS_RESOLVE was changed when subpath folder mappings reached EOL. But RESOLVE_ESM_MATCH was not updated. Refs: #40121 PR-URL: #45280 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Return type of PACKAGE_EXPORTS_RESOLVE was changed when subpath folder mappings reached EOL. But RESOLVE_ESM_MATCH was not updated. Refs: #40121 PR-URL: #45280 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Return type of PACKAGE_EXPORTS_RESOLVE was changed when subpath folder mappings reached EOL. But RESOLVE_ESM_MATCH was not updated. Refs: #40121 PR-URL: #45280 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Return type of PACKAGE_EXPORTS_RESOLVE was changed when subpath folder mappings reached EOL. But RESOLVE_ESM_MATCH was not updated. Refs: #40121 PR-URL: #45280 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#53215 Fixes: nodejs#53206 Refs: nodejs#40121 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com>
PR-URL: nodejs#53215 Fixes: nodejs#53206 Refs: nodejs#40121 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com>
PR-URL: nodejs#57785 Refs: nodejs#40121 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This removes support for subpath folder mappings, turning the runtime deprecation into an end of life feature.
For packages that previously relied on
"exports": { "./subpath/": "./subpath/" }
working, these packages will now effectively either get the next best exports match or an export not defined error.Patterns supporting trailing
/
matches are still supported with these cases continuing to be deprecated as per that deprecation path. This PR is distinct from #40117.Because package imports did not ship with trailing
/
pattern matches, that same deprecation path turns out not to be necessary for imports as that deprecation only affected one release so far.The benefit of this deprecation is spec and implementation simplification.