Skip to content

doc: esm resolver spec refactoring for deprecations

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 https://github.com/nodejs/node/pull/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: https://github.com/nodejs/node/pull/37206 Refs: https://github.com/nodejs/node/pull/40117

Merge request reports

Loading