Skip to content

Commit bc721ae

Browse files
committed
Remove canary-gate and add experimental warning for alternate bundler
This: - Removes the Rspack canary gate - Adds a warning that Rspack support is driven by the community and is experimental. - Links to the discussion page for feedback Test Plan: Installed and used in an app. Verified the link is valid.
1 parent 8f1409d commit bc721ae

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

packages/next-rspack/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# next-rspack (EXPERIMENTAL)
22

33
> [!WARNING]
4-
> This package is currently experimental and actively developed and supported in Next.js`canary` branch. To use this, you must be using a published canary build of Next.js.
4+
> This package is currently experimental. It's not an official Next.js plugin, and is supported by the Rspack team in partnership with Next.js. Help improve Next.js and Rspack by providing feedback at https://github.com/vercel/next.js/discussions/77800
55
66
This plugin allows you to use [Rspack](https://rspack.dev) in place of webpack with Next.js.
77

packages/next-rspack/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "15.3.0-canary.41",
44
"repository": {
55
"url": "vercel/next.js",
6-
"directory": "packages/next-plugin-rspack"
6+
"directory": "packages/next-rspack"
77
},
88
"types": "index.d.ts",
99
"dependencies": {

packages/next/src/shared/lib/get-rspack.ts

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { CanaryOnlyError, isStableBuild } from './canary-only'
1+
import { warnOnce } from '../../build/output/log'
22

33
export function getRspackCore() {
4-
gateCanary()
4+
warnRspack()
55
try {
66
// eslint-disable-next-line import/no-extraneous-dependencies
77
return require('@rspack/core')
@@ -17,7 +17,7 @@ export function getRspackCore() {
1717
}
1818

1919
export function getRspackReactRefresh() {
20-
gateCanary()
20+
warnRspack()
2121
try {
2222
// eslint-disable-next-line import/no-extraneous-dependencies
2323
const plugin = require('@rspack/plugin-react-refresh')
@@ -37,10 +37,8 @@ export function getRspackReactRefresh() {
3737
}
3838
}
3939

40-
function gateCanary() {
41-
if (isStableBuild()) {
42-
throw new CanaryOnlyError(
43-
'Rspack support is only available in Next.js canary.'
44-
)
45-
}
40+
function warnRspack() {
41+
warnOnce(
42+
`\`next-rspack\` is currently experimental. It's not an official Next.js plugin, and is supported by the Rspack team in partnership with Next.js. Help improve Next.js and Rspack by providing feedback at https://github.com/vercel/next.js/discussions/77800`
43+
)
4644
}

0 commit comments

Comments
 (0)