jkrems / proposal-pkg-exports

Proposal for Bare Module Specifier Resolution in node.js
MIT License
130 stars 14 forks source link

Imports proposal - first draft #40

Closed guybedford closed 5 years ago

guybedford commented 5 years ago

This provides details on the corresponding package "imports" proposal as the second field as part of this proposal, extending the similar types of mappings we have for "exports" into cases that can work for internal aliasing as well.

Notes have been provided where details are still to be determined, in particular whether or what custom symbol will be used for disambiguation in mappings.

Help fleshing out more edge cases in the examples here would be great.

guybedford commented 5 years ago

//cc @robpalme @devongovett

bmeck commented 5 years ago

I'm curious how this interacts with https://github.com/nodejs/node/blob/master/doc/api/policy.md#dependency-redirection which are controlling at the app level and not package level.

jkrems commented 5 years ago

My gut feeling would be "policy applies to the raw specifier, preventing any resolution including imports". But it may be worth clarifying it in the proposal.

guybedford commented 5 years ago

Seems like we may be good to merge here then?

Further feedback welcome.

jkrems commented 5 years ago

(Resolved conflicts using UI after merging the validations PR. I think I picked the right lines.)

guybedford commented 5 years ago

Looks good, shall we merge and move the symbol discussions to their own threads then?

guybedford commented 5 years ago

(I can also get behind changing to ~ if people want now too)

jkrems commented 5 years ago

Let's merge and discuss the sigil question separately (#41).