rsnext/test/e2e
Jiachi Liu 2af6b63dd1
Should resolve esm external module imports on server (#40865)
### Issue

When import an esm package in client component, and use it in server
component page, it will fail to SSR but render successfully on client.
It's because the import to esm package will make the client chunk become
an **async module** since esm module will be treated as **async**.

```
page (serve component) -> local module (client) -> external dependency (esm)
```

Then in react SSR layer, it need the module type information of that
chunk, async or not for react so that react could unwrap the async
module from `Promise` properly when SSR.

### Solution

We need to mark the client entries which are effected by async/esm
modules that becoming **async** as `async: true` in SSR manifest.

Since flight manifest plugin is only running against client compiler,
which doesn't have those module information from server compiler. So we
collect the async modules from the **server** compiler **client** layer
from flight entry client plugin, then leverage the collection to detect
if a module is async in flight manifest plugin for react.

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`
2022-09-26 15:46:01 -07:00
..
app-dir Should resolve esm external module imports on server (#40865) 2022-09-26 15:46:01 -07:00
basepath Add test case for /404 client transition (#40734) 2022-09-21 11:29:52 -07:00
browserslist Add support for browserslist and legacyBrowsers experimental option (#36584) 2022-05-17 15:09:34 +00:00
browserslist-extends Ensure browserslist extends works properly (#33890) 2022-02-02 13:23:51 -06:00
config-promise-export Add support for async fn / promise in next.config.js/.mjs (#33662) 2022-02-07 08:48:35 +00:00
dynamic-route-interpolation Match data fetch and busting cache key when path URI encodes (#39568) 2022-09-01 21:22:17 -07:00
edge-api-endpoints-can-receive-body Fix usage of experimental-edge in pages/api/index (#38024) 2022-07-19 19:33:00 -05:00
edge-can-use-wasm-files Enable @typescript-eslint/no-use-before-define for functions (#39602) 2022-08-15 10:29:51 -04:00
edge-compiler-can-import-blob-assets allow Edge Functions to stream a compressed fetch response (#39608) 2022-08-21 10:43:02 +00:00
edge-compiler-module-exports-preference Update some flaking tests for edge compiler and rsc (#38344) 2022-07-05 14:37:42 -05:00
edge-render-getserversideprops Update to detect GSSP with edge runtime during build (#40076) 2022-08-30 18:18:02 +00:00
getserversideprops Fix failing e2e getServerSideProps test (#39885) 2022-08-23 22:41:38 -05:00
handle-non-hoisted-swc-helpers Ensure @swc/helpers do not rely on hoisting (#38174) 2022-06-29 22:47:44 +00:00
i18n-api-support Enable E2E deploy tests on publish (#37019) 2022-05-21 04:46:16 -05:00
i18n-data-fetching-redirect Update deploy E2E test setup (#37126) 2022-05-23 17:37:21 -05:00
i18n-ignore-redirect-source-locale i18n regression tests and docs for ignore locale in rewrite (#37581) 2022-06-10 14:04:31 -05:00
i18n-ignore-rewrite-source-locale i18n regression tests and docs for ignore locale in rewrite (#37581) 2022-06-10 14:04:31 -05:00
ignore-invalid-popstateevent Ignore popstate with invalid state (#37110) 2022-05-28 20:07:44 -05:00
link-with-api-rewrite Handle Client Rewrites Correctly (#38340) 2022-07-05 22:44:38 +00:00
manual-client-base-path Fix invalid warning for existing experimental flag (#38027) 2022-06-25 23:05:02 -05:00
middleware-base-path fix(next/router): Prevent query delete in routing when next.config basePath option is truthy (#40566) 2022-09-15 22:56:53 +00:00
middleware-custom-matchers feat(next): Support has match and locale option on middleware config (#39257) 2022-08-31 11:23:30 -05:00
middleware-custom-matchers-basepath feat(next): Support has match and locale option on middleware config (#39257) 2022-08-31 11:23:30 -05:00
middleware-custom-matchers-i18n feat(next): Support has match and locale option on middleware config (#39257) 2022-08-31 11:23:30 -05:00
middleware-fetches-with-any-http-method [middleware] Support any method when fetching a Request instance (#37540) 2022-06-08 11:00:49 +00:00
middleware-general Update expected middleware test error (#40918) 2022-09-26 14:05:26 -07:00
middleware-matcher feat(next): Support has match and locale option on middleware config (#39257) 2022-08-31 11:23:30 -05:00
middleware-redirects Enable @typescript-eslint/no-use-before-define for functions (#39602) 2022-08-15 10:29:51 -04:00
middleware-responses Enable @typescript-eslint/no-use-before-define for functions (#39602) 2022-08-15 10:29:51 -04:00
middleware-rewrites Ensure prefetch heuristic matches with and without middleware (#39920) 2022-08-26 16:24:10 -05:00
middleware-trailing-slash feat(next): Support has match and locale option on middleware config (#39257) 2022-08-31 11:23:30 -05:00
new-link-behavior Add support for passing ref to next/link with new behavior enabled (#36537) 2022-04-28 11:32:32 +02:00
next-font Update font loader output path (#40868) 2022-09-26 12:59:38 -07:00
next-head Fix document head with react 18 (#37443) 2022-06-04 10:30:42 +00:00
next-script [Script] Allow next/script to be placed in _document body (#37894) 2022-06-27 17:56:53 +00:00
no-eslint-warn-with-no-eslint-config fix: detect ESLint config in package.json (#40158) 2022-09-01 16:23:03 +00:00
nonce-head-manager correctly assess node equality when nonce attribute is present (#27573) 2021-11-10 19:31:32 -06:00
postcss-config-cjs Fix postcss deploy e2e test (#38782) 2022-07-18 20:21:35 -05:00
prerender Ensure On-Demand revalidate does not consider preview cookie (#39313) 2022-08-04 08:23:54 -05:00
prerender-native-module Migrate prerender tests to new set-up (#29245) 2021-09-21 16:21:05 +02:00
proxy-request-with-middleware Enable @typescript-eslint/no-use-before-define for functions (#39602) 2022-08-15 10:29:51 -04:00
reload-scroll-backforward-restoration Update deploy E2E test setup (#37126) 2022-05-23 17:37:21 -05:00
ssr-react-context fix: react dev bundle is picked in prod mode (#39221) 2022-08-01 14:21:42 +00:00
streaming-ssr test: merge edge ssr tests (#39924) 2022-08-24 23:56:59 +01:00
styled-jsx Setup require hook in next-server for styled-jsx resolving (#39305) 2022-08-08 20:27:42 -05:00
swc-warnings Add experimental flag to force SWC transforms (#36789) 2022-05-10 10:33:31 +00:00
switchable-runtime Update error handling during app static generation (#40823) 2022-09-22 19:44:30 -07:00
type-module-interop fix(#36435): apply correct fix (#36464) 2022-04-26 11:15:49 -05:00
yarn-pnp/test Update version for yarn pnp tests (#38688) 2022-07-15 11:41:53 -05:00
basepath-trailing-slash.test.ts Ensure trailingSlash is correct for index with query (#29217) 2021-09-21 16:18:42 +02:00
basepath.test.ts Add test case for /404 client transition (#40734) 2022-09-21 11:29:52 -07:00
example.txt Add util for generating new tests/error documents (#33001) 2022-01-06 09:45:04 -06:00
prerender-crawler.test.ts Add crawler blocking for fallback: true (#29121) 2021-09-16 11:01:28 -05:00
prerender-native-module.test.ts Update resolving for node_modules trace pass (#30985) 2021-11-04 20:09:37 -05:00
prerender.test.ts Ensure On-Demand revalidate does not consider preview cookie (#39313) 2022-08-04 08:23:54 -05:00