-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Update with-msw example #20335
Update with-msw example #20335
Conversation
Stats from current PRDefault Server Mode (Increase detected
|
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
buildDuration | 10.9s | 10.9s | -1ms |
nodeModulesSize | 82.4 MB | 82.4 MB | ✓ |
Page Load Tests Overall increase ✓
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.676 | 2.576 | -0.1 |
/ avg req/sec | 934.17 | 970.66 | +36.49 |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.604 | 1.577 | -0.03 |
/error-in-render avg req/sec | 1558.84 | 1585.58 | +26.74 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
677f882d2ed8..5e70.js gzip | 12.8 kB | 12.8 kB | ✓ |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-1f21dcf..0011.js gzip | 6.56 kB | 6.56 kB | ✓ |
webpack-95c2..e870.js gzip | 751 B | 751 B | ✓ |
Overall change | 59 kB | 59 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
polyfills-d3..23f6.js gzip | 31 kB | 31 kB | ✓ |
Overall change | 31 kB | 31 kB | ✓ |
Client Pages
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
_app-0d19cb6..5497.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-2cf0e..a0a0.js gzip | 3.69 kB | 3.69 kB | ✓ |
hooks-42456f..0c06.js gzip | 887 B | 887 B | ✓ |
index-8081ce..e44f.js gzip | 227 B | 227 B | ✓ |
link-0ab9f83..fa00.js gzip | 1.61 kB | 1.61 kB | ✓ |
routerDirect..c3d8.js gzip | 303 B | 303 B | ✓ |
withRouter-0..a68e.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.31 kB | 8.31 kB | ✓ |
Client Build Manifests
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
_buildManifest.js gzip | 323 B | 323 B | ✓ |
Overall change | 323 B | 323 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
index.html gzip | 612 B | 612 B | ✓ |
link.html gzip | 619 B | 619 B | ✓ |
withRouter.html gzip | 608 B | 608 B | ✓ |
Overall change | 1.84 kB | 1.84 kB | ✓ |
Serverless Mode
General
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
buildDuration | 13s | 12.9s | -95ms |
nodeModulesSize | 82.4 MB | 82.4 MB | ✓ |
Client Bundles (main, webpack, commons)
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
677f882d2ed8..5e70.js gzip | 12.8 kB | 12.8 kB | ✓ |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-1f21dcf..0011.js gzip | 6.56 kB | 6.56 kB | ✓ |
webpack-95c2..e870.js gzip | 751 B | 751 B | ✓ |
Overall change | 59 kB | 59 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
polyfills-d3..23f6.js gzip | 31 kB | 31 kB | ✓ |
Overall change | 31 kB | 31 kB | ✓ |
Client Pages
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
_app-0d19cb6..5497.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-2cf0e..a0a0.js gzip | 3.69 kB | 3.69 kB | ✓ |
hooks-42456f..0c06.js gzip | 887 B | 887 B | ✓ |
index-8081ce..e44f.js gzip | 227 B | 227 B | ✓ |
link-0ab9f83..fa00.js gzip | 1.61 kB | 1.61 kB | ✓ |
routerDirect..c3d8.js gzip | 303 B | 303 B | ✓ |
withRouter-0..a68e.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.31 kB | 8.31 kB | ✓ |
Client Build Manifests
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
_buildManifest.js gzip | 323 B | 323 B | ✓ |
Overall change | 323 B | 323 B | ✓ |
Serverless bundles
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
_error.js | 1 MB | 1 MB | ✓ |
404.html | 2.67 kB | 2.67 kB | ✓ |
hooks.html | 1.92 kB | 1.92 kB | ✓ |
index.js | 1 MB | 1 MB | ✓ |
link.js | 1.06 MB | 1.06 MB | ✓ |
routerDirect.js | 1.05 MB | 1.05 MB | ✓ |
withRouter.js | 1.05 MB | 1.05 MB | ✓ |
Overall change | 5.16 MB | 5.16 MB | ✓ |
This looks much better. The point of the example is to showcase the minimal integration. The one that's sufficient to get started. I think this change does that much better than #17695. Great job, @jensmeindertsma 👏 |
Stats from current PRDefault Server Mode (Decrease detected ✓)General
Page Load Tests Overall decrease
|
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 1.987 | 1.974 | -0.01 |
/ avg req/sec | 1258.34 | 1266.48 | +8.14 |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.153 | 1.222 | |
/error-in-render avg req/sec | 2167.63 | 2046.48 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
677f882d2ed8..5e70.js gzip | 12.8 kB | 12.8 kB | ✓ |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-b7e5569..0ca9.js gzip | 6.55 kB | 6.55 kB | ✓ |
webpack-95c2..e870.js gzip | 751 B | 751 B | ✓ |
Overall change | 59 kB | 59 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
polyfills-d3..23f6.js gzip | 31 kB | 31 kB | ✓ |
Overall change | 31 kB | 31 kB | ✓ |
Client Pages
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
_app-0d19cb6..5497.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-85785..a9f3.js gzip | 3.44 kB | 3.44 kB | ✓ |
hooks-42456f..0c06.js gzip | 887 B | 887 B | ✓ |
index-8081ce..e44f.js gzip | 227 B | 227 B | ✓ |
link-0ab9f83..fa00.js gzip | 1.61 kB | 1.61 kB | ✓ |
routerDirect..c3d8.js gzip | 303 B | 303 B | ✓ |
withRouter-0..a68e.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.05 kB | 8.05 kB | ✓ |
Client Build Manifests
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
_buildManifest.js gzip | 323 B | 323 B | ✓ |
Overall change | 323 B | 323 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
index.html gzip | 612 B | 612 B | ✓ |
link.html gzip | 618 B | 618 B | ✓ |
withRouter.html gzip | 606 B | 606 B | ✓ |
Overall change | 1.84 kB | 1.84 kB | ✓ |
Serverless Mode
General
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
buildDuration | 12.2s | 11.2s | -1.1s |
nodeModulesSize | 82.6 MB | 82.6 MB | ✓ |
Client Bundles (main, webpack, commons)
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
677f882d2ed8..5e70.js gzip | 12.8 kB | 12.8 kB | ✓ |
framework.HASH.js gzip | 39 kB | 39 kB | ✓ |
main-b7e5569..0ca9.js gzip | 6.55 kB | 6.55 kB | ✓ |
webpack-95c2..e870.js gzip | 751 B | 751 B | ✓ |
Overall change | 59 kB | 59 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
polyfills-d3..23f6.js gzip | 31 kB | 31 kB | ✓ |
Overall change | 31 kB | 31 kB | ✓ |
Client Pages
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
_app-0d19cb6..5497.js gzip | 1.28 kB | 1.28 kB | ✓ |
_error-85785..a9f3.js gzip | 3.44 kB | 3.44 kB | ✓ |
hooks-42456f..0c06.js gzip | 887 B | 887 B | ✓ |
index-8081ce..e44f.js gzip | 227 B | 227 B | ✓ |
link-0ab9f83..fa00.js gzip | 1.61 kB | 1.61 kB | ✓ |
routerDirect..c3d8.js gzip | 303 B | 303 B | ✓ |
withRouter-0..a68e.js gzip | 302 B | 302 B | ✓ |
Overall change | 8.05 kB | 8.05 kB | ✓ |
Client Build Manifests
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
_buildManifest.js gzip | 323 B | 323 B | ✓ |
Overall change | 323 B | 323 B | ✓ |
Serverless bundles
vercel/next.js canary | jensmeindertsma/next.js update-with-msw-example | Change | |
---|---|---|---|
_error.js | 1 MB | 1 MB | ✓ |
404.html | 2.67 kB | 2.67 kB | ✓ |
hooks.html | 1.92 kB | 1.92 kB | ✓ |
index.js | 1 MB | 1 MB | ✓ |
link.js | 1.06 MB | 1.06 MB | ✓ |
routerDirect.js | 1.05 MB | 1.05 MB | ✓ |
withRouter.js | 1.05 MB | 1.05 MB | ✓ |
Overall change | 5.16 MB | 5.16 MB | ✓ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jensmeindertsma LGTM. Thank you!
@@ -0,0 +1 @@ | |||
NEXT_PUBLIC_API_MOCKING=enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, @jensmeindertsma. Was it intentional to enable MSW in production?
I understand the idea is to have MSW running on preview builds but I can hardly find a use case for that. Shouldn't the preview build acts as an integration environment, implying you're previewing your feature against the actual API before merging and, thus, releasing it to production?
There's been a discussion opened (mswjs/msw#895) that having MSW enabled in production by default may be confusing. MSW is close-to-never intended to run in production (except if you're building an educational website, perhaps), so having it enabled in this example is misleading.
This pull request updates the MSW example. This includes updating the dependencies, but also changing most of the stuff back to how it was before #17695 got merged. Turns out it is much simpler to disable the library in production, you just need to add a
.env.production
.Also this updates the
README
.