Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions e2e/fixtures/custom-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"@rspress/plugin-playground": "workspace:*",
"@rspress/plugin-preview": "workspace:*",
"@rspress/shared": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"rspress": "workspace:*",
"solid-js": "^1.9.5"
},
Expand Down
4 changes: 2 additions & 2 deletions e2e/fixtures/plugin-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"dependencies": {
"@rspress/plugin-playground": "workspace:*",
"@rspress/shared": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"rspress": "workspace:*",
"solid-js": "^1.9.5"
},
Expand Down
4 changes: 2 additions & 2 deletions e2e/fixtures/plugin-preview-custom-entry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"dependencies": {
"@rsbuild/plugin-vue": "^1.0.7",
"@rspress/plugin-preview": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"rspress": "workspace:*",
"solid-js": "^1.9.5",
"vue": "^3.5.13"
Expand Down
5 changes: 3 additions & 2 deletions e2e/fixtures/plugin-preview-custom-entry/rspress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ createApp(App).mount('#root');
`;
}
return `
import { render } from 'react-dom';
import { createRoot } from 'react-dom/client';
import ${JSON.stringify(entryCssPath)};
import Demo from ${JSON.stringify(demoPath)};
render(<Demo />, document.getElementById('root'));
const container = document.getElementById('root');
createRoot(container).render(<Demo />);
`;
},
builderConfig: {
Expand Down
4 changes: 2 additions & 2 deletions e2e/fixtures/plugin-preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"@rspress/plugin-playground": "workspace:*",
"@rspress/plugin-preview": "workspace:*",
"@rspress/shared": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"rspress": "workspace:*",
"solid-js": "^1.9.5"
},
Expand Down
2 changes: 1 addition & 1 deletion e2e/fixtures/search-algolia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"preview": "rspress preview"
},
"dependencies": {
"react": "^18.3.1",
"react": "^19.1.0",
"rspress": "workspace:*"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions e2e/tests/api-docgen.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ test.describe('api-docgen test', async () => {

test('Index page', async ({ page }) => {
await page.goto(`http://localhost:${appPort}`);
const table = await page.$('table');
const tableContent = await page.evaluate(table => table?.innerHTML, table);
await page.waitForSelector('table');
const tableContent = await page.$eval('table', table => table?.innerHTML);

// Property
expect(tableContent).toContain('Property');
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
"lodash-es": "^4.17.21",
"mdast-util-mdxjs-esm": "^2.0.1",
"picocolors": "^1.1.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-helmet-async": "^2.0.5",
"react-lazy-with-preload": "^2.2.1",
"react-syntax-highlighter": "^15.6.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-algolia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@types/node": "^18.11.17",
"@types/react": "^18.3.20",
"@types/react-dom": "^18.3.6",
"react": "^18.3.1",
"react": "^19.1.0",
"typescript": "^5.8.2"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-api-docgen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"@types/node": "^18.11.17",
"@types/react": "^18.3.20",
"@types/react-dom": "^18.3.6",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-router-dom": "^6.29.0",
"typescript": "^5.8.2",
"unified": "^11.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-auto-nav-sidebar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@types/node": "^18.11.17",
"@types/react": "^18.3.20",
"@types/react-dom": "^18.3.6",
"react": "^18.3.1",
"react": "^19.1.0",
"typescript": "^5.8.2"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-client-redirects/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@types/node": "^18.11.17",
"@types/react": "^18.3.20",
"@types/react-dom": "^18.3.6",
"react": "^18.3.1",
"react": "^19.1.0",
"typescript": "^5.8.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-last-updated/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@types/react": "^18.3.20",
"@types/react-dom": "^18.3.6",
"execa": "8.0.1",
"react": "^18.3.1",
"react": "^19.1.0",
"typescript": "^5.8.2"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-medium-zoom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@types/node": "^18.11.17",
"@types/react": "^18.3.20",
"@types/react-dom": "^18.3.6",
"react": "^18.3.1",
"react": "^19.1.0",
"typescript": "^5.8.2"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
"@types/react": "^18.3.20",
"@types/react-dom": "^18.3.6",
"mdast-util-mdx-jsx": "^3.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-router-dom": "^6.29.0",
"typescript": "^5.8.2",
"unified": "^11.0.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"@types/react-dom": "^18.3.6",
"mdast-util-mdx-jsx": "^3.2.0",
"mdast-util-mdxjs-esm": "^2.0.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-router-dom": "^6.29.0",
"typescript": "^5.8.2",
"unified": "^11.0.5",
Expand Down
10 changes: 6 additions & 4 deletions packages/plugin-preview/src/generate-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ export function generateEntry(
`;

const reactEntry = `
import { render } from 'react-dom';
import { createRoot } from 'react-dom/client';
Copy link
Contributor

@Timeless0911 Timeless0911 Apr 21, 2025

Choose a reason for hiding this comment

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

react is the peerDependencies of @rspress/plugin-preview, we should update the peer range if we no longer support react 17.

import ${JSON.stringify(entryCssPath)};
import Demo from ${JSON.stringify(demoPath)};
render(<Demo />, document.getElementById('root'));
const container = document.getElementById('root');
createRoot(container).render(<Demo />);
`;
const entryContent = customEntry
? customEntry({
Expand All @@ -48,7 +49,7 @@ export function generateEntry(
return;
}
const reactContent = `
import { render } from 'react-dom';
import { createRoot } from 'react-dom/client';
import ${JSON.stringify(entryCssPath)};
${routes
.map((demo, index) => {
Expand All @@ -67,7 +68,8 @@ export function generateEntry(
</div>
)
}
render(<App /> , document.getElementById('root'));
const container = document.getElementById('root');
createRoot(container).render(<App />);
`;
const solidContent = `
import { render } from 'solid-js/web';
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-rss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@rspress/runtime": "workspace:*",
"@types/node": "^18.11.17",
"@types/react": "^18.3.20",
"react": "^18.3.1",
"react": "^19.1.0",
"typescript": "^5.8.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-shiki/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@types/node": "^18.11.17",
"@types/react": "^18.3.20",
"@types/react-dom": "^18.3.6",
"react": "^18.3.1",
"react": "^19.1.0",
"typescript": "^5.8.2",
"unified": "^11.0.5"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-typedoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@types/node": "^18.11.17",
"@types/react": "^18.3.20",
"@types/react-dom": "^18.3.6",
"react": "^18.3.1",
"react": "^19.1.0",
"typescript": "^5.8.2"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
},
"dependencies": {
"@rspress/shared": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-helmet-async": "^2.0.5",
"react-router-dom": "^6.29.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/theme-default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
"htmr": "^1.0.2",
"lodash-es": "^4.17.21",
"nprogress": "^0.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-helmet-async": "^2.0.5",
"react-syntax-highlighter": "^15.6.1"
},
Expand Down
Loading