-
Notifications
You must be signed in to change notification settings - Fork 72
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
Some feedback #17
Comments
Thanks! I'm unsure why would you define a package named "index.js" and import as "index.js", why not just do: import * from './src/index.js'; Which skips the package name map altogether. Can you further describe why you wanted to define a file as a package? |
|
It’d be for the same reasons people put symlinks in their node_modules or use a babel transform or webpack alias for the package root; but since the package map would only apply to bare imports - ie, only things that aren’t prefixed with a dot or protocol or slash, iirc - i don’t think there’d be any collision (as said here) |
@justinfagnani This is actually going to be Once #6 is complete hopefully that will clarify what happens in the case that a bare specifier doesn't match anything in the packagemap. My hope is that will error like it does today. |
Oh definitely, that will throw. |
@matthewp ... yes, that's it exactly. The example was a bit off because I threw it together quickly but I'm glad the point came across. |
The proposal has changed a lot, so let me close this. In the newest iteration, it's intentionally in-scope to allow remapping of URLs like |
First off great to see explorations on this... some feedback.
Consider the following case...
In an application that also has an
index.js
at it's root. What doesimport * from 'index.js'
load? That is, how does this deal with naming collisions?There's a danger here in recreating the hell that is Java classpaths.
Another approach to this could be to take a more generic http/http2 centric approach and allow an origin to declare client-side aliases for various resources. These would amount to a client side 302 or 303 response.
For instance:
The text was updated successfully, but these errors were encountered: