@rspress/core 2.0.0-alpha.9 → 2.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/loader.js CHANGED
@@ -7,7 +7,6 @@ import * as __WEBPACK_EXTERNAL_MODULE__mdx_js_mdx_b904bd09__ from "@mdx-js/mdx";
7
7
  import * as __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__ from "@rspress/shared";
8
8
  import * as __WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__ from "@rspress/shared/logger";
9
9
  import * as __WEBPACK_EXTERNAL_MODULE__rspress_shared_node_utils_78947ce6__ from "@rspress/shared/node-utils";
10
- import "rspack-plugin-virtual-module";
11
10
  import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
12
11
  import * as __WEBPACK_EXTERNAL_MODULE_enhanced_resolve_bf4706da__ from "enhanced-resolve";
13
12
  import * as __WEBPACK_EXTERNAL_MODULE_node_os_74b4b876__ from "node:os";
@@ -29,10 +28,12 @@ const importStatementRegex = /import\s+(.*?)\s+from\s+(['"])(.*?)(?:"|');?/gm;
29
28
  }`.replace(/\n/g, ';').replace(/\s{2,}/g, '');
30
29
  const dirname = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].dirname((0, __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__.fileURLToPath)(new URL(import.meta.url)));
31
30
  const PACKAGE_ROOT = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(dirname, '..');
32
- __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(PACKAGE_ROOT, 'dist', 'runtime', 'clientEntry.js');
33
- __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(PACKAGE_ROOT, 'dist', 'runtime', 'ssrEntry.js');
31
+ __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(PACKAGE_ROOT, 'index.html');
32
+ __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(PACKAGE_ROOT, 'dist', 'runtime', 'csrClientEntry.js');
33
+ __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(PACKAGE_ROOT, 'dist', 'runtime', 'ssrClientEntry.js');
34
+ __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(PACKAGE_ROOT, 'dist', 'runtime', 'ssrServerEntry.js');
34
35
  const TEMP_DIR = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(process.cwd(), 'node_modules', __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.RSPRESS_TEMP_DIR);
35
- var runtimeModule_RuntimeModuleID = /*#__PURE__*/ function(RuntimeModuleID) {
36
+ var types_RuntimeModuleID = /*#__PURE__*/ function(RuntimeModuleID) {
36
37
  RuntimeModuleID["GlobalStyles"] = "virtual-global-styles";
37
38
  RuntimeModuleID["GlobalComponents"] = "virtual-global-components";
38
39
  RuntimeModuleID["RouteForClient"] = "virtual-routes";
@@ -101,7 +102,7 @@ async function flattenMdxContent(content, basePath, alias) {
101
102
  }
102
103
  const importNodes = ast.children.filter((node)=>'mdxjsEsm' === node.type).flatMap((node)=>{
103
104
  var _node_data_estree, _node_data;
104
- return (null === (_node_data = node.data) || void 0 === _node_data ? void 0 : null === (_node_data_estree = _node_data.estree) || void 0 === _node_data_estree ? void 0 : _node_data_estree.body) || [];
105
+ return (null == (_node_data = node.data) ? void 0 : null == (_node_data_estree = _node_data.estree) ? void 0 : _node_data_estree.body) || [];
105
106
  }).filter((node)=>'ImportDeclaration' === node.type);
106
107
  for (const importNode of importNodes){
107
108
  const id = importNode.specifiers[0].local.name;
@@ -143,11 +144,11 @@ function normalizePath(id) {
143
144
  const rehypePluginCodeMeta = ()=>(tree)=>{
144
145
  (0, __WEBPACK_EXTERNAL_MODULE_unist_util_visit_555e002a__.visit)(tree, 'element', (node)=>{
145
146
  var _node_children_;
146
- if ('pre' === node.tagName && (null === (_node_children_ = node.children[0]) || void 0 === _node_children_ ? void 0 : _node_children_.type) === 'element' && 'code' === node.children[0].tagName) {
147
+ if ('pre' === node.tagName && (null == (_node_children_ = node.children[0]) ? void 0 : _node_children_.type) === 'element' && 'code' === node.children[0].tagName) {
147
148
  var _codeNode_data;
148
149
  const codeNode = node.children[0];
149
150
  codeNode.properties ??= {};
150
- codeNode.properties.meta = null === (_codeNode_data = codeNode.data) || void 0 === _codeNode_data ? void 0 : _codeNode_data.meta;
151
+ codeNode.properties.meta = null == (_codeNode_data = codeNode.data) ? void 0 : _codeNode_data.meta;
151
152
  }
152
153
  });
153
154
  };
@@ -157,7 +158,7 @@ const rehypeHeaderAnchor = ()=>{
157
158
  (0, __WEBPACK_EXTERNAL_MODULE_unist_util_visit_555e002a__.visit)(tree, 'element', (node)=>{
158
159
  var _node_properties;
159
160
  if (!(0, __WEBPACK_EXTERNAL_MODULE_hast_util_heading_rank_cff646ba__.headingRank)(node)) return;
160
- if (!(null === (_node_properties = node.properties) || void 0 === _node_properties ? void 0 : _node_properties.id)) {
161
+ if (!(null == (_node_properties = node.properties) ? void 0 : _node_properties.id)) {
161
162
  const [text, customId] = collectHeaderText(node);
162
163
  node.properties ??= {};
163
164
  node.properties.id = customId || slugger.slug(text);
@@ -261,7 +262,7 @@ const remarkCheckDeadLinks = (checkLink)=>{
261
262
  if (internalLinks.has(url)) return;
262
263
  if (!url.startsWith('http://') && !url.startsWith('https://')) {
263
264
  var _url_split_join;
264
- const { routePath: normalizeUrl } = routeService.normalizeRoutePath(null === (_url_split_join = url.split(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].sep).join('/')) || void 0 === _url_split_join ? void 0 : _url_split_join.split('#')[0]);
265
+ const { routePath: normalizeUrl } = routeService.normalizeRoutePath(null == (_url_split_join = url.split(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].sep).join('/')) ? void 0 : _url_split_join.split('#')[0]);
265
266
  internalLinks.add(normalizeUrl);
266
267
  }
267
268
  });
@@ -367,19 +368,19 @@ const parseToc = (tree)=>{
367
368
  const text = node.children.map((child)=>{
368
369
  if ('link' === child.type) {
369
370
  var _child_children;
370
- return null === (_child_children = child.children) || void 0 === _child_children ? void 0 : _child_children.map((item)=>item.value).join('');
371
+ return null == (_child_children = child.children) ? void 0 : _child_children.map((item)=>item.value).join('');
371
372
  }
372
373
  if ('strong' === child.type) {
373
374
  var _child_children1;
374
- return `**${null === (_child_children1 = child.children) || void 0 === _child_children1 ? void 0 : _child_children1.map((item)=>item.value).join('')}**`;
375
+ return `**${null == (_child_children1 = child.children) ? void 0 : _child_children1.map((item)=>item.value).join('')}**`;
375
376
  }
376
377
  if ('emphasis' === child.type) {
377
378
  var _child_children2;
378
- return `*${null === (_child_children2 = child.children) || void 0 === _child_children2 ? void 0 : _child_children2.map((item)=>item.value).join('')}*`;
379
+ return `*${null == (_child_children2 = child.children) ? void 0 : _child_children2.map((item)=>item.value).join('')}*`;
379
380
  }
380
381
  if ('delete' === child.type) {
381
382
  var _child_children3;
382
- return `~~${null === (_child_children3 = child.children) || void 0 === _child_children3 ? void 0 : _child_children3.map((item)=>item.value).join('')}~~`;
383
+ return `~~${null == (_child_children3 = child.children) ? void 0 : _child_children3.map((item)=>item.value).join('')}~~`;
383
384
  }
384
385
  if ('text' === child.type) {
385
386
  const [textPart, idPart] = (0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_node_utils_78947ce6__.extractTextAndId)(child.value);
@@ -417,21 +418,21 @@ const remarkPluginToc = function() {
417
418
  };
418
419
  async function createMDXOptions(docDirectory, config, checkDeadLinks, routeService, filepath, pluginDriver) {
419
420
  var _config_route;
420
- const cleanUrls = (null == config ? void 0 : null === (_config_route = config.route) || void 0 === _config_route ? void 0 : _config_route.cleanUrls) ?? false;
421
+ const cleanUrls = (null == config ? void 0 : null == (_config_route = config.route) ? void 0 : _config_route.cleanUrls) ?? false;
421
422
  const { remarkPlugins: remarkPluginsFromConfig = [], rehypePlugins: rehypePluginsFromConfig = [], globalComponents: globalComponentsFromConfig = [] } = (null == config ? void 0 : config.markdown) || {};
422
423
  const rspressPlugins = pluginDriver.getPlugins();
423
424
  const remarkPluginsFromPlugins = rspressPlugins.flatMap((plugin)=>{
424
425
  var _plugin_markdown;
425
- return (null === (_plugin_markdown = plugin.markdown) || void 0 === _plugin_markdown ? void 0 : _plugin_markdown.remarkPlugins) || [];
426
+ return (null == (_plugin_markdown = plugin.markdown) ? void 0 : _plugin_markdown.remarkPlugins) || [];
426
427
  });
427
428
  const rehypePluginsFromPlugins = rspressPlugins.flatMap((plugin)=>{
428
429
  var _plugin_markdown;
429
- return (null === (_plugin_markdown = plugin.markdown) || void 0 === _plugin_markdown ? void 0 : _plugin_markdown.rehypePlugins) || [];
430
+ return (null == (_plugin_markdown = plugin.markdown) ? void 0 : _plugin_markdown.rehypePlugins) || [];
430
431
  });
431
432
  const globalComponents = [
432
433
  ...rspressPlugins.flatMap((plugin)=>{
433
434
  var _plugin_markdown;
434
- return (null === (_plugin_markdown = plugin.markdown) || void 0 === _plugin_markdown ? void 0 : _plugin_markdown.globalComponents) || [];
435
+ return (null == (_plugin_markdown = plugin.markdown) ? void 0 : _plugin_markdown.globalComponents) || [];
435
436
  }),
436
437
  ...globalComponentsFromConfig
437
438
  ];
@@ -482,7 +483,7 @@ async function createMDXOptions(docDirectory, config, checkDeadLinks, routeServi
482
483
  };
483
484
  }
484
485
  async function updateSiteDataRuntimeModule(modulePath, pageMeta) {
485
- const siteDataModulePath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(TEMP_DIR, 'runtime', `${runtimeModule_RuntimeModuleID.SiteData}.mjs`);
486
+ const siteDataModulePath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(TEMP_DIR, 'runtime', `${types_RuntimeModuleID.SiteData}.mjs`);
486
487
  const { default: siteData } = await import((0, __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__.pathToFileURL)(siteDataModulePath).href);
487
488
  await __WEBPACK_EXTERNAL_MODULE_node_fs_promises_153e37e0__["default"].writeFile(siteDataModulePath, `export default ${JSON.stringify({
488
489
  ...siteData,
@@ -521,7 +522,7 @@ async function mdxLoader(source) {
521
522
  const replacedContent = applyReplaceRules(flattenContent, config.replaceRules);
522
523
  const preprocessedContent = escapeMarkdownHeadingIds(replacedContent);
523
524
  let enableMdxRs;
524
- const mdxRs = (null == config ? void 0 : null === (_config_markdown = config.markdown) || void 0 === _config_markdown ? void 0 : _config_markdown.mdxRs) ?? true;
525
+ const mdxRs = (null == config ? void 0 : null == (_config_markdown = config.markdown) ? void 0 : _config_markdown.mdxRs) ?? true;
525
526
  enableMdxRs = 'object' == typeof mdxRs ? 'function' == typeof (null == mdxRs ? void 0 : mdxRs.include) ? mdxRs.include(filepath) : true : mdxRs;
526
527
  try {
527
528
  let compileResult;
@@ -8,11 +8,7 @@ import "virtual-global-styles";
8
8
  import * as __WEBPACK_EXTERNAL_MODULE__initPageData_js_731596b5__ from "./initPageData.js";
9
9
  function App({ helmetContext }) {
10
10
  const { setData: setPageData, data } = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.DataContext);
11
- const frontmatter = data.page.frontmatter || {};
12
11
  const { pathname, search } = (0, __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.useLocation)();
13
- const query = new URLSearchParams(search);
14
- const GLOBAL_COMPONENTS_KEY = 'globalUIComponents';
15
- const hideGlobalUIComponents = false === frontmatter[GLOBAL_COMPONENTS_KEY] || "0" === query.get(GLOBAL_COMPONENTS_KEY);
16
12
  (0, __WEBPACK_EXTERNAL_MODULE_react__.useLayoutEffect)(()=>{
17
13
  async function refetchData() {
18
14
  try {
@@ -27,6 +23,11 @@ function App({ helmetContext }) {
27
23
  pathname,
28
24
  setPageData
29
25
  ]);
26
+ if (!data) return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {});
27
+ const frontmatter = data.page.frontmatter || {};
28
+ const GLOBAL_COMPONENTS_KEY = 'globalUIComponents';
29
+ const query = new URLSearchParams(search);
30
+ const hideGlobalUIComponents = false === frontmatter[GLOBAL_COMPONENTS_KEY] || "0" === query.get(GLOBAL_COMPONENTS_KEY);
30
31
  return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(__WEBPACK_EXTERNAL_MODULE_react_helmet_async_048d06c6__.HelmetProvider, {
31
32
  context: helmetContext,
32
33
  children: [
@@ -1 +1,4 @@
1
- export declare function ClientApp(): import("react/jsx-runtime").JSX.Element;
1
+ import type { PageData } from '@rspress/shared';
2
+ export declare function ClientApp({ initialPageData, }: {
3
+ initialPageData?: PageData;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -3,34 +3,25 @@ import * as __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__ from "@rspress
3
3
  import * as __WEBPACK_EXTERNAL_MODULE__theme_75e53063__ from "@theme";
4
4
  import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
5
5
  import * as __WEBPACK_EXTERNAL_MODULE__App_js_3638e61b__ from "./App.js";
6
- import * as __WEBPACK_EXTERNAL_MODULE__initPageData_js_731596b5__ from "./initPageData.js";
7
- function ClientApp() {
8
- const [data, setData] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(null);
6
+ function ClientApp({ initialPageData = null }) {
7
+ const [data, setData] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(initialPageData);
9
8
  const [theme, setTheme] = (0, __WEBPACK_EXTERNAL_MODULE__theme_75e53063__.useThemeState)();
10
- (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
11
- (0, __WEBPACK_EXTERNAL_MODULE__initPageData_js_731596b5__.initPageData)(window.location.pathname).then((pageData)=>{
12
- setData(pageData);
13
- });
14
- }, []);
15
- const themeValue = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>({
9
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.ThemeContext.Provider, {
10
+ value: (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>({
11
+ theme,
12
+ setTheme
13
+ }), [
16
14
  theme,
17
15
  setTheme
18
- }), [
19
- theme,
20
- setTheme
21
- ]);
22
- const dataValue = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>({
23
- data,
24
- setData
25
- }), [
26
- data,
27
- setData
28
- ]);
29
- if (!data) return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {});
30
- return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.ThemeContext.Provider, {
31
- value: themeValue,
16
+ ]),
32
17
  children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.DataContext.Provider, {
33
- value: dataValue,
18
+ value: (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>({
19
+ data,
20
+ setData
21
+ }), [
22
+ data,
23
+ setData
24
+ ]),
34
25
  children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.BrowserRouter, {
35
26
  children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__App_js_3638e61b__.App, {})
36
27
  })
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
2
+ import * as __WEBPACK_EXTERNAL_MODULE__ClientApp_js_4935dbba__ from "./ClientApp.js";
3
+ async function renderInBrowser() {
4
+ const container = document.getElementById('root');
5
+ if (process.env.__REACT_GTE_18__) {
6
+ const { createRoot } = await import("react-dom/client");
7
+ createRoot(container).render(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__ClientApp_js_4935dbba__.ClientApp, {}));
8
+ } else {
9
+ const ReactDOM = await import("react-dom");
10
+ ReactDOM.render(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__ClientApp_js_4935dbba__.ClientApp, {}), container);
11
+ }
12
+ }
13
+ renderInBrowser();
@@ -12,7 +12,7 @@ async function initPageData(routePath) {
12
12
  const normalize = (p)=>p.replace(/\/$/, '').toLowerCase();
13
13
  const extractPageInfo = __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"].pages.find((page)=>(0, __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.isEqualPath)(normalize(page.routePath), normalize(matchedRoute.path)));
14
14
  const encodedPagePath = encodeURIComponent(pagePath);
15
- const meta = (null === (_mod_default___RSPRESS_PAGE_META = mod.default.__RSPRESS_PAGE_META) || void 0 === _mod_default___RSPRESS_PAGE_META ? void 0 : _mod_default___RSPRESS_PAGE_META[encodedPagePath]) || {};
15
+ const meta = (null == (_mod_default___RSPRESS_PAGE_META = mod.default.__RSPRESS_PAGE_META) ? void 0 : _mod_default___RSPRESS_PAGE_META[encodedPagePath]) || {};
16
16
  const { toc = [], title = '', frontmatter = {}, ...rest } = __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.MDX_OR_MD_REGEXP.test(matchedRoute.filePath) ? meta : mod;
17
17
  return {
18
18
  siteData: __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"],
@@ -28,7 +28,7 @@ async function initPageData(routePath) {
28
28
  };
29
29
  }
30
30
  let lang = __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"].lang || '';
31
- let version = (null === (_siteData_multiVersion = __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"].multiVersion) || void 0 === _siteData_multiVersion ? void 0 : _siteData_multiVersion.default) || '';
31
+ let version = (null == (_siteData_multiVersion = __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"].multiVersion) ? void 0 : _siteData_multiVersion.default) || '';
32
32
  if (__WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"].lang && 'undefined' != typeof window) {
33
33
  const path = location.pathname.replace(__WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"].base, '').split('/').slice(0, 2);
34
34
  if (__WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"].locales.length) {
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
2
+ import * as __WEBPACK_EXTERNAL_MODULE__ClientApp_js_4935dbba__ from "./ClientApp.js";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__initPageData_js_731596b5__ from "./initPageData.js";
4
+ async function renderInBrowser() {
5
+ const container = document.getElementById('root');
6
+ const initialPageData = await (0, __WEBPACK_EXTERNAL_MODULE__initPageData_js_731596b5__.initPageData)(window.location.pathname);
7
+ if (process.env.__REACT_GTE_18__) {
8
+ const { hydrateRoot } = await import("react-dom/client");
9
+ hydrateRoot(container, /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__ClientApp_js_4935dbba__.ClientApp, {
10
+ initialPageData: initialPageData
11
+ }));
12
+ } else {
13
+ const ReactDOM = await import("react-dom");
14
+ ReactDOM.hydrate(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__ClientApp_js_4935dbba__.ClientApp, {
15
+ initialPageData: initialPageData
16
+ }), container);
17
+ }
18
+ }
19
+ renderInBrowser();
@@ -1,4 +1,4 @@
1
- var tsconfig_rslib_entry_namespaceObject = JSON.parse('{"compilerOptions":{"rootDir":".","baseUrl":".","skipLibCheck":true,"jsx":"react-jsx","esModuleInterop":true},"include":["./**/*"]}');
2
- var __webpack_exports__compilerOptions = tsconfig_rslib_entry_namespaceObject.compilerOptions;
3
- var __webpack_exports__include = tsconfig_rslib_entry_namespaceObject.include;
1
+ var tsconfig_namespaceObject = JSON.parse('{"compilerOptions":{"rootDir":".","baseUrl":".","skipLibCheck":true,"jsx":"react-jsx","esModuleInterop":true},"include":["./**/*"]}');
2
+ var __webpack_exports__compilerOptions = tsconfig_namespaceObject.compilerOptions;
3
+ var __webpack_exports__include = tsconfig_namespaceObject.include;
4
4
  export { __webpack_exports__compilerOptions as compilerOptions, __webpack_exports__include as include };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/core",
3
- "version": "2.0.0-alpha.9",
3
+ "version": "2.0.0-beta.0",
4
4
  "description": "The Rspress Documentation Framework",
5
5
  "bugs": "https://github.com/web-infra-dev/rspress/issues",
6
6
  "repository": {
@@ -45,7 +45,7 @@
45
45
  "@mdx-js/loader": "^3.1.0",
46
46
  "@mdx-js/mdx": "^3.1.0",
47
47
  "@mdx-js/react": "^3.1.0",
48
- "@rsbuild/core": "1.3.4",
48
+ "@rsbuild/core": "1.3.9",
49
49
  "@rsbuild/plugin-react": "~1.1.1",
50
50
  "@rspress/mdx-rs": "0.6.6",
51
51
  "enhanced-resolve": "5.18.1",
@@ -57,8 +57,8 @@
57
57
  "lodash-es": "^4.17.21",
58
58
  "mdast-util-mdxjs-esm": "^2.0.1",
59
59
  "picocolors": "^1.1.1",
60
- "react": "^18.3.1",
61
- "react-dom": "^18.3.1",
60
+ "react": "^19.1.0",
61
+ "react-dom": "^19.1.0",
62
62
  "react-helmet-async": "^2.0.5",
63
63
  "react-lazy-with-preload": "^2.2.1",
64
64
  "react-syntax-highlighter": "^15.6.1",
@@ -66,21 +66,21 @@
66
66
  "remark": "^15.0.1",
67
67
  "remark-gfm": "^4.0.1",
68
68
  "rspack-plugin-virtual-module": "0.1.13",
69
- "tinyglobby": "^0.2.12",
69
+ "tinyglobby": "^0.2.13",
70
70
  "unified": "^11.0.5",
71
71
  "unist-util-visit": "^5.0.0",
72
72
  "unist-util-visit-children": "^3.0.0",
73
- "@rspress/plugin-auto-nav-sidebar": "2.0.0-alpha.9",
74
- "@rspress/plugin-container-syntax": "2.0.0-alpha.9",
75
- "@rspress/plugin-last-updated": "2.0.0-alpha.9",
76
- "@rspress/runtime": "2.0.0-alpha.9",
77
- "@rspress/plugin-medium-zoom": "2.0.0-alpha.9",
78
- "@rspress/shared": "2.0.0-alpha.9",
79
- "@rspress/theme-default": "2.0.0-alpha.9"
73
+ "@rspress/plugin-auto-nav-sidebar": "2.0.0-beta.0",
74
+ "@rspress/plugin-last-updated": "2.0.0-beta.0",
75
+ "@rspress/plugin-container-syntax": "2.0.0-beta.0",
76
+ "@rspress/plugin-medium-zoom": "2.0.0-beta.0",
77
+ "@rspress/shared": "2.0.0-beta.0",
78
+ "@rspress/runtime": "2.0.0-beta.0",
79
+ "@rspress/theme-default": "2.0.0-beta.0"
80
80
  },
81
81
  "devDependencies": {
82
- "@microsoft/api-extractor": "^7.52.3",
83
- "@rslib/core": "0.6.1",
82
+ "@microsoft/api-extractor": "^7.52.4",
83
+ "@rslib/core": "0.6.5",
84
84
  "@rspress-dev/plugin-preview": "link:../plugin-preview",
85
85
  "@types/hast": "^3.0.4",
86
86
  "@types/html-to-text": "^9.0.4",
@@ -1 +0,0 @@
1
- export declare function renderInBrowser(): Promise<void>;
@@ -1,39 +0,0 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_react_dom_7136dc57__ from "react-dom";
2
- import * as __WEBPACK_EXTERNAL_MODULE_react_dom_client_76b1397c__ from "react-dom/client";
3
- import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
4
- import * as __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__ from "@rspress/shared";
5
- import * as __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__ from "virtual-site-data";
6
- import * as __WEBPACK_EXTERNAL_MODULE__ClientApp_js_4935dbba__ from "./ClientApp.js";
7
- var __webpack_modules__ = {
8
- "react-dom": function(module) {
9
- module.exports = __WEBPACK_EXTERNAL_MODULE_react_dom_7136dc57__;
10
- },
11
- "react-dom/client": function(module) {
12
- module.exports = __WEBPACK_EXTERNAL_MODULE_react_dom_client_76b1397c__;
13
- }
14
- };
15
- var __webpack_module_cache__ = {};
16
- function __webpack_require__(moduleId) {
17
- var cachedModule = __webpack_module_cache__[moduleId];
18
- if (void 0 !== cachedModule) return cachedModule.exports;
19
- var module = __webpack_module_cache__[moduleId] = {
20
- exports: {}
21
- };
22
- __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
23
- return module.exports;
24
- }
25
- const enableSSG = __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"].ssg;
26
- async function renderInBrowser() {
27
- const container = document.getElementById('root');
28
- if (process.env.__REACT_GTE_18__) {
29
- const { createRoot, hydrateRoot } = __webpack_require__("react-dom/client");
30
- if ((0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.isProduction)() && enableSSG) hydrateRoot(container, /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__ClientApp_js_4935dbba__.ClientApp, {}));
31
- else createRoot(container).render(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__ClientApp_js_4935dbba__.ClientApp, {}));
32
- } else {
33
- const ReactDOM = __webpack_require__("react-dom");
34
- if ((0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.isProduction)()) ReactDOM.hydrate(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__ClientApp_js_4935dbba__.ClientApp, {}), container);
35
- else ReactDOM.render(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__ClientApp_js_4935dbba__.ClientApp, {}), container);
36
- }
37
- }
38
- renderInBrowser();
39
- export { renderInBrowser };
File without changes