-
-
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
Convert to v2, addon. Just wrap fetch
.
#754
base: main
Are you sure you want to change the base?
Conversation
function isPlainObject(obj) { | ||
return Object.prototype.toString.call(obj) === '[object Object]'; | ||
} | ||
|
||
/** | ||
* Helper function that turns the data/body of a request into a query param string. | ||
* This is directly copied from jQuery.param. |
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.
There's also https://github.com/knowledgecode/jquery-param, so wondering if we should still include this in ember-fetch?
Todo (RFC):
Todo (This PR):
|
This is great! I'm getting this TS error trying out this branch:
|
}); | ||
} | ||
|
||
export default wrappedFetch; |
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.
I mean why not just add the default to line 3 😂
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.
My brain doesn't like it haha
This PR is (what I think is) the goal.
We can decide if we want to move towards this goal incrementally or deciding that this is what we want and skip all the in-between.
To move incrementally, we'd need to resolve the following PRs:
Ember < 3.28
, upgrades toEmber 4.12
, supportsEmber 5
#741Which... we can do -- I'm not sure it's worth keeping CI green through all that though.
ember-fetch
is in a bit of disrepair.Support:
@ember/test-waiters
v3+I'm not sure what the fastboot support story would be, but Node natively has
fetch
,AbortController
, etc.Dropped Support:
AbortController
exists onglobalThis
Headers
exists onglobalThis
Response
exists onglobalThis
Since
ember-auto-import
tests against 3.4.0, and ember-auto-import is the only real requirement for this change, there is no change in supported ember-source.If anything, the constraining function is
@ember/test-waiters
Changes:
After this PR: