Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions text/1065-remove-ember-fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ This RFC proposes removing `ember-fetch` from the blueprint for new projects, an

## Motivation

the package, `ember-fetch`, does a fair bit of deceptive and incorrect behavior that is incompatible with modern JavaScript tooling, such as _being_ `ember-fetch`, yet only importing from `fetch`.
The package, `ember-fetch`, does a fair bit of deceptive and incorrect behavior that is incompatible with modern JavaScript tooling, such as _being_ `ember-fetch`, yet only importing from `fetch`.

## Transition Path

- Remove ember-fetch from all blueprints
- Deprecate the npm package and archieve the github repo.
- Deprecate the npm package and archive the github repo.
- Migrate to an alternative for "managed fetch"

### What does `ember-fetch` do?

_primarily_, it wraps the native `fetch` in `waitForPromise` from `@ember/test-waiters` (aka "settled state integration").
_Primarily_, it wraps the native `fetch` in `waitForPromise` from `@ember/test-waiters` (aka "settled state integration").


secondarily, but not popularly used, are a series of utilities (e.g.: for checking kinds of errors). These could be copied into projects that use them and modified to fit each project's needs.
Secondarily, but not popularly used, are a series of utilities (e.g.: for checking kinds of errors). These could be copied into projects that use them and modified to fit each project's needs.

### Using native `fetch`

Expand Down Expand Up @@ -98,7 +98,7 @@ export function wrappedFetch(...args: Parameters<typeof fetch>) {
```


And then throughout your project, you could find and replace all imports of `import fetch from 'ember';` with `import { wrappedFetch } from 'app-name/utils/wrapped-fetch';`
And then throughout your project, you could find and replace all imports of `import fetch from 'fetch';` with `import { wrappedFetch } from 'app-name/utils/wrapped-fetch';`



Expand Down Expand Up @@ -135,7 +135,7 @@ Docs available on https://github.com/emberjs/data/
- Add a deprecation notice to the ember-fetch README
- Archive the ember-fetch repo
- Remove ember-fetch from the blueprints
- Remove ember-fetch from the guides (only one reference per version)
- Remove ember-fetch from the guides (only one reference per version)

## Drawbacks

Expand Down