Skip to content

feat: upgrade to @rspress/core v2#1

Merged
jkzing merged 6 commits intoweb-infra-dev:mainfrom
SoonIter:upgrade-to-v2
Mar 19, 2026
Merged

feat: upgrade to @rspress/core v2#1
jkzing merged 6 commits intoweb-infra-dev:mainfrom
SoonIter:upgrade-to-v2

Conversation

@SoonIter
Copy link
Copy Markdown
Member

@SoonIter SoonIter commented Mar 13, 2026

Summary

Upgrade the CodeSandbox template from rspress v1 to v2.

Changes

  • Update rspress dependency from rspress: ^1.0.0 to @rspress/core: ^2.0.3
  • Add React 19 dependencies (react, react-dom)
  • Add "type": "module" for ESM support
  • Update import from 'rspress/config' to '@rspress/core'
  • Upgrade tsconfig.json to v2 standards

Related

- Update rspress dependency to @rspress/core ^2.0.3
- Add React 19 dependencies for v2
- Add "type": "module" for ESM support
- Update import from 'rspress/config' to '@rspress/core'
- Upgrade tsconfig.json to v2 standards
Copilot AI review requested due to automatic review settings March 13, 2026 08:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the project to a more modern ESM + TypeScript configuration and begins migrating the Rspress integration to the @rspress/core package.

Changes:

  • Expand tsconfig.json with stricter type-checking and bundler/ESM-oriented module settings.
  • Update rspress.config.ts imports to use Node’s node: prefix and @rspress/core.
  • Switch the package to ESM ("type": "module") and update dependencies toward the newer Rspress/React/Node types stack.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
tsconfig.json Adds modern TS compiler options, strictness, and MDX checking config.
rspress.config.ts Updates imports to Node built-ins and the new Rspress config entrypoint.
package.json Marks the package as ESM and changes dependency set toward @rspress/core + React typings/runtime.
Comments suppressed due to low confidence (1)

rspress.config.ts:6

  • With "type": "module" in package.json, this config will be evaluated as ESM in Node; __dirname is not defined in ESM modules. This will throw at runtime when Rspress loads the config. Replace __dirname usage with an ESM-safe directory derivation (via import.meta.url + fileURLToPath) or another approach supported by Rspress.
import * as path from 'node:path';
import { defineConfig } from '@rspress/core';

export default defineConfig({
  root: path.join(__dirname, 'docs'),
  title: 'Rspress',

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SoonIter SoonIter marked this pull request as draft March 13, 2026 10:01
@SoonIter SoonIter marked this pull request as ready for review March 18, 2026 12:41
@SoonIter SoonIter changed the title chore: upgrade to rspress v2 feat: upgrade to @rspress/core v2 Mar 18, 2026
@jkzing jkzing merged commit 570e2e6 into web-infra-dev:main Mar 19, 2026
@SoonIter SoonIter deleted the upgrade-to-v2 branch March 19, 2026 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants