rsnext/packages/next/compiled
OJ Kwon 5654cae2d7
feat(next/mdx): support experimental mdx-rs loader (#41919)
<!--
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 implements a configuration option in `next.config.js` to support
for rust-based MDX compiler (https://github.com/wooorm/mdxjs-rs).
Currently it is marked as experimental, as mdx-rs and loader both may
need some iteration to fix regressions.

When a new experimental flag is set (`mdxRs: true`), instead of using
`@mdx/js` loader `next/mdx` loads a new webpack loader instead.
Internally, it mostly mimics mdx/js's loader behavior, however actual
compilation will be delegated into next/swc's binding to call mdx-rs's
compiler instead.

I choose to use next-swc to expose its binding function, as mdx-rs
internally uses swc already and creating new binary can double up
bytesize (with all the complex processes of publishing new package).

## 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 lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-11-02 18:24:05 -07:00
..
@babel/runtime Pre-compile more dependencies continued (#32679) 2021-12-21 16:13:45 +01:00
@edge-runtime/primitives Upgrade Edge Runtime (#41987) 2022-10-27 15:07:05 -04:00
@hapi/accept Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
@napi-rs/triples Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
@segment/ajv-human-errors Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
@vercel/nft feat(experimental): option to polyfill fetch using undici in Node.js <18 (#40318) 2022-09-27 13:37:28 -07:00
acorn Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
amphtml-validator Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
anser Handle error overlay for new router (#41325) 2022-10-11 16:11:57 +02:00
arg Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
assert Add Replay integration for dev e2e tests (#40955) 2022-09-29 14:45:10 -07:00
async-retry Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
async-sema Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
babel Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
babel-packages feat(next/mdx): support experimental mdx-rs loader (#41919) 2022-11-02 18:24:05 -07:00
browserify-zlib Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
browserslist Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
buffer Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
bytes Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
chalk Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
ci-info Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
cli-select Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
comment-json Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
compression Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
conf feat(experimental): option to polyfill fetch using undici in Node.js <18 (#40318) 2022-09-27 13:37:28 -07:00
constants-browserify Pre-compile more dependencies (#32627) 2021-12-20 14:01:35 +01:00
content-disposition Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
content-type Update to latest ncc and ensure caniuse-lite data is external (#32064) 2021-12-08 10:41:35 -06:00
cookie Update to latest ncc and ensure caniuse-lite data is external (#32064) 2021-12-08 10:41:35 -06:00
cross-spawn Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
crypto-browserify Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
css.escape Handle error overlay for new router (#41325) 2022-10-11 16:11:57 +02:00
cssnano-simple Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
data-uri-to-buffer Handle error overlay for new router (#41325) 2022-10-11 16:11:57 +02:00
debug Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
devalue Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
domain-browser Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
edge-runtime Upgrade Edge Runtime (#41987) 2022-10-27 15:07:05 -04:00
events Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
find-cache-dir Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
find-up Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
fresh Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
get-orientation Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
glob Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
gzip-size Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
http-proxy Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
https-browserify Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
icss-utils Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
ignore-loader Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
image-size Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
is-animated Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
is-docker Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
is-wsl Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
jest-worker Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
json5 Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
jsonwebtoken Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
loader-utils2 Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
loader-utils3 Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
lodash.curry Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
lru-cache Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
micromatch Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
mini-css-extract-plugin Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
nanoid Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
native-url Update to latest ncc and ensure caniuse-lite data is external (#32064) 2021-12-08 10:41:35 -06:00
neo-async Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
node-fetch Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
node-html-parser BREAKING CHANGE: Remove target: serverless (#41495) 2022-10-18 09:47:13 -07:00
ora Update @types/node to 14.14.31 (#41634) 2022-10-22 11:19:14 -07:00
os-browserify Pre-compile more dependencies (#32627) 2021-12-20 14:01:35 +01:00
p-limit Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
path-browserify Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
platform Handle error overlay for new router (#41325) 2022-10-11 16:11:57 +02:00
postcss-flexbugs-fixes Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
postcss-modules-extract-imports Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
postcss-modules-local-by-default Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
postcss-modules-scope Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
postcss-modules-values Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
postcss-preset-env Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
postcss-safe-parser Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
postcss-scss Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
postcss-value-parser Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
process Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
punycode Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
querystring-es3 Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
raw-body Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
react Update react next channel (#42021) 2022-10-27 17:33:47 -07:00
react-dom Keep react-dom/server.node in precompiled (#42138) 2022-10-29 21:32:28 +00:00
react-is Improve errors for invalid component export (#41657) 2022-10-22 22:44:19 +00:00
react-server-dom-webpack Update react next channel (#41761) 2022-10-25 02:32:20 +00:00
regenerator-runtime Pre-compile more dependencies continued (#32679) 2021-12-21 16:13:45 +01:00
sass-loader Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
scheduler Update precompiled react to next channel (#41708) 2022-10-24 00:31:52 -07:00
schema-utils2 Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
schema-utils3 Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
semver Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
send Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
setimmediate Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
shell-quote Handle error overlay for new router (#41325) 2022-10-11 16:11:57 +02:00
source-map Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
stacktrace-parser Handle error overlay for new router (#41325) 2022-10-11 16:11:57 +02:00
stream-browserify Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
stream-http Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
string-hash Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
string_decoder Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
strip-ansi Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
tar Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
terser Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
text-table Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
timers-browserify Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
tty-browserify Pre-compile more dependencies (#32627) 2021-12-20 14:01:35 +01:00
ua-parser-js Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
undici [middleware] add tests for body reading methods #37980 (#41718) 2022-11-01 20:45:58 -07:00
unistore Prebundle react for appDir (#41337) 2022-10-18 16:32:23 -07:00
util Add Replay integration for dev e2e tests (#40955) 2022-09-29 14:45:10 -07:00
vm-browserify Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
watchpack Add Replay integration for dev e2e tests (#40955) 2022-09-29 14:45:10 -07:00
web-vitals Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
web-vitals-attribution add attribution to web vitals (#39368) 2022-10-04 00:17:30 +00:00
webpack Add Replay integration for dev e2e tests (#40955) 2022-09-29 14:45:10 -07:00
webpack-sources1 Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
webpack-sources3 Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
ws Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00