Breaking changes in Rspress v2.0.0 #1891
Replies: 22 comments 16 replies
-
Custom themes require named exports
If you want to customize theme, please use named export as below: before
other components use named export import Theme from 'rspress/theme';
const Layout = () => <Theme.Layout beforeNavTitle={<div>some content</div>} />;
export default {
...Theme,
Layout,
};
export * from 'rspress/theme'; afterall the components use named export import { Layout as BasicLayout } from 'rspress/theme';
const Layout = () => <BasicLayout beforeNavTitle={<div>some content</div>} />;
// use named export, no need to `export default`
export { Layout };
export * from 'rspress/theme'; |
Beta Was this translation helpful? Give feedback.
-
Use shiki v3 by default, drop prism supportMigrate all code highlighting from prism to shiki in compile time. It is worth noting that some code block syntax will be changed, e.g before You can only use shiki via import { defineConfig } from 'rspress/config';
import { pluginShiki, createTransformerLineNumber, createTransformerDiff } from '@rspress/plugin-shiki';
export default defineConfig({
plugins: [
pluginShiki({
transformers: [
createTransformerLineNumber(),
createTransformerDiff(),
// createTransformerErrorLevel(),
// createTransformerHighlight(),
// createTransformerFocus(),
],
}),
],
}); after use shiki by default, import { defineConfig } from 'rspress/config';
import {
transformerNotationDiff,
} from '@shikijs/transformers';
export default defineConfig({
markdown: {
showLineNumber: true,
shiki: {
transformers: [
transformerNotationDiff(),
// transformerNotationErrorLevel(),
// transformerNotationFocus(),
// transformerNotationHighlight(),
],
}
}
}); |
Beta Was this translation helpful? Give feedback.
-
Builtin Sass and Less plugins removedRspress 2.0 no longer has Rsbuild's Less and Sass plugins built into it. You can manually install and register plugins to support Sass and Less.
// rspress.config.ts
import { defineConfig } from 'rspress/config';
import { pluginSass } from '@rsbuild/plugin-sass';
export default defineConfig({
builderPlugins: [pluginSass()],
});
// rspress.config.ts
import { defineConfig } from 'rspress/config';
import { pluginLess } from '@rsbuild/plugin-less';
export default defineConfig({
builderPlugins: [pluginLess()],
}); |
Beta Was this translation helpful? Give feedback.
-
React 19Rspress 2.0 uses React 19 by default, and the minimum supported React version is 18, which means React 17 will no longer be supported. |
Beta Was this translation helpful? Give feedback.
-
enable
|
Beta Was this translation helpful? Give feedback.
-
Add tailwind prefix to @rspress/theme-default for CSS isolation
This means you can control the integration of unocss or tailwindcss on your own, and it will not cause any conflict now. If you depend on Rspress' existing CSS class names such as |
Beta Was this translation helpful? Give feedback.
This comment was marked as disruptive content.
This comment was marked as disruptive content.
-
Make SSG strict by default, remove
|
Beta Was this translation helpful? Give feedback.
-
Update unified@11 and mdx related pkgs
If you are using your own rehype or remark plugin in Rspress, you also need to upgrade to a version compatible with |
Beta Was this translation helpful? Give feedback.
-
Drop support for Node 16
Node16 has reached EOL on September 11th, 2023, see https://nodejs.org/en/blog/announcements/nodejs16-eol Rspress 2.0 will drop support for Node 16 and the minimum supported Node version is 18. |
Beta Was this translation helpful? Give feedback.
-
Support dynamic TOC generation
It brings the application of the mdx component to a new level, ships lots of features and closes lots of issues 1. dynamic TOC generation even in user's tsx component![]() 2. the
|
Beta Was this translation helpful? Give feedback.
-
Enable
|
Beta Was this translation helpful? Give feedback.
-
🔥 Removed PackagesThese will be integrated by default in the
|
Beta Was this translation helpful? Give feedback.
-
Support Single Nav Mode by renaming the top level
|
Beta Was this translation helpful? Give feedback.
-
Reimplement
|
Beta Was this translation helpful? Give feedback.
-
Correct relative link in markdown without
|
Beta Was this translation helpful? Give feedback.
-
Remove
|
Beta Was this translation helpful? Give feedback.
-
Expose type
|
Beta Was this translation helpful? Give feedback.
-
FIle code block syntax support in core ```tsx file="./demo.tsx"
Users can import an external demo file as a code block. As we support this feature in the core. This also means that the syntax external code blocks are used in before only using with <code src="./example.tsx" /> after This is the syntax supported in the core package. ```tsx file="./example.tsx"
``` // example.tsx
export default () => <div>I'm a example in another file</div> |
Beta Was this translation helpful? Give feedback.
-
Merge
|
Beta Was this translation helpful? Give feedback.
-
Enable
|
Beta Was this translation helpful? Give feedback.
-
MDX fragments usage (ignore "_" prefix routes via
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Rsbuild v2.0.0 is under active development.
This thread is used to collect planned breaking changes for Rspress v2.0.0.
Beta Was this translation helpful? Give feedback.
All reactions