-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Rename import path to ember-fetch
#330
Comments
We could start by providing both modules, and deprecate the |
Yeah, I like that as a path forward. |
Given that global Implementation-wise, the two are equally interceptable. |
Seems perfectly reasonable to me. We’d just want a nice configurable switch for that if it’s ending up in the vendor bundle, or (better?) to deliver it separately. |
I think thats fine in general, it would also allow easier "use native" (since we would literally do nothing if your targets all have We'd have to confirm that its "fine" in SSR environments too (since there is not a |
@ef4 Im perfectly good with this, I prefer that approach. Questions:
|
Forcing the use of This isn't just an issue for IE11, where It's also an issue for libraries that expect the native import { Response } `fetch`;
console.log(Response) // Response() { [polyfilled code] }
console.log(window.Response) // Response() { [native code] }
console.log(Response instanceof window.Response) // false Another example is Rollbar, which tracks events for Telemetry, in part by wrapping the global |
Following up on this (as I'm poking at some related things):
|
IMO in a post (IE11 / Safari12) world, we should just move the fastboot support part into fastboot its own (maybe think about how we expose the isomorphic fetch API a bit more), and not rely on polyfill in the browser at all. |
It's a best practice in general, for imports to come from their package name rather than some more "convenient" name, and will become more so as Embroider lands:
The import style here should simply be:
This is not a blocker for use with Embroider, as there are solutions to support the existing flow, but is a nice improvement and will eliminate one thing that has to be done for this to use Embroider. It also has the nice upside of eliminating all shenanigans required to have this do the right thing for TypeScript integration!
This would be a breaking change, but should also be trivially codemod-able.
The text was updated successfully, but these errors were encountered: