@rspress/core 2.0.0-beta.0 → 2.0.0-beta.10
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/README.md +1 -1
- package/dist/index.d.ts +153 -0
- package/dist/index.js +386 -436
- package/dist/loader.d.ts +2 -5
- package/dist/loader.js +93 -269
- package/dist/runtime/App.d.ts +1 -4
- package/dist/runtime/App.js +3 -6
- package/dist/runtime/ClientApp.js +6 -1
- package/dist/runtime/csrClientEntry.js +3 -11
- package/dist/runtime/initPageData.d.ts +0 -1
- package/dist/runtime/initPageData.js +3 -6
- package/dist/runtime/ssrClientEntry.js +4 -11
- package/dist/runtime/ssrServerEntry.d.ts +3 -2
- package/dist/runtime/ssrServerEntry.js +7 -5
- package/package.json +28 -25
- package/dist/runtime/tsconfig.js +0 -4
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_dom_client_76b1397c__ from "react-dom/client";
|
|
2
3
|
import * as __WEBPACK_EXTERNAL_MODULE__ClientApp_js_4935dbba__ from "./ClientApp.js";
|
|
3
4
|
import * as __WEBPACK_EXTERNAL_MODULE__initPageData_js_731596b5__ from "./initPageData.js";
|
|
4
5
|
async function renderInBrowser() {
|
|
5
6
|
const container = document.getElementById('root');
|
|
6
7
|
const initialPageData = await (0, __WEBPACK_EXTERNAL_MODULE__initPageData_js_731596b5__.initPageData)(window.location.pathname);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
}
|
|
8
|
+
(0, __WEBPACK_EXTERNAL_MODULE_react_dom_client_76b1397c__.hydrateRoot)(container, /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__ClientApp_js_4935dbba__.ClientApp, {
|
|
9
|
+
initialPageData: initialPageData
|
|
10
|
+
}));
|
|
18
11
|
}
|
|
19
12
|
renderInBrowser();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { PageData } from '@rspress/shared';
|
|
2
|
-
|
|
2
|
+
import { type Unhead } from '@unhead/react/server';
|
|
3
|
+
export declare function render(pagePath: string, head: Unhead): Promise<{
|
|
3
4
|
appHtml: string;
|
|
4
5
|
pageData: PageData;
|
|
5
6
|
}>;
|
|
6
|
-
export { routes } from 'virtual-routes
|
|
7
|
+
export { routes } from 'virtual-routes';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__ from "@rspress/runtime";
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE__rspress_runtime_server_673c713a__ from "@rspress/runtime/server";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__unhead_react_server_7e85c952__ from "@unhead/react/server";
|
|
4
5
|
import * as __WEBPACK_EXTERNAL_MODULE_react_dom_server_98c38d5c__ from "react-dom/server";
|
|
5
6
|
import * as __WEBPACK_EXTERNAL_MODULE__App_js_3638e61b__ from "./App.js";
|
|
6
7
|
import * as __WEBPACK_EXTERNAL_MODULE__initPageData_js_731596b5__ from "./initPageData.js";
|
|
7
|
-
import * as
|
|
8
|
+
import * as __WEBPACK_EXTERNAL_MODULE_virtual_routes_98776429__ from "virtual-routes";
|
|
8
9
|
const DEFAULT_THEME = 'light';
|
|
9
|
-
async function render(pagePath,
|
|
10
|
+
async function render(pagePath, head) {
|
|
10
11
|
const initialPageData = await (0, __WEBPACK_EXTERNAL_MODULE__initPageData_js_731596b5__.initPageData)(pagePath);
|
|
11
12
|
const appHtml = (0, __WEBPACK_EXTERNAL_MODULE_react_dom_server_98c38d5c__.renderToString)(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.ThemeContext.Provider, {
|
|
12
13
|
value: {
|
|
@@ -18,8 +19,9 @@ async function render(pagePath, helmetContext) {
|
|
|
18
19
|
},
|
|
19
20
|
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__rspress_runtime_server_673c713a__.StaticRouter, {
|
|
20
21
|
location: pagePath,
|
|
21
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
22
|
-
|
|
22
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__unhead_react_server_7e85c952__.UnheadProvider, {
|
|
23
|
+
value: head,
|
|
24
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__App_js_3638e61b__.App, {})
|
|
23
25
|
})
|
|
24
26
|
})
|
|
25
27
|
})
|
|
@@ -29,5 +31,5 @@ async function render(pagePath, helmetContext) {
|
|
|
29
31
|
pageData: initialPageData
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
|
-
var __webpack_exports__routes =
|
|
34
|
+
var __webpack_exports__routes = __WEBPACK_EXTERNAL_MODULE_virtual_routes_98776429__.routes;
|
|
33
35
|
export { render, __webpack_exports__routes as routes };
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress/core",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.10",
|
|
4
4
|
"description": "The Rspress Documentation Framework",
|
|
5
5
|
"bugs": "https://github.com/web-infra-dev/rspress/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "https://github.com/web-infra-dev/rspress",
|
|
8
|
+
"url": "git+https://github.com/web-infra-dev/rspress.git",
|
|
9
9
|
"directory": "packages/cli/core"
|
|
10
10
|
},
|
|
11
11
|
"license": "MIT",
|
|
@@ -45,52 +45,54 @@
|
|
|
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.
|
|
49
|
-
"@rsbuild/plugin-react": "~1.
|
|
48
|
+
"@rsbuild/core": "~1.3.21",
|
|
49
|
+
"@rsbuild/plugin-react": "~1.3.1",
|
|
50
50
|
"@rspress/mdx-rs": "0.6.6",
|
|
51
|
+
"@types/unist": "^3.0.3",
|
|
52
|
+
"@unhead/react": "^2.0.10",
|
|
51
53
|
"enhanced-resolve": "5.18.1",
|
|
52
54
|
"github-slugger": "^2.0.0",
|
|
53
55
|
"hast-util-from-html": "^2.0.3",
|
|
54
56
|
"hast-util-heading-rank": "^3.0.0",
|
|
55
57
|
"html-to-text": "^9.0.5",
|
|
56
|
-
"htmr": "^1.0.2",
|
|
57
58
|
"lodash-es": "^4.17.21",
|
|
58
59
|
"mdast-util-mdxjs-esm": "^2.0.1",
|
|
59
60
|
"picocolors": "^1.1.1",
|
|
60
61
|
"react": "^19.1.0",
|
|
61
62
|
"react-dom": "^19.1.0",
|
|
62
|
-
"react-helmet-async": "^2.0.5",
|
|
63
63
|
"react-lazy-with-preload": "^2.2.1",
|
|
64
|
-
"react-
|
|
64
|
+
"react-router-dom": "^6.29.0",
|
|
65
65
|
"rehype-external-links": "^3.0.0",
|
|
66
|
+
"rehype-raw": "^7.0.0",
|
|
66
67
|
"remark": "^15.0.1",
|
|
67
68
|
"remark-gfm": "^4.0.1",
|
|
68
|
-
"rspack-plugin-virtual-module": "0.1
|
|
69
|
-
"tinyglobby": "^0.2.
|
|
69
|
+
"rspack-plugin-virtual-module": "1.0.1",
|
|
70
|
+
"tinyglobby": "^0.2.14",
|
|
70
71
|
"unified": "^11.0.5",
|
|
71
72
|
"unist-util-visit": "^5.0.0",
|
|
72
73
|
"unist-util-visit-children": "^3.0.0",
|
|
73
|
-
"@rspress/plugin-
|
|
74
|
-
"@rspress/plugin-last-updated": "2.0.0-beta.
|
|
75
|
-
"@rspress/plugin-
|
|
76
|
-
"@rspress/plugin-
|
|
77
|
-
"@rspress/
|
|
78
|
-
"@rspress/
|
|
79
|
-
"@rspress/
|
|
74
|
+
"@rspress/plugin-container-syntax": "2.0.0-beta.10",
|
|
75
|
+
"@rspress/plugin-last-updated": "2.0.0-beta.10",
|
|
76
|
+
"@rspress/plugin-medium-zoom": "2.0.0-beta.10",
|
|
77
|
+
"@rspress/plugin-shiki": "2.0.0-beta.10",
|
|
78
|
+
"@rspress/runtime": "2.0.0-beta.10",
|
|
79
|
+
"@rspress/theme-default": "2.0.0-beta.10",
|
|
80
|
+
"@rspress/shared": "2.0.0-beta.10",
|
|
81
|
+
"@rspress/plugin-auto-nav-sidebar": "2.0.0-beta.10"
|
|
80
82
|
},
|
|
81
83
|
"devDependencies": {
|
|
82
|
-
"@microsoft/api-extractor": "^7.52.
|
|
83
|
-
"@rslib/core": "0.
|
|
84
|
+
"@microsoft/api-extractor": "^7.52.8",
|
|
85
|
+
"@rslib/core": "0.8.0",
|
|
84
86
|
"@rspress-dev/plugin-preview": "link:../plugin-preview",
|
|
85
87
|
"@types/hast": "^3.0.4",
|
|
86
88
|
"@types/html-to-text": "^9.0.4",
|
|
87
89
|
"@types/jest": "~29.5.14",
|
|
88
90
|
"@types/lodash-es": "^4.17.12",
|
|
89
91
|
"@types/mdast": "^4.0.4",
|
|
90
|
-
"@types/node": "^
|
|
91
|
-
"@types/react": "^18.3.
|
|
92
|
-
"@types/react-dom": "^18.3.
|
|
93
|
-
"memfs": "^4.17.
|
|
92
|
+
"@types/node": "^22.8.1",
|
|
93
|
+
"@types/react": "^18.3.22",
|
|
94
|
+
"@types/react-dom": "^18.3.7",
|
|
95
|
+
"memfs": "^4.17.2",
|
|
94
96
|
"postcss": "8.5.3",
|
|
95
97
|
"rehype-stringify": "^10.0.1",
|
|
96
98
|
"remark-mdx": "^3.1.0",
|
|
@@ -98,14 +100,15 @@
|
|
|
98
100
|
"remark-rehype": "^11.1.2",
|
|
99
101
|
"remark-stringify": "^11.0.0",
|
|
100
102
|
"rimraf": "^6.0.1",
|
|
101
|
-
"rsbuild-plugin-
|
|
103
|
+
"rsbuild-plugin-publint": "^0.3.2",
|
|
104
|
+
"rsbuild-plugin-virtual-module": "0.2.0",
|
|
102
105
|
"tailwindcss": "^3.4.17",
|
|
103
106
|
"typescript": "^5.8.2",
|
|
104
|
-
"vfile": "^
|
|
107
|
+
"vfile": "^6.0.3",
|
|
105
108
|
"@rspress/config": "1.0.0"
|
|
106
109
|
},
|
|
107
110
|
"engines": {
|
|
108
|
-
"node": ">=
|
|
111
|
+
"node": ">=18.0.0"
|
|
109
112
|
},
|
|
110
113
|
"publishConfig": {
|
|
111
114
|
"access": "public",
|
package/dist/runtime/tsconfig.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
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
|
-
export { __webpack_exports__compilerOptions as compilerOptions, __webpack_exports__include as include };
|