Skip to content
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 HTTP Mock to addon #576

Closed
wants to merge 2 commits into from
Closed
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
45 changes: 45 additions & 0 deletions text/0000-http-mock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
- Start Date: 2020-01-09
- Relevant Team(s): Ember CLI
- RFC PR: https://github.com/emberjs/rfcs/pull/576
- Tracking:

# Move http-mock feature into addon

## Summary

This RFC proposes to remove the builtin generator for `http-mock` feature in Ember CLI and move the
feature into an addon.

## Motivation

Removing the `http-mock` feature from the core offering of Ember CLI is an easy way to reduce the
Ember and Ember CLI surface area. Additionally `ember-cli-mirage` has become the standard addon to
mock server responses for testing and development and removing http-mock would make it more clear
that the Ember build system can be compatible with more than one solution to server mocking.

## Detailed design

Extract the http-mock generator into an addon and remove documentation from https://ember-cli.com/user-guide/#mocks

## How we teach this

There shouldn't be much to teach with this removal because the feature is not used very often and
removing it should not need teaching.

## Drawbacks

- There are some concerns about Mirage slowing down a test suite because it can generate many objects
at setup time.
- A lot of this bottleneck comes from using Mirage Models / Ember Data. It's possible that working
with the authors to improve that performance or recommending that the default experience is to
use plain JSON responses would mitigate this issue.

## Alternatives

Leave it in.

## Unresolved questions

- How does the `ember server` command use the output of the `server/` directory generated by http-mock
and does any code need to be cleaned up and moved into the addon there? Will any new public APIs need
to be introduced for an addon to implement the same feature?
Loading