-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Revisiting "Custom URL Schemes or Configurable Resolvers for Imports" #16555
Comments
I think it's worth reconsidering Service Workers for this use case since they're a part of the standard Web Platform API. Service Worker API support was previously discussed in #5957, but I believe the rationale for discounting them may be misconceived:
Here's an example of using @swc/wasm-web to transform TypeScript to JavaScript at load time in the browser: https://codesandbox.io/s/service-worker-transpilation-ckifig. This works on first startup by awaiting the controllerchange event. Subsequently the dynamic For deno I imagine it might make sense to offer an option to preload a service worker before the main script is loaded as a convenience, but it would be equivalent to a wrapper script managing the service worker and dynamically importing the main script. Conceptually this would be like visiting a page in the browser where the service worker already running. My motivation here is that I would like to write loader transforms without a separate bundler. This seems doable in the browser but it would be very convenient to be able to use them from deno too. |
Another reason for this would be for accessing modules (dynamically) from an authenticated host without sharing credentials with the modules (keep them out off the path and out of imports.meta.url). Installing a service worker at start time for the main thread I'm now falling back from clean remote imports to an ugly setup to work around this. Service worker support would allow this, as previously discussed in closed issue #5957. |
In May of 2019, @rsp opened #2348, in which he describes the feature request of custom URL schemes / resolution.
@ry's response at the time:
Given the recent addition of
npm:
-prefixed imports and the stability of the project as a whole, perhaps it's time to revisit this feature request?If not, please let me know and I'll close out this issue.
The text was updated successfully, but these errors were encountered: