The goal is to make ember-fetch a v2 addon, removing all the old fetch polyfill stuff while maintaining backwards compatibility. This MR is the first step in this process.
This MR basically:
removes all the broccoli magic stuff
uses native fetch
exposes a setupFetchWaiter function which provides backwards compatibility in tests
continues to export a fetch from ember-fetch for backwards compatibility (its just the native fetch)
Breaking
The only change that has to be made, if somebody wants to upgrade to v9 is that they have to import a setupFetchWaiter function which wraps the native fetch with an waitForPromise. This means that fetch will continue to work in tests as it has done in the past. Using the setupFetchWaiter would look something like this:
import { setupFetchWaiter } from 'ember-fetch';
setupFetchWaiter();
In development and production builds this does nothing.
Next steps
In the next steps various other addons will have to be pulled into test apps to make sure that they continue to work with this version of fetch.
Description
The goal is to make
ember-fetch
a v2 addon, removing all the old fetch polyfill stuff while maintaining backwards compatibility. This MR is the first step in this process.This MR basically:
setupFetchWaiter
function which provides backwards compatibility in testsfetch
fromember-fetch
for backwards compatibility (its just the native fetch)Breaking
The only change that has to be made, if somebody wants to upgrade to
v9
is that they have to import asetupFetchWaiter
function which wraps the native fetch with anwaitForPromise
. This means that fetch will continue to work in tests as it has done in the past. Using thesetupFetchWaiter
would look something like this:In development and production builds this does nothing.
Next steps
In the next steps various other addons will have to be pulled into test apps to make sure that they continue to work with this version of fetch.