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

Simplify custom Writable #32247

Merged
merged 7 commits into from Dec 8, 2021
Merged

Simplify custom Writable #32247

merged 7 commits into from Dec 8, 2021

Conversation

devknoll
Copy link
Contributor

@devknoll devknoll commented Dec 7, 2021

The previous Writable was unnecessarily complex. This PR simplifies it a little.

@ijjk ijjk added created-by: Chrome Aurora PRs by the Google Chrome team: https://web.dev/aurora type: next labels Dec 7, 2021
@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk
Copy link
Member

ijjk commented Dec 8, 2021

Failing test suites

Commit: 6018e30

test/integration/app-document-add-hmr/test/index.test.js

  • _app/_document add HMR > should HMR when _document is added
Expand output

● _app/_document add HMR › should HMR when _document is added

expect(received).toContain(expected) // indexOf

Expected substring: "index page"
Received string:    "<head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width\"><meta name=\"next-head-count\" content=\"2\"><noscript data-n-css=\"\"></noscript><script defer=\"\" nomodule=\"\" src=\"/_next/static/chunks/polyfills.js?ts=1638933623994\"></script><script src=\"/_next/static/chunks/fallback/webpack.js?ts=1638933623994\" defer=\"\"></script><script src=\"/_next/static/chunks/fallback/main.js?ts=1638933623994\" defer=\"\"></script><script src=\"/_next/static/chunks/fallback/pages/_app.js?ts=1638933623994\" defer=\"\"></script><script src=\"/_next/static/chunks/fallback/pages/_error.js?ts=1638933623994\" defer=\"\"></script><noscript id=\"__next_css__DO_NOT_USE__\"></noscript></head><body style=\"overflow: hidden;\"><div id=\"__next\" data-reactroot=\"\"></div><script src=\"/_next/static/chunks/fallback/react-refresh.js?ts=1638933623994\"></script><script id=\"__NEXT_DATA__\" type=\"application/json\">{\"props\":{\"pageProps\":{\"statusCode\":500}},\"page\":\"/_error\",\"query\":{},\"buildId\":\"development\",\"isFallback\":false,\"err\":{\"name\":\"ModuleBuildError\",\"message\":\"Module build failed (from ../../../packages/next/dist/build/webpack/loaders/next-swc-loader.js):\\nError: Failed to read source code from /home/runner/work/next.js/next.js/test/integration/app-document-add-hmr/pages/_app.js\\n\\nCaused by:\\n    No such file or directory (os error 2)\",\"stack\":\"ModuleBuildError: Module build failed (from ../../../packages/next/dist/build/webpack/loaders/next-swc-loader.js):\\nError: Failed to read source code from /home/runner/work/next.js/next.js/test/integration/app-document-add-hmr/pages/_app.js\\n\\nCaused by:\\n    No such file or directory (os error 2)\\n    at processResult (/home/runner/work/next.js/next.js/packages/next/dist/compiled/webpack/bundle5.js:54691:19)\\n    at /home/runner/work/next.js/next.js/packages/next/dist/compiled/webpack/bundle5.js:54793:5\\n    at /home/runner/work/next.js/next.js/packages/next/dist/compiled/webpack/bundle5.js:140664:11\\n    at /home/runner/work/next.js/next.js/packages/next/dist/compiled/webpack/bundle5.js:140460:20\\n    at context.callback (/home/runner/work/next.js/next.js/packages/next/dist/compiled/webpack/bundle5.js:140389:13)\"},\"gip\":true,\"scriptLoader\":[]}</script><div id=\"__next-build-watcher\" style=\"position: fixed; bottom: 10px; right: 20px; width: 0px; height: 0px; z-index: 99999;\"></div><next-route-announcer><p aria-live=\"assertive\" id=\"__next-route-announcer__\" role=\"alert\" style=\"border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; width: 1px; white-space: nowrap; overflow-wrap: normal;\"></p></next-route-announcer><nextjs-portal></nextjs-portal></body>"

  54 |       await fs.remove(appPage)
  55 |     }
> 56 |   })
     |     ^
  57 |
  58 |   it('should HMR when _document is added', async () => {
  59 |     let indexContent = await fs.readFile(indexPage)

  at Object.<anonymous> (integration/app-document-add-hmr/test/index.test.js:56:27)

@devknoll devknoll marked this pull request as ready for review December 8, 2021 03:56
@ijjk

This comment has been minimized.

@ijjk
Copy link
Member

ijjk commented Dec 8, 2021

Stats from current PR

Default Build (Increase detected ⚠️)
General Overall decrease ✓
vercel/next.js canary azukaru/next.js x-simplify-node-stream Change
buildDuration 18.1s 17.6s -508ms
buildDurationCached 3.2s 3.4s ⚠️ +113ms
nodeModulesSize 347 MB 347 MB -1.47 kB
Page Load Tests Overall increase ✓
vercel/next.js canary azukaru/next.js x-simplify-node-stream Change
/ failed reqs 0 0
/ total time (seconds) 2.979 2.762 -0.22
/ avg req/sec 839.29 905.01 +65.72
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.338 1.356 ⚠️ +0.02
/error-in-render avg req/sec 1868.36 1843.42 ⚠️ -24.94
Client Bundles (main, webpack, commons)
vercel/next.js canary azukaru/next.js x-simplify-node-stream Change
450.HASH.js gzip 179 B 179 B
framework-HASH.js gzip 42.2 kB 42.2 kB
main-HASH.js gzip 28.4 kB 28.4 kB
webpack-HASH.js gzip 1.45 kB 1.45 kB
Overall change 72.3 kB 72.3 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary azukaru/next.js x-simplify-node-stream Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary azukaru/next.js x-simplify-node-stream Change
_app-HASH.js gzip 1.37 kB 1.37 kB
_error-HASH.js gzip 194 B 194 B
amp-HASH.js gzip 312 B 312 B
css-HASH.js gzip 326 B 326 B
dynamic-HASH.js gzip 2.38 kB 2.38 kB
head-HASH.js gzip 350 B 350 B
hooks-HASH.js gzip 635 B 635 B
image-HASH.js gzip 4.49 kB 4.49 kB
index-HASH.js gzip 263 B 263 B
link-HASH.js gzip 1.87 kB 1.87 kB
routerDirect..HASH.js gzip 321 B 321 B
script-HASH.js gzip 383 B 383 B
withRouter-HASH.js gzip 318 B 318 B
85e02e95b279..7e3.css gzip 107 B 107 B
Overall change 13.3 kB 13.3 kB
Client Build Manifests
vercel/next.js canary azukaru/next.js x-simplify-node-stream Change
_buildManifest.js gzip 460 B 460 B
Overall change 460 B 460 B
Rendered Page Sizes
vercel/next.js canary azukaru/next.js x-simplify-node-stream Change
index.html gzip 532 B 532 B
link.html gzip 545 B 545 B
withRouter.html gzip 526 B 526 B
Overall change 1.6 kB 1.6 kB

Default Build with SWC (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary azukaru/next.js x-simplify-node-stream Change
buildDuration 19.4s 18.8s -627ms
buildDurationCached 3.3s 3.4s ⚠️ +15ms
nodeModulesSize 347 MB 347 MB -1.47 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary azukaru/next.js x-simplify-node-stream Change
/ failed reqs 0 0
/ total time (seconds) 2.969 2.865 -0.1
/ avg req/sec 842.12 872.51 +30.39
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.369 1.414 ⚠️ +0.04
/error-in-render avg req/sec 1826.77 1768.63 ⚠️ -58.14
Client Bundles (main, webpack, commons)
vercel/next.js canary azukaru/next.js x-simplify-node-stream Change
450.HASH.js gzip 179 B 179 B
framework-HASH.js gzip 42.3 kB 42.3 kB
main-HASH.js gzip 28.6 kB 28.6 kB
webpack-HASH.js gzip 1.44 kB 1.44 kB
Overall change 72.5 kB 72.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary azukaru/next.js x-simplify-node-stream Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary azukaru/next.js x-simplify-node-stream Change
_app-HASH.js gzip 1.35 kB 1.35 kB
_error-HASH.js gzip 180 B 180 B
amp-HASH.js gzip 305 B 305 B
css-HASH.js gzip 321 B 321 B
dynamic-HASH.js gzip 2.37 kB 2.37 kB
head-HASH.js gzip 342 B 342 B
hooks-HASH.js gzip 622 B 622 B
image-HASH.js gzip 4.53 kB 4.53 kB
index-HASH.js gzip 256 B 256 B
link-HASH.js gzip 1.9 kB 1.9 kB
routerDirect..HASH.js gzip 314 B 314 B
script-HASH.js gzip 375 B 375 B
withRouter-HASH.js gzip 309 B 309 B
85e02e95b279..7e3.css gzip 107 B 107 B
Overall change 13.3 kB 13.3 kB
Client Build Manifests
vercel/next.js canary azukaru/next.js x-simplify-node-stream Change
_buildManifest.js gzip 458 B 458 B
Overall change 458 B 458 B
Rendered Page Sizes
vercel/next.js canary azukaru/next.js x-simplify-node-stream Change
index.html gzip 533 B 533 B
link.html gzip 546 B 546 B
withRouter.html gzip 527 B 527 B
Overall change 1.61 kB 1.61 kB
Commit: 28b5c80

@ijjk ijjk merged commit aa32deb into vercel:canary Dec 8, 2021
@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
created-by: Chrome Aurora PRs by the Google Chrome team: https://web.dev/aurora type: next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants