Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork476
Create a new Specifier type for JavaScript module specifiers#3818
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
codecovbot commentedApr 17, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #3818 +/- ##==========================================+ Coverage 47.24% 50.41% +3.16%========================================== Files 476 460 -16 Lines 46892 45179 -1713 ==========================================+ Hits 22154 22776 +622+ Misses 24738 22403 -2335 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Uh oh!
There was an error while loading.Please reload this page.
jedel1043 commentedApr 17, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I'm trying to think about the implications of always having absolute paths for modules and scripts. Right now, I can think of:
Committing to absolute paths would be very bad for both use cases. Maybe we can just change specifiers to store a |
hansl commentedApr 17, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Absolute to the root of the (very much virtual) namespace, not their filesystems.
This would be done using the Basically what I'm saying is:
This is a very powerful statement, and would allow optimizations that are host independent, such as having a module cache outside of module loader, for example. And to avoid further confusion, what I mean by "absolute |
jedel1043 commentedApr 17, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
What would be the overall changes to |
hansl commentedApr 17, 2024
|
hansl commentedApr 17, 2024
Could be in |
jedel1043 commentedApr 17, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This discussion is getting a bit too long for a PR, and I wanted to ask some more questions about the API. I'll open a thread in Matrix. |
This PR does not change any of the current API. I wanted to see if people preferred doing it as part of this PR (thus larger in scope), or doing a review of this new type, then as a follow up update the related APIs.
My thoughts after playing with modules;
import './path'resolving to/some/path.js(see below), should show up in traces as/some/path.js. This would be part of the follow up PR.RevoledSpecifieror something which is guaranteed at creation to be absolute and resolved. It canDeref<Specifier>orDeref<OwnedSpecifier>. That way the type system will make sure you cannot create a module with a relative path (relative to what?!?). When creating a module, you need to pass a referrer or a resolved specifier.Some extra curricular suggestions:
NodeModuleResolverthat doesn't have to also be a loader would be good.ModuleLoader::get_module, and that this method be implemented correctly.