rsnext/packages/next-swc
Shu Ding 4c3f59f88d
Implement server entry creation in client layer (#47127
In short, this PR adds a 3rd layer to the server compiler. This extra
layer is for marking the modules when re-entering the server layer from
a client component. It is almost identical to the existing server layer
and it should have all the same bundling and runtime behaviors, but it's
still special because it's not allowed to enter the client layer again
from there.

Because of that, we create the extra entry for that new layer when the
client layer compilation finishes in the `finishModules` phase. The new
entry is handled normally as it's in the server layer. But the original
module in the client layer will be compiled specially as special no-op
exports, and will then be connected via the `callServer` wrapper.

fix NEXT-809 ([link](https://linear.app/vercel/issue/NEXT-809)).
2023-03-15 23:58:18 +01:00
..
.cargo re-enable next-dev-tests (#47087) 2023-03-14 16:05:19 +01:00
.config re-enable next-dev-tests (#47087) 2023-03-14 16:05:19 +01:00
crates Implement server entry creation in client layer (#47127 2023-03-15 23:58:18 +01:00
native Extract next-swc Rust code into its own package (#31635) 2021-11-21 12:59:56 +01:00
.rustfmt.toml Extract next-swc Rust code into its own package (#31635) 2021-11-21 12:59:56 +01:00
Cargo.lock Implement custom Turbopack Next transformers (#47137) 2023-03-15 19:10:59 +00:00
Cargo.toml Implement custom Turbopack Next transformers (#47137) 2023-03-15 19:10:59 +00:00
package.json v13.2.5-canary.4 2023-03-15 11:55:55 +01:00
README.md docs: add readme with development instructions for next/swc (#43834) 2022-12-08 13:38:44 +01:00
rust-toolchain Update Turbopack to 230309.2 (#46971) 2023-03-09 13:24:24 -08:00

@next/swc

This package is responsible for swc compilation customized for next.js

Development

Run tests

cargo test

# Update snapshots and fixtures for tests
UPDATE=1 cargo test

Format code before submitting code

cargo fmt

Build the binary to integrate with next.js

pnpm build-native