rsnext/test
Jiachi Liu 38ac71b993
Fix esm property def in flight loader (#66286)
### What

Remove creating client proxy for each ESM export, instead for ESM we
create a CJS module proxy for itself and access the property with export
name as the actual export.

### Why

`proxy` is the module proxy that we treat the module as a client
boundary.
For ESM, we access the property of the module proxy directly for each
export.
This is bit hacky that treating using a CJS like module proxy for ESM's
exports,
but this will avoid creating nested proxies for each export. It will be
improved in the future.

Notice that for `next/dynamic`, if you're doing a dynamic import of
client component in server component, and trying to access the named
export directly, it will error. Instead you need to align the dynamic
import resolved value wrapping with a `default:` property (e.g. `{
default: resolved }`) like what `React.lazy` accepted.

Revert #57301
Fixes #66212

x-ref:
[slack](https://vercel.slack.com/archives/C04DUD7EB1B/p1716897764858829)
2024-06-10 11:21:03 +02:00
..
.stats-app Update React from 81c5ff2e04 to f994737d14 (#66093) 2024-05-22 19:34:06 -07:00
development Remove redundant React dependency declarations in test (#66530) 2024-06-05 18:10:24 +02:00
e2e Fix esm property def in flight loader (#66286) 2024-06-10 11:21:03 +02:00
examples Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
integration Unignore test/**/*.test.* for ESLint (#66415) 2024-06-03 18:15:29 +02:00
lib Fix broken BrowserInterface type (#66461) 2024-06-03 12:56:49 +00:00
production Fix broken BrowserInterface type (#66461) 2024-06-03 12:56:49 +00:00
unit fix: only generate prefetch rsc for ppr enabled routes (#66395) 2024-06-03 12:55:05 -07:00
.gitignore ci(workflow): enable test trace upload (#51107) 2023-06-12 17:14:13 +00:00
build-turbopack-build-tests-manifest.js Ensure production integration test results are uploaded (#63706) 2024-03-26 10:41:16 +01:00
build-turbopack-dev-tests-manifest.js Rename turbopack-tests-manifest to turbopack-dev-tests-manifest (#63409) 2024-03-19 10:26:14 +01:00
build-turbopack-tests-manifest.d.ts Update Turbopack test manifest from GitHub Actions artifact (#58394) 2023-11-24 16:48:12 +01:00
get-test-filter.js run tests from test suite that are not listed in the manifest (#58401) 2024-01-11 07:38:35 +00:00
jest-setup-after-env.ts Decrease default test timeouts (#56116) 2023-09-27 23:55:20 +00:00
ppr-tests-manifest.json [Breaking] disable client router cache for page segments (#66039) 2024-05-21 13:54:23 -07:00
readme.md
related-tests-manifest.json Reapply "chore(test): run related E2E deploy tests on PRs" (#64682) (#64712) 2024-04-19 11:02:43 +02:00
test-file.txt
turbopack-build-tests-manifest.json fix css order for some edge cases in App Dir (#66500) 2024-06-04 10:18:52 +02:00
turbopack-dev-examples-manifest.json Fix last examples for Turbopack (#64020) 2024-04-03 16:02:52 +02:00
turbopack-dev-tests-manifest.json refactor: deprecate future directory (#66432) 2024-06-04 15:23:23 +00:00

See Testing for more information on how you can run/write/debug tests for Next.js.