Skip to content

v2.0.0-rc.2

Latest

Choose a tag to compare

@SoonIter SoonIter released this 08 Dec 10:54
· 13 commits to main since this release
d938835

Breaking Changes🚨

theme folder should use @rspress/core/theme-original

related PR: #2860

In Rspress V1 document, @theme is the alias for rspress/theme, but @theme is an alias which points to theme/index.tsx and falls back to rspress/theme.

rspress/theme or @rspress/core/theme points to Rspress's theme-default, they are actually different things.

We standardize this behavior, which is the same as docusaurus.

  1. In docs directory, @theme or @rspress/core/theme should be used, which points to theme/index.tsx and falls back to theme-default

  2. In theme directory , @theme-original or @rspress/core/theme-original should be used, which always points to Rspress's theme-default, used for users to customize themes, which is very useful for users who publish npm theme packages.

 // theme/index.tsx
- import { Layout as BasicLayout } from 'rspress/theme'; // or @rspress/core/theme
+ import { Layout } from '@rspress/core/theme-original';

 const Layout = () => {
    return <BasicLayout {...} />
 }
 
 export { Layout }
- export * from 'rspress/theme' // or @rspress/core/theme
+ export * from '@rspress/core/theme-original';

Merge @theme-assets to @theme

Before

We have a separate entry for exporting @theme-assets

import { SvgWrapper } from '@theme'
import SearchSvg from '@theme-assets/Search';

<SvgWrapper icon={SearchSvg} />

After

@theme-assets has been removed. Icons are exported from @theme and prefixed with Icon, for example: IconSearch

import { SvgWrapper, IconSearch } from '@theme';

<SvgWrapper icon={IconSearch} />
                   ^? type Icon = React.FC<React.SVGProps<SVGSVGElement>> | string;

Refactor @rspress/plugin-preview and simplify usage

related PR: #2806

Before: Required declarations in both config file and MDX file.

pluginPreview({
  previewMode: 'iframe',
  iframeOptions: { position: 'fixed' },
});
```tsx preview

```

After: Only declare in the MDX file.

```tsx preview="iframe-fixed"

```

What's Changed

New Features 🎉

  • feat(plugin-preview)!: simplify the usage via tsx preview="iframe-fixed" and support hmr by @SoonIter in #2806
  • feat(plugin-preview): should support dark mode by @SoonIter in #2816
  • feat(i18n): add Russian translation for built-in i18n text by @dragomano in #2827
  • feat(rspack)!: revert Rspack native watcher by default by @Timeless0911 in #2830
  • feat(plugin-typedoc): Upgrade to TypeDoc v0.28 with new API by @Karibash in #2790
  • feat(mdx): support absolute paths with <root>/ prefix in remarkFileCodeBlock by @Copilot in #2665
  • feat(theme)!: custom theme should use @rspress/core/theme-original by @SoonIter in #2860
  • feat(theme/Root): add ejectable component to theme by @Copilot in #2858
  • feat(theme/Toc): Add data-depth attribute to TOC items by @Copilot in #2859
  • feat(plugin-typedoc): Add setup callback for TypeDoc customization by @Karibash in #2841

Performance 🚀

  • perf(theme/useWindowSize): optimize useWindowSize with debounce to reduce resize handler calls by @Copilot in #2849

Bug Fixes 🐞

  • fix(theme): css vars color by @SoonIter in #2791
  • fix(theme): table should be scrollable and startTransition should not be a html attribute by @SoonIter in #2792
  • fix(theme): th width should be same with td by @SoonIter in #2804
  • fix(theme): plugin-preview should hide the toc by @SoonIter in #2803
  • fix(theme/Sidebar): pass down onClick prop by @JounQin in #2811
  • fix(plugin-twoslash): Make twoslashOptions optional by @Karibash in #2819
  • fix(ssg): wrong html selector for crawlers regression due to [email protected] progressiveChunkSize change by @SoonIter in #2831
  • fix(theme/callout): link in callout should use currentColor by @SoonIter in #2838
  • fix(plugin-typedoc): allow typedoc plugin interface as usual by @SoonIter in #2836
  • fix(theme/outline): line-height of toc item by @SoonIter in #2840
  • fix(cli): should not restart when public folder change files by @SoonIter in #2847
  • fix(core): Fix an issue where the PackageManagerTabs component outputs broken Markdown by @Karibash in #2861

Document 📖

  • docs: update package manager command from beta to rc by @chenjiahan in #2800
  • docs: Add "new" tag to plugin documentation for new v1 plugins by @Copilot in #2851

Other Changes

  • chore(theme/doc): add border to inline text code by @SoonIter in #2796
  • chore(deps)!: update dependency react-router-dom to v7 by @renovate[bot] in #1802
  • chore(deps): update actions/checkout digest to 34e1148 by @renovate[bot] in #2798
  • chore(deps): update all patch dependencies by @renovate[bot] in #2799
  • chore(deps): update dependency @rstack-dev/doc-ui to ^1.12.0 - autoclosed by @renovate[bot] in #2802
  • chore(deps): update dependency @rslib/core to v0.18.0 by @renovate[bot] in #2801
  • chore(infra): use @rslib/core preserveModules by @SoonIter in #2805
  • chore(build): enable redirect.dts.extension to fix type issue by @Timeless0911 in #2814
  • chore(deps): update dependency prettier to v3.7.3 by @renovate[bot] in #2825
  • chore(deps): update all patch dependencies by @renovate[bot] in #2824
  • chore: fix the diff.yml event by @yifancong in #2828
  • chore(theme): export FallbackHeading for reusing by @JounQin in #2813
  • chore: bump pnpm 10.24.0 and remove trust policy config by @Timeless0911 in #2829
  • chore(deps): update actions/checkout action to v6 by @renovate[bot] in #2833
  • chore(deps): update actions/setup-node action to v6 by @renovate[bot] in #2834
  • chore(theme/Tabs): upgrade hover style by @SoonIter in #2837
  • chore(deps): update all patch dependencies by @renovate[bot] in #2842
  • chore(deps): update dependency lint-staged to v16 by @renovate[bot] in #2844
  • chore(deps): update playwright monorepo to v1.57.0 by @renovate[bot] in #2843
  • chore(theme/Table): narrow table padding by @SoonIter in #2845
  • chore(Theme/outline): add shadow by @SoonIter in #2846
  • chore(plugin-algolia): Add Russian translation for plugin-algolia by @dragomano in #2832
  • chore(core): truncate some error stack traces to 5 lines by @Copilot in #2821
  • chore(build): use advanced ESM by @Timeless0911 in #2848
  • chore(deps): update dependency cspell to ^9.4.0 by @renovate[bot] in #2854
  • chore(deps): update all patch dependencies by @renovate[bot] in #2853
  • chore(deps): update dependency react-router-dom to ^7.10.1 by @renovate[bot] in #2855
  • chore(deps): update dependency rimraf to ^6.1.2 by @renovate[bot] in #2856
  • Release v2.0.0-rc.2 by @SoonIter in #2862

New Contributors

Full Changelog: v2.0.0-rc.1...v2.0.0-rc.2