module: empty fallback and null exports as not exported #32838
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR includes two changes to exports edge cases:
"./subpath": []
) to throw ERR_PACKAGE_PATH_NOT_EXPORTED.null
targets ("./subpath": null
) as also throwing ERR_PACKAGE_PATH_NOT_EXPORTED.This comes out of the discussion in jkrems/proposal-pkg-exports#46 where the feature is blacklisting subdirectories via eg:
Both of the above cases would then result in conditional object checks falling through (whereas the current ERR_INVALID_PACKAGE_TARGET for both does not).
There is likely still some discussion to be had here:
[[]]
will throw the same error regardless. So it likely is about what is best for usability and what will more likely match import maps.null
in import maps was originally proposed to match the semantics of[]
, so should likely follow the above.Questions:
null
?[]
follow this same error?I tend to think yes, but let's discuss in the meeting further.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes