[Package Importer] Add types and specs#3728
Conversation
* main: [Package Importer] Draft 1.5 (sass#3777)
…to feature.package-importer
nex3
left a comment
There was a problem hiding this comment.
Since baseURL is now a directory rather than a file path, and the Node.js algorithms expect a file path, we should explicitly add a basename before passing it into those algorithms.
@nex3 Based on my reading of the algorithm, the It's also unclear to me what we would use as a basename when the user only provides a directory. |
|
I think what @nex3 means is that we can should pass |
@nex3 Does this match your expectations- adding * Let `pkgImporter` be a [Node Package Importer] with an associated
`entryPointURL` of the absolute file URL for `entryPointDirectory`
appended with a [single-dot URL path segment](https://url.spec.whatwg.org/#single-dot-path-segment).My reading of this is that this is only a change to the spec, and we don't need to update the implementation as well, correct? |
|
The
None of these operations actually looks at the basename. Even for resolving the relative path, All that said, I think the best place to compensate for a weird API like this is immediately before invoking it. Store the information "at rest" in a way that makes the most sense semantically—as the directory that we first check for
That's right. The implementation now avoids the issue entirely by always operating in terms of directories in the first place. |
Co-authored-by: Jonny Gerig Meyer <jonny@oddbird.net>
Continuation of #3660
Issue
Blocked until proposal is accepted.