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

fix: removes request parsing from "onUnhandledRequest" #1990

Merged
merged 2 commits into from
Jan 22, 2024

Conversation

kettanaito
Copy link
Member

This isn't a breaking change because the behavior modified is not connected to what MSW promises the developer. This is a warning message change, basically. But it has huge performance implications for everyone:

  • MSW no longer imports graphql for everyone even if they aren't using the graphql handler;
  • MSW no longer does request parsing for unhandled requests just to see if they weren't GraphQL requests. This brings significant performance boost in general and even bigger so for teams with a large number of request handlers.

@kettanaito kettanaito added this to the Performance milestone Jan 22, 2024
"@types/statuses": "^2.0.4",
"chalk": "^4.1.2",
"chokidar": "^3.4.2",
"graphql": "^16.8.1",
"headers-polyfill": "^4.0.2",
"inquirer": "^8.2.0",
"is-node-process": "^1.2.0",
"js-levenshtein": "^1.1.6",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@thepassle
Copy link
Contributor

Module graph on main branch:
image

Module graph on this branch:
image

Nice improvement :)

@kettanaito
Copy link
Member Author

@thepassle, that is amazing. All thanks to @mattcosta7 and you for pointing these things out. Let's have this released!

@kettanaito kettanaito merged commit bc0bea6 into main Jan 22, 2024
11 checks passed
@kettanaito kettanaito deleted the fix/remove-parsing-from-unhandled branch January 22, 2024 14:10
@thepassle
Copy link
Contributor

@thepassle, that is amazing

Especially consider that we went from:
image

To:
image

@kettanaito
Copy link
Member Author

Released: v2.1.4 🎉

This has been released in v2.1.4!

Make sure to always update to the latest version (npm i msw@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

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

Successfully merging this pull request may close these issues.

Drop request parsing from "onUnhandledRequest"
3 participants