Skip to content
Open
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
2 changes: 1 addition & 1 deletion e2e/fixtures/i18n/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ test.describe('i18n test', async () => {
await page.waitForTimeout(100);
await page.click('.rspress-nav-menu-group-content a');
await page.waitForTimeout(100);
const content = await page.textContent('#root');
const content = await page.textContent('#__rspress_root');
expect(content).not.toEqual('');
const overviewContentEn = await page.textContent('.overview-index');
expect(overviewContentEn).toContain('Overview');
Expand Down
4 changes: 2 additions & 2 deletions e2e/fixtures/plugin-preview-custom-entry/rspress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ export default defineConfig({
import { createApp } from 'vue';
import App from ${JSON.stringify(demoPath)};
import ${JSON.stringify(entryCssPath)};
createApp(App).mount('#root');
createApp(App).mount('#__rspress_root');
`;
}
return `
import { createRoot } from 'react-dom/client';
import ${JSON.stringify(entryCssPath)};
import Demo from ${JSON.stringify(demoPath)};
const container = document.getElementById('root');
const container = document.getElementById('__rspress_root');
createRoot(container).render(<Demo />);
`;
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</head>

<body>
<div id="root"><!--<?- DOC_CONTENT ?>--></div>
<div id="__rspress_root"><!--<?- DOC_CONTENT ?>--></div>
<div id="search-container"></div>
</body>
</html>
2 changes: 1 addition & 1 deletion packages/core/src/runtime/csrClientEntry.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createRoot } from 'react-dom/client';
import { ClientApp } from './ClientApp';

const container = document.getElementById('root')!;
const container = document.getElementById('__rspress_root')!;
createRoot(container).render(<ClientApp />);
2 changes: 1 addition & 1 deletion packages/core/src/runtime/ssrClientEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { initPageData } from './initPageData';
// 3. add onRecoverableError

async function renderInBrowser() {
const container = document.getElementById('root')!;
const container = document.getElementById('__rspress_root')!;
const initialPageData = await initPageData(
removeBase(window.location.pathname),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export default defineConfig({
import { createApp } from 'vue';
import App from ${JSON.stringify(demoPath)};
import ${JSON.stringify(entryCssPath)};
createApp(App).mount('#root');
createApp(App).mount('#__rspress_root');
`;
},
builderConfig: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export default defineConfig({
import { createApp } from 'vue';
import App from ${JSON.stringify(demoPath)};
import ${JSON.stringify(entryCssPath)};
createApp(App).mount('#root');
createApp(App).mount('#__rspress_root');
`;
},
builderConfig: {
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-preview/src/generate-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ export function generateEntry(
import { render } from 'solid-js/web';
import ${JSON.stringify(entryCssPath)};
import Demo from ${JSON.stringify(demoPath)};
render(() => <Demo />, document.getElementById('root'));
render(() => <Demo />, document.getElementById('__rspress_root'));
`;

const reactEntry = `
import { createRoot } from 'react-dom/client';
import ${JSON.stringify(entryCssPath)};
import Demo from ${JSON.stringify(demoPath)};
const container = document.getElementById('root');
const container = document.getElementById('__rspress_root');
createRoot(container).render(<Demo />);
`;
const entryContent = customEntry
Expand Down Expand Up @@ -68,7 +68,7 @@ export function generateEntry(
</div>
)
}
const container = document.getElementById('root');
const container = document.getElementById('__rspress_root');
createRoot(container).render(<App />);
`;
const solidContent = `
Expand All @@ -91,7 +91,7 @@ export function generateEntry(
</div>
)
}
render(() => <App /> , document.getElementById('root'));
render(() => <App /> , document.getElementById('__rspress_root'));
`;
const renderContent = framework === 'solid' ? solidContent : reactContent;
const id = `_${toValidVarName(key)}`;
Expand Down
Loading