-
Notifications
You must be signed in to change notification settings - Fork 165
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
Allow for the Intercepters to be treated as a plugin (Pretender, MSW) #1037
Comments
@samselikoff do you see any glaring issues with this plan? It seems reasonable to me. |
Plan seems good and in fact this was the road we were headed down in https://github.com/miragejs/miragejs/pull/699/files I believe... simplifying the main Mirage server api to be Honestly it might be better to remove a hard-coded interceptor altogether and just let Mirage be concerned with turning a request into a response (and making sure it can run in both the browser and node). Then people can use pretender, MSW, even express. |
The hard coded interceptor has already been removed to another repo. I just didnt remove it yet from miragejs as it would be a breaking change. But that is on the roadmap above, the 4th checkbox |
@samselikoff what do you think about making @cah-briangantzler a collaborator? He's doing more work on this package than anyone else at this point, and while I'm happy to keep reviewing and helping out as I can, I don't want to be a bottleneck to the progress that Brian is making. |
Im actually a collaborator on ember-cli-mirage where this repo originated. The work I'm doing there has been spilling over into this one. But I like to have another set of eyes, would prefer to not be the only one 😄 |
Of course he can be a collab here I thought he already was! I definitely don't want to be anyone's bottleneck just because I don't have the cycles to work on this anymore 👍 |
@cah-brian-gantzler is this still active? Is MirageJS still active? I'm using it on a project and running into some issues. |
It's minimally active, yes. The creator stepped away and a few of us have been trying to keep the lights on. MSW can indeed be used as an interceptor right now, using https://github.com/miragejs/mirage-msw. It's a bit rough, though, since msw starts up asynchronously, and everything thus far in mirage has been sync. So, to really get it working correctly we'll need to break some APIs I think. |
Yes, I created the initial support for MSW, but IanVS has been taking it to the next step improving it. Thanks IanVS. |
Thanks for the replies both, I'll take a look at moving away from Pretender. |
I've added a readme to https://github.com/miragejs/mirage-msw, and published 0.1.2. Please open an issue there if you encounter any problems. |
Since there's been some activity on this, I've been working on a |
Status update: I've changed over my own non-trivial app to use mirage-msw, and it seems to be working well. There are new alpha versions of miragejs published in order to support the async-startup needs of msw. So, if you want to try out mirage-msw, I recommend using at least the following versions:
It's still definitely experimental, but I think it's ready for a bit of alpha testing if anyone else is interested. |
Currently the interceptor is Pretender and it is pretty hardcoded. The intent is to isolate the Interceptor code into its own configuration, then move it to its own package to allow for other interceptors to be specified.
Currently the main entry point to the interceptor code is on the server (the get, put, post, etc methods) and the server is the
this
then the routes are configured. The goal would be to move these methods to the interceptor code and off the server.Tasks
this
when theroutes
function is run. The Mirage Server will be supplied as a property on the config. For most users this should not be a breaking change, but more advanced uses this could be.The text was updated successfully, but these errors were encountered: