rsnext/packages/next/shared/lib
Sukka 5360440413
fix(#39609): warns about suspense and ssr (#39676)
Currently, `next/dynamic` will opt-in to `React.lazy` if `{ suspense: true }` is used. And React 18 will always resolve the `Suspense` boundary on the server-side, effectively ignoring the `ssr` option.

The PR fixes #39609 by showing a warning message when `{ suspense: true, ssr: false }` is detected. The error documentation and the corresponding test case has also been updated.

In the future, Next.js could implement a custom version of `React.lazy` that could suspense without executing the lazy-loaded component on the server-side.

cc @huozhi 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
2022-08-18 13:53:23 +00:00
..
i18n Enable @typescript-eslint/no-use-before-define for functions (#39602) 2022-08-15 10:29:51 -04:00
isomorphic polish isomorphic path module (#36521) 2022-04-27 18:23:26 +00:00
page-path Eliminate path polyfill and incremental-cache from base server (#39548) 2022-08-12 15:25:47 +00:00
router Enable @typescript-eslint/no-use-before-define for functions (#39602) 2022-08-15 10:29:51 -04:00
amp-context.ts Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
amp-mode.ts Fix bloat in main bundle from amp (#37383) 2022-06-02 00:21:09 +00:00
amp.ts Fix bloat in main bundle from amp (#37383) 2022-06-02 00:21:09 +00:00
app-router-context.ts Refactor client entry plugin to separate methods. (#39162) 2022-08-12 13:01:19 +00:00
constants.ts Refactor client entry plugin to separate methods. (#39162) 2022-08-12 13:01:19 +00:00
dynamic.tsx fix(#39609): warns about suspense and ssr (#39676) 2022-08-18 13:53:23 +00:00
escape-regexp.ts perf(escapeStringRegexp): test before replace (#34472) 2022-04-16 05:42:10 +00:00
flatten.ts Refactor Page Paths utils and Middleware Plugin (#36576) 2022-04-30 11:19:27 +00:00
flush-effects.tsx Support multiple flush effects (#39559) 2022-08-12 19:06:08 +00:00
get-hostname.ts Execute middleware on Next.js internal requests (#37121) 2022-05-27 13:29:04 -05:00
head-manager-context.ts next/script fix duplicate scripts (#28428) 2021-08-24 11:07:38 -05:00
head.tsx Migrate head side effects to hooks (#37526) 2022-06-08 11:26:57 +00:00
html-context.ts Add runtime to PageConfig type (#37453) 2022-08-07 14:16:10 -05:00
image-config-context.ts fix: make sure image-config gets transpiled (#34677) 2022-02-22 09:27:18 -05:00
image-config.ts fix: wrong reference url for disableStaticImages (#39362) 2022-08-05 15:49:58 +00:00
is-plain-object.ts Use Edge Runtime for running Edge Functions locally (#37024) 2022-05-30 12:01:36 +00:00
loadable-context.ts Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
loadable.d.ts Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
loadable.js Preload chunks for next/dynamic in suspense mode (#37245) 2022-05-27 20:11:34 +00:00
match-remote-pattern.ts Fix experimental remotePatterns wildcard (#37137) 2022-05-25 20:25:06 +00:00
mitt.ts Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
router-context.ts Add new target for middleware (#30299) 2021-10-26 18:50:56 +02:00
runtime-config.ts Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
side-effect.tsx Fix: convert head instances to array (#38252) 2022-07-01 20:59:04 -05:00
styled-jsx.d.ts Remove precopied styled-jsx (#39520) 2022-08-12 17:08:38 +00:00
styled-jsx.js Remove precopied styled-jsx (#39520) 2022-08-12 17:08:38 +00:00
utils.ts Refactor client entry plugin to separate methods. (#39162) 2022-08-12 13:01:19 +00:00