-
-
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
Move to new ember-fetch import path #732
base: main
Are you sure you want to change the base?
Conversation
This will ensure there is no confusion around folks thinking they are importing from the actual `fetch` package. For backwards compatibility, we need to still support consumers importing from the `fetch` path. In the future, we should release a breaking change which removes this alias and requires consumers to import from `ember-fetch`.
The goal here is good. But the implementation can get a lot simpler, because most of what it was doing before was only needed in order to escape its own module namespace. For example, emitting the implementation in |
@@ -0,0 +1,13 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker for this PR, but we should also think about how to deprecate this.
Ah, perfect – I was going to ask about exactly that, @ef4. Net, @asakusuma we can leave the existing nonsense in place for now, but have the new implementation just… be a normal implementation. |
@ef4 @chriskrycho thanks. naive question, but wouldn't adding an implementation in the |
Co-authored-by: Chris Krycho <[email protected]>
From what I can tell, there are some additional things going on in https://github.com/ember-cli/ember-fetch/blob/master/index.js#L172-L175 In other words, I don't doubt there's a way to move some of the code into the addon folder, but I'm not seeing an approach that does that without increasing the overall complexity. |
All that resolving NPM packages and rolling them up is stuff that ember-auto-import natively does for you. This add only needs to emit import statements within |
This will ensure there is no confusion around folks thinking they are importing from the actual
fetch
package.import fetch from 'fetch'
>import fetch from 'ember-fetch'
For backwards compatibility, we need to still support consumers importing from the
fetch
path. In the future, we should release a breaking change which removes this alias and requires consumers to import fromember-fetch
.