github web-infra-dev/rspress v2.0.0-beta.21

latest releases: v2.0.1, v2.0.0, v2.0.0-rc.8...
pre-release6 months ago

Breaking Changes 🚨

πŸ”₯Remove builderPlugins, migrate to builderConfig.plugins

related PR: #2371

We can already configure Rsbuild in builderConfig, there is another configuration that is confusing.

#1891 (comment)

Migration step:

export default defineConfig({
-  builderPlugins: [
-      pluginFoo()
-  ],
+  builderConfig: {
+    plugins: [
+      pluginFoo()
+    ],
+  },
});

Expose type RspressPlugin from "rspress/core" packge

Related PR: #2360

#1891 (comment)

We do not want users to use our private package like @rspress/shared, only "rspress": "2.0.0" package is all your needed

before

import type { RspressPlugin } from '@rspress/shared';
// package.json
{
  "devDependencies": {
       "rspress": "1.44.0",
       "@rspress/shared": "1.44.0"
  }
}

after

import type { RspressPlugin } from 'rspress/core';
// package.json
{
  "devDependencies": {
       "rspress": "2.0.0",
  }
}
Details

For compatibility, @rspress/shared will still export RspressPlugin type, but using rspress/core and setting "rspress" as peerDependencies will make it less likely for your plugin to encounter type errors.

For example:

{
  "peerDependencies": {
     "rspress": "^2.0.0"
  }
}

FIle code block syntax support in core ```tsx file="./demo.tsx"

related PR: #2361

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 plugin-preview and plugin-playground will change.

before

only using together with @rspress/plugin-preview and @rspress/plugin-playground

<code src="./example.tsx" />

after

This syntax is supported in the core package.

```tsx file="./example.tsx"
```
// example.tsx
export default () => <div>I'm a example in another file</div>

What's Changed

New Features πŸŽ‰

  • feat: change pnpm install packageName to pnpm add packageName on PackageManagerTabs by @Marukome0743 in #2364
  • feat(mdx)!: support File Code Block of ```tsx file="./filename" to write demo code in another file by @SoonIter in #2361
  • feat!: expose type RspressPlugin from "rspress/core", "@rspress/shared" which is a private package should not be installed by users by @SoonIter in #2360
  • feat(auto-nav-sidebar): support custom-link group by @SoonIter in #2379

Bug Fixes 🐞

  • fix: support mutations from child nodes for dynamic TOC by @JounQin in #2363
  • fix: use withBase from runtime by @jbroma in #2373
  • fix(buildCache): other configuration files besides rspress.config.ts should be added to persistent cache deps by @SoonIter in #2378
  • fix: use SvgWrapper in LinkCard & NavScreenMenuGroup by @jbroma in #2381

Document πŸ“–

Other Changes

  • refactor!: move @rspress/plugin-last-updated and @rspress/plugin-medium-zoom to @rspress/core by @SoonIter in #2359
  • test: remove leftover node:path module from e2e tests by @Marukome0743 in #2369
  • refactor: remove remoteSerach in search configuration, type: 'remote' by @SoonIter in #2366
  • test: add missing non-null assertion to dynamic-toc test by @Marukome0743 in #2370
  • chore(deps): update all patch dependencies by @renovate[bot] in #2374
  • chore(deps): update pnpm to v10.13.1 by @renovate[bot] in #2377
  • chore(deps): update dependency zx to ^8.7.0 by @renovate[bot] in #2375
  • refactor!: remove builderPlugins and migrate it to builderConfig.plugins by @SoonIter in #2371
  • chore(deps): update playwright monorepo to v1.54.1 by @renovate[bot] in #2376
  • Release v2.0.0-beta.21 by @SoonIter in #2380

New Contributors

Full Changelog: v2.0.0-beta.20...v2.0.0-beta.21

Don't miss a new rspress release

NewReleases is sending notifications on new releases.