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
Feat/remote server #2041
base: main
Are you sure you want to change the base?
Feat/remote server #2041
Conversation
This commit implements the bulk of the handling for the remote server, particularly the passthrough handling for the internal requests.
In some testing I'm doing (using this branch) I see from the 'initial state' commit 08010c9 log lines like
which is fine when handled, but more confusing when followed by the unhandled message e.g.
This is however intended if the remote is attached and then does not handle the request. I guess in this context, that the first lines are intended only for debugging whilst developing (MSW, not user code)? I separately receive (in the testing side, from commit 3ea224f)
or
in setupRemoteServer.ts: line 101, which perhaps serves a similar purpose (if you like those lines, I'll remove the trailing space which gives a double space between 'Ignored'/'Handled' and 'GET'). |
Awesome PR, hope this gets merged. This unlocks overriding server mocks in frameworks like nextjs and remix |
@marval2 - I agree, but just to check, did you try this branch on some code and did it work for you? (I'd be good to know that it works for someone else too in practice, not just that you like the idea, although I'm pleased even if it's only the latter). |
Thank you for your work on this! This needs a really thorough review. I don't have the time right now to dive into this. Others are also welcome to review the code and share their thoughts. |
In the spirit of your X posts regarding opening PRs and your comment on Discord with a mid-April timeline, how's this looking? :) |
Much cleaner PR for the remote-server handling.
The commits here are not as accurate a reflection of the manner in which they were implemented, and the "initial state" commit may not reflect exactly truthfully the initial state of the msw/feat/ws-sync-handlers branch, from which this code was based.
However, the changed files and number of commits prevents the massive PR in #2028
Only one of these two should be merged (if approved/at all), but this may be easier to review (the final point is almost identical, the other has removed an originally existing console.log line whereas here it is retained).