-
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
In the fallback case, what constitutes failure? #84
Comments
Related: {
"imports": {
"whatever/": [
"https://server1/whatever/",
"https://server2/whatever/"
]
}
} import 'whatever/foo';
import 'whatever/bar'; If |
The intention is network error or non-OK status. Maybe MIME type checking if we can figure out a nice way to do that without a layering violation. This is currently a TODO in the spec, for sure. Great question about fallbacks with "packages". I hadn't really thought that through entirely, but I think ideally we'd cache the In general HTTPS -> HTTPS fallbacks are still kind of up in the air, with #76 being one of the bigger blockers. |
If MIME type checking is included, that might be nice for incrementally adding more module types over time, where a fallback can be a JavaScript wrapper. |
@littledan that's nice, though it requires a round-trip to get the mime-type. It's a great use case for feature detection though. |
Yeah, good point; that's probably not a pattern we should encourage. |
To be honest, I would be against network fallbacks exactly because of the latency issue @justinfagnani mentions. Consider also that a large import map wanting to have two servers providing sources, would need two entries for every single module loaded, and would add a round trip of latency for every single one of those modules. The user experience just doesn't seem to quite be there? On the other hand, sticking to fallbacks only applying to protocols allows the |
Can we also clarify that SRI and CSP failures, being checked during fetch, would count as failures for the purposes of fallback? |
Those are network errors, so yes. |
I'd like to second the concern raised by @guybedford. Allowing network failures sounds dangerous because it suggests that it's a good "smart client" to handle unreliable backends. Which I'm not sure is helpful / sets people up for success. |
Map:
Usage:
In what ways could
https://server1/img.jpg
fail? Possibilities:The text was updated successfully, but these errors were encountered: