rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

Move HTTP Mock to addon

Open mehulkar opened this issue 5 years ago • 2 comments

rendered

mehulkar avatar Jan 10 '20 02:01 mehulkar

This seems reasonable to me. I'll see what I can do to get it moving.

wagenet avatar Jul 23 '22 17:07 wagenet

I've added this RFC to next week's agenda.

bertdeblock avatar Aug 18 '22 16:08 bertdeblock

We discussed this at the CLI meeting today. We think is a good path forward and are open to accepting if there is someone volunteering to move it forward.

kategengler avatar Dec 07 '22 18:12 kategengler

Moving to an addon seems great if doable; however, it would be better if we exposed a serverMiddleware hook directly to ember apps for this purpose. The dance otherwise is very complicated and not forward-thinking as we move away from older addon patterns. I'd like to see http-mocks be the default story, mirage is .... not an ideal solution for anyone.

runspired avatar Dec 07 '22 20:12 runspired

@runspired could you expand on this a bit. I'm guessing you'd suggest an ember-cli RFC for this change?

wagenet avatar Jan 13 '23 20:01 wagenet

@wagenet currently to implement anything as a server-middleware it must be created as an addon. EmberCLI has no ability currently for sever middleware to be added except that mechanism. This makes creating solutions for apps that hook into the serve process very complicated: which includes any proposed http-mock replacement. Instead of mocks in-app you end up with mocks in an addon in the app.

runspired avatar Jan 14 '23 01:01 runspired

Basically my suggestion is for embercli to add registerMiddleware to the EmberApp in ember-cli-build

runspired avatar Jan 14 '23 01:01 runspired

We think the medium-term plan should be to deprecate HTTP mock, rather than extract it. To that end, we are putting this in FCP to close.

kategengler avatar Oct 20 '23 18:10 kategengler