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

Document usage of suspense option of next/dynamic #28210

Merged
merged 7 commits into from Aug 18, 2021

Conversation

huozhi
Copy link
Member

@huozhi huozhi commented Aug 17, 2021

Documentation / Examples

errors/invalid-dynamic-suspense.md Outdated Show resolved Hide resolved
Co-authored-by: Steven <steven@ceriously.com>
@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

styfle
styfle approved these changes Aug 17, 2021
@ijjk

This comment has been minimized.

@ijjk
Copy link
Member

ijjk commented Aug 17, 2021

Failing test suites

Commit: fb071e5

test/acceptance/ReactRefreshLogBox.dev.test.js

  • server-side only compilation errors

Expand output

● server-side only compilation errors

ScriptTimeoutError: script timeout
  (Session info: headless chrome=92.0.4515.131)

  72 |
  73 |             // Wait for application to re-hydrate:
> 74 |             await browser.executeAsyncScript(function () {
     |             ^
  75 |               var callback = arguments[arguments.length - 1]
  76 |               if (window.__NEXT_HYDRATED) {
  77 |                 callback()

  at Object.throwDecodedError (../node_modules/selenium-webdriver/lib/error.js:550:15)
  at parseHttpResponse (../node_modules/selenium-webdriver/lib/http.js:565:13)
  at Executor.execute (../node_modules/selenium-webdriver/lib/http.js:491:26)
      at runMicrotasks (<anonymous>)
  at Proxy.execute (../node_modules/selenium-webdriver/lib/webdriver.js:700:17)
  at Object.patch (acceptance/helpers.js:74:13)
  at Object.<anonymous> (acceptance/ReactRefreshLogBox.dev.test.js:1432:3)

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk
Copy link
Member

ijjk commented Aug 18, 2021

Stats from current PR

Default Build (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary huozhi/next.js doc/dynamic-suspense Change
buildDuration 17.6s 17.6s -27ms
buildDurationCached 4.3s 4.4s ⚠️ +89ms
nodeModulesSize 61.5 MB 61.5 MB ⚠️ +96 B
Page Load Tests Overall increase ✓
vercel/next.js canary huozhi/next.js doc/dynamic-suspense Change
/ failed reqs 0 0
/ total time (seconds) 3.213 3.242 ⚠️ +0.03
/ avg req/sec 778.21 771.05 ⚠️ -7.16
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.996 1.949 -0.05
/error-in-render avg req/sec 1252.43 1282.68 +30.25
Client Bundles (main, webpack, commons)
vercel/next.js canary huozhi/next.js doc/dynamic-suspense Change
745.HASH.js gzip 179 B 179 B
framework-HASH.js gzip 42.2 kB 42.2 kB
main-HASH.js gzip 23.2 kB 23.2 kB
webpack-HASH.js gzip 1.44 kB 1.44 kB
Overall change 67.1 kB 67.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary huozhi/next.js doc/dynamic-suspense Change
polyfills-a4..dd70.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages Overall increase ⚠️
vercel/next.js canary huozhi/next.js doc/dynamic-suspense Change
_app-HASH.js gzip 979 B 979 B
_error-HASH.js gzip 194 B 194 B
amp-HASH.js gzip 312 B 312 B
css-HASH.js gzip 329 B 329 B
dynamic-HASH.js gzip 2.65 kB 2.67 kB ⚠️ +19 B
head-HASH.js gzip 351 B 351 B
hooks-HASH.js gzip 918 B 918 B
image-HASH.js gzip 4.13 kB 4.13 kB
index-HASH.js gzip 261 B 261 B
link-HASH.js gzip 1.66 kB 1.66 kB
routerDirect..HASH.js gzip 318 B 318 B
script-HASH.js gzip 387 B 387 B
withRouter-HASH.js gzip 320 B 320 B
bb14e60e810b..30f.css gzip 125 B 125 B
Overall change 12.9 kB 13 kB ⚠️ +19 B
Client Build Manifests
vercel/next.js canary huozhi/next.js doc/dynamic-suspense Change
_buildManifest.js gzip 492 B 492 B
Overall change 492 B 492 B
Rendered Page Sizes
vercel/next.js canary huozhi/next.js doc/dynamic-suspense Change
index.html gzip 539 B 539 B
link.html gzip 551 B 551 B
withRouter.html gzip 532 B 532 B
Overall change 1.62 kB 1.62 kB

Diffs

Diff for _buildManifest.js
@@ -10,7 +10,7 @@ self.__BUILD_MANIFEST = {
     "static\u002Fchunks\u002Fpages\u002Fcss-93a777c5ca0488084cce.js"
   ],
   "/dynamic": [
-    "static\u002Fchunks\u002Fpages\u002Fdynamic-1971880984ea23acb525.js"
+    "static\u002Fchunks\u002Fpages\u002Fdynamic-9e2274fd3ecd928533ad.js"
   ],
   "/head": ["static\u002Fchunks\u002Fpages\u002Fhead-1b407c3309821b5154c2.js"],
   "/hooks": [
Diff for dynamic-HASH.js
@@ -135,7 +135,7 @@
           if (true && suspenseOptions.suspense) {
             // TODO: add error doc when this feature is stable
             throw new Error(
-              "Disallowed suspense option usage with next/dynamic in blocking mode"
+              "Invalid suspense option usage in next/dynamic. Read more: https://nextjs.org/docs/messages/invalid-dynamic-suspense"
             );
           }
         }

Webpack 4 Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary huozhi/next.js doc/dynamic-suspense Change
buildDuration 14.2s 14.7s ⚠️ +480ms
buildDurationCached 6s 5.9s -93ms
nodeModulesSize 61.5 MB 61.5 MB ⚠️ +96 B
Page Load Tests Overall increase ✓
vercel/next.js canary huozhi/next.js doc/dynamic-suspense Change
/ failed reqs 0 0
/ total time (seconds) 3.22 3.15 -0.07
/ avg req/sec 776.28 793.6 +17.32
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.985 1.956 -0.03
/error-in-render avg req/sec 1259.64 1277.86 +18.22
Client Bundles (main, webpack, commons)
vercel/next.js canary huozhi/next.js doc/dynamic-suspense Change
16.HASH.js gzip 186 B 186 B
677f882d2ed8..HASH.js gzip 14.1 kB 14.1 kB
framework.HASH.js gzip 41.9 kB 41.9 kB
main-HASH.js gzip 10.6 kB 10.6 kB
webpack-HASH.js gzip 1.19 kB 1.19 kB
Overall change 68 kB 68 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary huozhi/next.js doc/dynamic-suspense Change
polyfills-a4..dd70.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages Overall increase ⚠️
vercel/next.js canary huozhi/next.js doc/dynamic-suspense Change
_app-HASH.js gzip 964 B 964 B
_error-HASH.js gzip 3.8 kB 3.8 kB
amp-HASH.js gzip 552 B 552 B
css-HASH.js gzip 333 B 333 B
dynamic-HASH.js gzip 2.85 kB 2.87 kB ⚠️ +21 B
head-HASH.js gzip 3.06 kB 3.06 kB
hooks-HASH.js gzip 924 B 924 B
index-HASH.js gzip 231 B 231 B
link-HASH.js gzip 1.64 kB 1.64 kB
routerDirect..HASH.js gzip 298 B 298 B
script-HASH.js gzip 2.98 kB 2.98 kB
withRouter-HASH.js gzip 295 B 295 B
30809af5c834..565.css gzip 125 B 125 B
Overall change 18.1 kB 18.1 kB ⚠️ +21 B
Client Build Manifests
vercel/next.js canary huozhi/next.js doc/dynamic-suspense Change
_buildManifest.js gzip 500 B 500 B
Overall change 500 B 500 B
Rendered Page Sizes
vercel/next.js canary huozhi/next.js doc/dynamic-suspense Change
index.html gzip 585 B 585 B
link.html gzip 597 B 597 B
withRouter.html gzip 578 B 578 B
Overall change 1.76 kB 1.76 kB

Diffs

Diff for _buildManifest.js
@@ -10,7 +10,7 @@ self.__BUILD_MANIFEST = {
     "static\u002Fchunks\u002Fpages\u002Fcss-c95c4860f8f0d43ed2d2.js"
   ],
   "/dynamic": [
-    "static\u002Fchunks\u002Fpages\u002Fdynamic-3b3842923577b772252c.js"
+    "static\u002Fchunks\u002Fpages\u002Fdynamic-67056ae68e50f2dbeb95.js"
   ],
   "/head": ["static\u002Fchunks\u002Fpages\u002Fhead-0aa0faef162b582deec7.js"],
   "/hooks": [
Diff for dynamic-HASH.js
@@ -782,7 +782,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
           if (true && suspenseOptions.suspense) {
             // TODO: add error doc when this feature is stable
             throw new Error(
-              "Disallowed suspense option usage with next/dynamic in blocking mode"
+              "Invalid suspense option usage in next/dynamic. Read more: https://nextjs.org/docs/messages/invalid-dynamic-suspense"
             );
           }
         }
Commit: 2ea6190

@kodiakhq kodiakhq bot merged commit 7ea7c23 into vercel:canary Aug 18, 2021
58 checks passed
@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
@huozhi huozhi deleted the doc/dynamic-suspense branch Feb 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants