rsnext/test/e2e/app-dir
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 Apply #40833 (#40872) 2022-09-25 11:45:00 +02:00
app-alias Remove unnecessary experimental flag (#40766) 2022-09-21 21:30:46 +02:00
app-prefetch Remove unnecessary experimental flag (#40766) 2022-09-21 21:30:46 +02:00
app-rendering Remove unnecessary experimental flag (#40766) 2022-09-21 21:30:46 +02:00
app-static Remove unnecessary experimental flag (#40766) 2022-09-21 21:30:46 +02:00
asset-prefix Remove unnecessary experimental flag (#40766) 2022-09-21 21:30:46 +02:00
rsc-basic Should resolve esm external module imports on server (#40865) 2022-09-26 15:46:01 -07:00
trailingslash Remove unnecessary experimental flag (#40766) 2022-09-21 21:30:46 +02:00
app-alias.test.ts Use resolved url in flight entry loader (#40697) 2022-09-20 10:40:27 +00:00
app-static.test.ts Add handling for static generation in app (#40561) 2022-09-19 18:05:28 +00:00
asset-prefix.test.ts Break assetPrefix app tests into separate suite (#40701) 2022-09-19 18:17:16 -07:00
index.test.ts Update handling of redirect/404 throw to cross server->client boundary (#40890) 2022-09-26 13:16:20 +02:00
prefetching.test.ts Disable flakey dev app test temporarily (#40816) 2022-09-22 16:26:31 -07:00
rendering.test.ts Add handling for static generation in app (#40561) 2022-09-19 18:05:28 +00:00
rsc-basic.test.ts Should resolve esm external module imports on server (#40865) 2022-09-26 15:46:01 -07:00
trailingslash.test.ts Add additional tests for prefetch and trailingSlash (#40517) 2022-09-13 16:01:43 -07:00
vercel-analytics.test.ts Handle redirects in new router (#40396) 2022-09-20 15:28:07 +02:00