rsnext/packages
OJ Kwon 0e8f2412ae
feat(next/swc): allow to run custom turbopack binary (#42656)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

This PR exposes internal injection point to specify custom binary /
bindings for the turbopack. It doesn't affect any existing native
bindings (swc), but only allows to run custom turbopack
(`turbo.startDev`) if specified.

The changes are mostly for the internal dev / testing iteration purpose.
Currently, the workflow to test new turbopack changes in next.js is

- update next-swc's cargo to point to specific changes in turbopack
- rebuild, specify next.js to use local binary

This requires additional build times (turbopack build cannot be used,
have to rebuild next-swc napi bindings) as well as if we'd like to try
some changes on the CI between next.js canary + latest turbopack,
integration gets bit tricky. 2 env variable is exposed for the purpose -
`__INTERNAL_CUSTOM_TURBOPACK_BINARY` stands for the executable binary
(next-dev) can be built in turbopack,
`__INTERNAL_CUSTOM_TURBOPACK_BINDINGS` stands for the custom napi
bindings if needed. Both are strictly internal as name implies. There
won't be any documentation, no semver guarantee or else. Current plan is
to execute some subset of next.js test on turbopack PRs with these
entrypoints.

Feature / security wise these are mostly harmless I believe - this is
devserver usually don't run on CI, and trying to print out warning if
flag is enabled.

## Bug

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

## Feature

- [ ] 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`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-11-14 21:24:31 -08:00
..
create-next-app v13.0.4-canary.0 2022-11-14 12:40:08 +01:00
eslint-config-next v13.0.4-canary.0 2022-11-14 12:40:08 +01:00
eslint-plugin-next v13.0.4-canary.0 2022-11-14 12:40:08 +01:00
font v13.0.4-canary.0 2022-11-14 12:40:08 +01:00
next feat(next/swc): allow to run custom turbopack binary (#42656) 2022-11-14 21:24:31 -08:00
next-bundle-analyzer v13.0.4-canary.0 2022-11-14 12:40:08 +01:00
next-codemod v13.0.4-canary.0 2022-11-14 12:40:08 +01:00
next-env v13.0.4-canary.0 2022-11-14 12:40:08 +01:00
next-mdx v13.0.4-canary.0 2022-11-14 12:40:08 +01:00
next-plugin-storybook v13.0.4-canary.0 2022-11-14 12:40:08 +01:00
next-polyfill-module v13.0.4-canary.0 2022-11-14 12:40:08 +01:00
next-polyfill-nomodule v13.0.4-canary.0 2022-11-14 12:40:08 +01:00
next-swc feat(next-swc/relay): Add javascript to language (#42894) 2022-11-14 12:28:39 -08:00
react-dev-overlay v13.0.4-canary.0 2022-11-14 12:40:08 +01:00
react-refresh-utils v13.0.4-canary.0 2022-11-14 12:40:08 +01:00