Breaking changes in Rspress v2.0.0 #1891
Replies: 9 comments 9 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.
-
Upgrade shiki v3 and use shiki transformers
import { defineConfig } from 'rspress/config';
import { pluginShiki, createTransformerDiff } from '@rspress/plugin-shiki';
+import {
+ transformerNotationDiff,
+ transformerNotationErrorLevel,
+ transformerNotationFocus,
+ transformerNotationHighlight,
+} from '@shikijs/transformers';
export default defineConfig({
plugins: [
pluginShiki({
transformers: [
- createTransformerDiff(),
- // createTransformerLineNumber(),
- // createTransformerErrorLevel(),
- // createTransformerHighlight(),
- // createTransformerFocus(),
+ createTransformerLineNumber(),
+ // transformerNotationDiff(),
+ // transformerNotationErrorLevel(),
+ // transformerNotationHighlight(),
+ // transformerNotationFocus(),
],
}),
],
}); |
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.
-
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