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

align with esm spec on resolving an array of targets #420

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

vankop
Copy link
Member

@vankop vankop commented May 8, 2024

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Based on spec we should not only filter, we need failed on the first fail and stop doing eveyrthing

@alexander-akait
Copy link
Member

Node.js's implementation picks the first valid path (without attempting to resolve it) and throws an error if it can't be resolved. Node.js's fallback array is designed for forward compatibility with features (e.g. protocols) that can be syntactically validated:

try this repo using Node.js https://github.com/Boshen/test-esm-exports-array

@alexander-akait
Copy link
Member

Also we need to seach what is bad-specifier, maybe we can use regexp for perf instead full parsing

@vankop
Copy link
Member Author

vankop commented May 8, 2024

@alexander-akait I have added same test case in this commit 0d428c9

we are slicing paths until first absolute or relative path

Also we need to seach what is bad-specifier, maybe we can use regexp for perf instead full parsing

we dont parse full string only first 2 chars, see getType in util/path ( this function is already exist, I just reuse it )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ESM: package.exports array target not conforming to the ESM specification
3 participants