Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upmodules: runtime deprecate subpath folder mappings #35747
Conversation
|
Review requested: |
2d4f98e
to
6e21041
6e21041
to
f258111
Codecov Report
@@ Coverage Diff @@
## master #35747 +/- ##
==========================================
- Coverage 96.41% 87.91% -8.50%
==========================================
Files 223 477 +254
Lines 73685 113133 +39448
Branches 0 24642 +24642
==========================================
+ Hits 71043 99462 +28419
- Misses 2642 7963 +5321
- Partials 0 5708 +5708
|
|
lgtm |
|
@addaleax This is a runtime deprecation on two experimental features (subpath exports and subpath imports), so maybe it's not semver-major? |
|
@Trott Yeah, no strong opinion, it felt like it’s better to err on the safe side here to me, that’s all :) |
Co-authored-by: Jordan Harband <ljharb@gmail.com>
|
Thinking some more about the backporting I wonder if it might actually be useful to backport this to 14. The warnings will only show for local package usage since we have good filtering to not show for third-party packages without I would still suggest holding out until 16/17 for any throw-by-default behaviour though, but it could be beneficial to backport the warning actually. I'm updating the PR description, but if anyone has any concerns let me know. For all the modules experimental status process and changes, this is probably one of the only few removals we've done actually! |
|
@addaleax given the above, would you be ok with removing the semver major label here? |
|
@guybedford As I said, no strong opinion :) Just the fact that runtime deprecations are semver-major by default, but if everybody else is good with it then I am too |
Ah I was not aware of that. Ok I'm completely fine with leaving the backport then. |
|
I think doing this as non-semver major but not backporting is a nice "split the difference" |
|
So what about the |
|
I don’t believe those are equivalent because |
|
Certainly there is that tailing For the use cases in the readme covered by |
|
(To be clear tho, removing the slash feature makes it impossible to make adding "exports" a non-breaking change - unless you could add |
|
That's true, although we already advise that exports typically is a breaking change. The With this trailing separator deprecation, in theory it could allow a future implementation space to support these as individual maps in their own right. |
|
|
||
| _This feature will be removed in a future release._ | ||
|
|
||
| Instead, use direct [subpath patterns][]: |
GeoffreyBooth
Oct 22, 2020
Member
I initially read this section and thought “why are we adding a section to the docs for something we’re deprecating?” and only later realized you’re introducing the deprecated thing to then introduce what people should use instead. I worry that people might not get to the important part, which is at the end. Can we instead just introduce subpath patterns and this use case, as if the trailing slash version never existed?
guybedford
Oct 22, 2020
Author
Contributor
Yes I've added the feature to the docs to deprecate it :)
I could just remove the first example, would that help?
Otherwise I could leave out the section here and just have the deprecation but my concern then was users might miss that it is even deprecated if they aren't using the feature.
GeoffreyBooth
Oct 22, 2020
Member
At the very least I’d put the deprecated version last. But I think it would be better to just not include the deprecated info at all. Simply explain subpath patterns for the use case of exposing * within a folder, and why a user might want to do that, as if the deprecated feature had never existed.
ljharb
Oct 22, 2020
Member
It would be nice if we could document / subpaths in the docs for older node versions tho, at least as a reference, even if we didn't include that info in docs for node versions in which it was deprecated. Is that possible?


This creates an explicit runtime deprecation warning when using the folder mappings in
"exports"or"imports".The implicit documentation deprecation was already made when the exports patterns PR was landed in #34718 and fully replaced all documentation references to this.
The warning is carefully scoped to not apply to external packages in node_modules, unless explicitly using the
--pending-deprecationflag.Tests are included for local and external, require and import, imports and exports and self-resolution cases.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes