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

[ember-cli] Replace http-mocks feature from with Mirage #527

Closed
mehulkar opened this issue Aug 13, 2019 · 3 comments
Closed

[ember-cli] Replace http-mocks feature from with Mirage #527

mehulkar opened this issue Aug 13, 2019 · 3 comments

Comments

@mehulkar
Copy link
Contributor

I recently discovered that ember-cli has the ability to setup server mocks using ember g http-mock posts. It installs the http-mock library and sets up a server/ folder with some boilerplate.

This feature is documented on the old ember-cli website: https://ember-cli.com/user-guide/#mocks, but not in the new guides as far as I can see: https://cli.emberjs.com/release/.

I personally use ember-cli-mirage in every project, and although it can feel bit larger in terms of surface area, I think the request handling bit of it can be given first class support in Ember CLI core. The database part (schema/db/factories/models) of Mirage is a more advanced feature (which I love), but could come from userland (similar to something like faker.js).

Considering that Mirage is moving to a framework-agnostic setup, I think this is a good time to revisit how Ember CLI can integrate it (probably by including it in package.json, rather than exposing it as an opaque generator command.)

@mehulkar mehulkar changed the title Remove http-mocks feature from Ember Cli Replace http-mocks feature from Ember Cli with Mirage (or parts of it) Aug 13, 2019
@jrjohnson
Copy link
Sponsor

I've seen a couple questions on SO recently about server mocks (eg: https://stackoverflow.com/questions/57333908/ember-js-how-can-i-test-express-server-mock). I think this was a great feature a few years ago that probably needs to go away (or at least recommend users to go another way for almost everything it used to support).

@mehulkar mehulkar changed the title Replace http-mocks feature from Ember Cli with Mirage (or parts of it) [ember-cli] Replace http-mocks feature from with Mirage Nov 23, 2019
@ming-codes
Copy link

I kinda hoped mirage would integrate with http-mock better as the client side fake generation is super slow. I have a relatively small app that takes 5 seconds to load because it's spending the time to generate all the fake objects. Since Ember doesn't have hot module reload, this happens on every code change.

I love the mirage workflow, but it's really unacceptable to take 5 seconds to see my change.

@mehulkar
Copy link
Contributor Author

Opened #576 for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants