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

doc: esm resolver spec refactoring for deprecations #40314

Closed

Conversation

guybedford
Copy link
Contributor

@guybedford guybedford commented Oct 4, 2021

This PR integrates the current ES module resolver deprecations into the specification assuming those deprecations have all been runtime deprecated.

Specifically:

  1. Removes the reference to the CJS module resolver when there is no "exports" field. This assumes the runtime deprecation of the index lookups deprecation, such that the main can just be resolved directly as a subpath without any statting when the exports fields is not declared by a package.
  2. Since we now have trailing slash deprecations in patterns module: runtime deprecate trailing slash patterns #40117 as well as former folder deprecations for trailing slashes as well, when combined with (1) above the result is that trailing slashes never ever resolve for packages. As such when all of the above become runtime deprecations, it is possible to instead throw early as a resolution failure for package resolutions with a trailing slash. The refactoring is made now in the spec to indicate this, even though these runtime deprecations haven't happened yet. The goal being to ensure that the current spec reflects the current state with all deprecations enabled.

In the process I also spotted two simple spec editorial changes included here as well.

@nodejs/modules

Refs: #37206
Refs: #40117

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. esm Issues and PRs related to the ECMAScript Modules implementation. labels Oct 4, 2021
@guybedford guybedford changed the title docs: esm resolver spec refactoring for deprecations doc: esm resolver spec refactoring for deprecations Oct 4, 2021
@guybedford guybedford force-pushed the full-trailing-slash-deprecation branch from 3bb3298 to 0a40695 Compare October 4, 2021 16:18
@guybedford guybedford requested a review from aduh95 October 5, 2021 16:00
@aduh95
Copy link
Contributor

aduh95 commented Oct 5, 2021

Could you add the refs to the PR that added the runtime deprecations please? That would help reviewing this. Also we should probably add dont-land labels as I think those deprecations haven't land on LTS release lines.

@guybedford
Copy link
Contributor Author

@aduh95 the one reference is in the description, the other reference is the PR you did for the index deprecations I believe, is that the one you are after?

Copy link
Contributor

@aduh95 aduh95 left a comment

Choose a reason for hiding this comment

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

Thanks for reminding me, I've added Refs: to the OP so it's added to the commit message on landing.

@guybedford
Copy link
Contributor Author

Landed in ccee352.

@guybedford guybedford closed this Oct 8, 2021
guybedford added a commit that referenced this pull request Oct 8, 2021
PR-URL: #40314
Refs: #37206
Refs: #40117
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. esm Issues and PRs related to the ECMAScript Modules implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants