rsnext/packages/next/lib
Shu Ding d5fa555841
Implement SWC transformer for server and client graphs (#40603)
This is an initial implementation of the Server Components SWC
transformer. For the server graph, it detects client entries via the
`"client"` directive and transpile them into module reference code; for
the client graph, it removes the directives. And for both graphs, it
checks if there is any invalid imports for the given environment and
shows proper errors.

With that added, we can switch from `next-flight-client-loader` to
directly use the SWC loader in one pass. Next step is to get rid of the
`.client.` extension in other plugins.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [x] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-09-17 00:12:59 +02:00
..
eslint Bypass empty pages folder for layouts (#40132) 2022-09-03 00:13:47 +00:00
helpers Add handling for auto installing TypeScript deps and HMRing tsconfig (#39838) 2022-08-23 13:16:47 -05:00
typescript Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
web Implement web server as the request handler for edge SSR (#33635) 2022-01-26 06:22:11 +00:00
chalk.ts Add process env NEXT_RUNTIME (#36383) 2022-04-26 17:54:28 +00:00
coalesced-function.ts Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
commands.ts fix(next): dev server starting when importing a file using get-projec… (#38274) 2022-08-07 17:31:30 +00:00
compile-error.ts Adds ESLint with default rule-set (#23702) 2021-04-30 11:09:07 +00:00
constants.ts Implement SWC transformer for server and client graphs (#40603) 2022-09-17 00:12:59 +02:00
detect-typo.ts Add CLI command typo detection (#34836) 2022-02-26 07:05:26 -08:00
download-wasm-swc.ts feat(next/swc): enable wasm first binding load for the platforms (#38883) 2022-08-23 14:59:13 -05:00
fatal-error.ts Adds ESLint with default rule-set (#23702) 2021-04-30 11:09:07 +00:00
file-exists.ts upgrade to typescript 4.4.3 (#29112) 2021-09-16 18:06:57 +02:00
find-config.ts Support postcss.config.cjs (#38486) 2022-07-18 14:34:29 -05:00
find-pages-dir.ts Bypass empty pages folder for layouts (#40132) 2022-09-03 00:13:47 +00:00
flat-readdir.ts fix(#37106): middleware can not be loaded from src folder (#37428) 2022-06-08 14:10:05 +00:00
get-package-version.ts Small code improvements (#37227) 2022-05-26 23:19:47 +00:00
get-project-dir.ts fix(next): dev server starting when importing a file using get-projec… (#38274) 2022-08-07 17:31:30 +00:00
has-necessary-dependencies.ts Add handling for auto installing TypeScript deps and HMRing tsconfig (#39838) 2022-08-23 13:16:47 -05:00
import-next-warning.ts Add warning when importing "next" directly (#35884) 2022-04-05 10:57:45 -05:00
install-dependencies.ts Detect pnpm correctly when installing missing dependencies (#37813) 2022-06-19 12:33:23 +00:00
interop-default.ts Add new target for middleware (#30299) 2021-10-26 18:50:56 +02:00
is-error.ts fix: fixes #33314 move is-plain-object for es5 compilation (#33690) 2022-01-27 17:59:42 +00:00
is-serializable-props.ts Enable @typescript-eslint/no-use-before-define variables,enums,typedefs for core files (#39511) 2022-08-11 16:32:52 -05:00
load-custom-routes.ts feat(next): Support has match and locale option on middleware config (#39257) 2022-08-31 11:23:30 -05:00
non-nullable.ts temporary: re-flag font optimization (#20372) 2020-12-21 19:26:00 +00:00
oxford-comma-list.ts refactor(typescript): extract preflight functions (#13510) 2020-05-28 23:39:46 +00:00
patch-incorrect-lockfile.ts Enable @typescript-eslint/no-use-before-define for functions (#39602) 2022-08-15 10:29:51 -04:00
pick.ts [middleware] Support any method when fetching a Request instance (#37540) 2022-06-08 11:00:49 +00:00
pretty-bytes.ts Move syntax formatting to prettier (#7454) 2019-05-29 13:57:26 +02:00
recursive-copy.ts Add initial standalone build handling (#31003) 2021-11-09 11:03:20 -06:00
recursive-delete.ts Fix various Trusted Types violations without use of policy (#34726) 2022-05-05 00:11:36 +00:00
recursive-readdir.ts Remove extraneous fs.stat calls (#27779) 2021-08-09 15:28:00 +00:00
redirect-status.ts Extract redirect utils into a separate file (#39433) 2022-08-09 14:34:25 -05:00
resolve-from.ts Add handling for auto installing TypeScript deps and HMRing tsconfig (#39838) 2022-08-23 13:16:47 -05:00
try-to-parse-path.ts Enable @typescript-eslint/no-use-before-define for functions (#39602) 2022-08-15 10:29:51 -04:00
verify-partytown-setup.ts Detect pnpm correctly when installing missing dependencies (#37813) 2022-06-19 12:33:23 +00:00
verifyAndLint.ts Bypass empty pages folder for layouts (#40132) 2022-09-03 00:13:47 +00:00
verifyTypeScriptSetup.ts Skip auto-install for missing deps in CI (#39882) 2022-08-23 22:53:05 -05:00
with-promise-cache.ts Extract and refactor getPageStaticInfo (#37062) 2022-05-20 14:24:00 +02:00
worker.ts Ensure workers are not left open (#34503) 2022-02-18 09:12:56 +00:00