@docusaurus/core 0.0.0-4526 → 0.0.0-4535
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/lib/client/clientEntry.js +6 -3
- package/lib/client/exports/Head.js +1 -1
- package/lib/client/serverEntry.js +10 -7
- package/package.json +23 -25
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { hydrate, render } from 'react-dom';
|
|
9
9
|
import { BrowserRouter } from 'react-router-dom';
|
|
10
|
+
import { HelmetProvider } from 'react-helmet-async';
|
|
10
11
|
import routes from '@generated/routes';
|
|
11
12
|
import ExecutionEnvironment from './exports/ExecutionEnvironment';
|
|
12
13
|
import App from './App';
|
|
@@ -22,9 +23,11 @@ if (ExecutionEnvironment.canUseDOM) {
|
|
|
22
23
|
// We also preload async component to avoid first-load loading screen.
|
|
23
24
|
const renderMethod = process.env.NODE_ENV === 'production' ? hydrate : render;
|
|
24
25
|
preload(routes, window.location.pathname).then(() => {
|
|
25
|
-
renderMethod(<
|
|
26
|
-
<
|
|
27
|
-
|
|
26
|
+
renderMethod(<HelmetProvider>
|
|
27
|
+
<BrowserRouter>
|
|
28
|
+
<App />
|
|
29
|
+
</BrowserRouter>
|
|
30
|
+
</HelmetProvider>, document.getElementById('__docusaurus'));
|
|
28
31
|
});
|
|
29
32
|
// Webpack Hot Module Replacement API
|
|
30
33
|
if (module.hot) {
|
|
@@ -8,7 +8,7 @@ import * as eta from 'eta';
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { StaticRouter } from 'react-router-dom';
|
|
10
10
|
import ReactDOMServer from 'react-dom/server';
|
|
11
|
-
import {
|
|
11
|
+
import { HelmetProvider } from 'react-helmet-async';
|
|
12
12
|
import { getBundles } from 'react-loadable-ssr-addon-v5-slorber';
|
|
13
13
|
import Loadable from 'react-loadable';
|
|
14
14
|
import { minify } from 'html-minifier-terser';
|
|
@@ -53,16 +53,19 @@ async function doRender(locals) {
|
|
|
53
53
|
await preload(routes, location);
|
|
54
54
|
const modules = new Set();
|
|
55
55
|
const context = {};
|
|
56
|
+
const helmetContext = {};
|
|
56
57
|
const linksCollector = createStatefulLinksCollector();
|
|
57
58
|
const appHtml = ReactDOMServer.renderToString(<Loadable.Capture report={(moduleName) => modules.add(moduleName)}>
|
|
58
|
-
<
|
|
59
|
-
<
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
<HelmetProvider context={helmetContext}>
|
|
60
|
+
<StaticRouter location={location} context={context}>
|
|
61
|
+
<ProvideLinksCollector linksCollector={linksCollector}>
|
|
62
|
+
<App />
|
|
63
|
+
</ProvideLinksCollector>
|
|
64
|
+
</StaticRouter>
|
|
65
|
+
</HelmetProvider>
|
|
63
66
|
</Loadable.Capture>);
|
|
64
67
|
onLinksCollected(location, linksCollector.getCollectedLinks());
|
|
65
|
-
const helmet =
|
|
68
|
+
const { helmet } = helmetContext;
|
|
66
69
|
const htmlAttributes = helmet.htmlAttributes.toString();
|
|
67
70
|
const bodyAttributes = helmet.bodyAttributes.toString();
|
|
68
71
|
const metaStrings = [
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/core",
|
|
3
3
|
"description": "Easy to Maintain Open Source Documentation Websites",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-4535",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -34,34 +34,34 @@
|
|
|
34
34
|
"@babel/core": "^7.16.0",
|
|
35
35
|
"@babel/generator": "^7.16.0",
|
|
36
36
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
37
|
-
"@babel/plugin-transform-runtime": "^7.16.
|
|
38
|
-
"@babel/preset-env": "^7.16.
|
|
37
|
+
"@babel/plugin-transform-runtime": "^7.16.10",
|
|
38
|
+
"@babel/preset-env": "^7.16.11",
|
|
39
39
|
"@babel/preset-react": "^7.16.0",
|
|
40
40
|
"@babel/preset-typescript": "^7.16.0",
|
|
41
41
|
"@babel/runtime": "^7.16.3",
|
|
42
42
|
"@babel/runtime-corejs3": "^7.16.3",
|
|
43
43
|
"@babel/traverse": "^7.16.3",
|
|
44
|
-
"@docusaurus/cssnano-preset": "0.0.0-
|
|
45
|
-
"@docusaurus/logger": "0.0.0-
|
|
46
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
44
|
+
"@docusaurus/cssnano-preset": "0.0.0-4535",
|
|
45
|
+
"@docusaurus/logger": "0.0.0-4535",
|
|
46
|
+
"@docusaurus/mdx-loader": "0.0.0-4535",
|
|
47
47
|
"@docusaurus/react-loadable": "5.5.2",
|
|
48
|
-
"@docusaurus/utils": "0.0.0-
|
|
49
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
50
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
48
|
+
"@docusaurus/utils": "0.0.0-4535",
|
|
49
|
+
"@docusaurus/utils-common": "0.0.0-4535",
|
|
50
|
+
"@docusaurus/utils-validation": "0.0.0-4535",
|
|
51
51
|
"@slorber/static-site-generator-webpack-plugin": "^4.0.0",
|
|
52
52
|
"@svgr/webpack": "^6.0.0",
|
|
53
53
|
"autoprefixer": "^10.3.5",
|
|
54
54
|
"babel-loader": "^8.2.2",
|
|
55
55
|
"babel-plugin-dynamic-import-node": "2.3.0",
|
|
56
56
|
"boxen": "^5.0.1",
|
|
57
|
-
"chokidar": "^3.5.
|
|
58
|
-
"clean-css": "^5.
|
|
57
|
+
"chokidar": "^3.5.3",
|
|
58
|
+
"clean-css": "^5.2.4",
|
|
59
59
|
"commander": "^5.1.0",
|
|
60
|
-
"copy-webpack-plugin": "^10.2.
|
|
61
|
-
"core-js": "^3.
|
|
60
|
+
"copy-webpack-plugin": "^10.2.4",
|
|
61
|
+
"core-js": "^3.21.0",
|
|
62
62
|
"css-loader": "^6.5.1",
|
|
63
|
-
"css-minimizer-webpack-plugin": "^3.
|
|
64
|
-
"cssnano": "^5.0.
|
|
63
|
+
"css-minimizer-webpack-plugin": "^3.4.1",
|
|
64
|
+
"cssnano": "^5.0.16",
|
|
65
65
|
"del": "^6.0.0",
|
|
66
66
|
"detect-port": "^1.3.0",
|
|
67
67
|
"escape-html": "^1.0.3",
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
"is-root": "^2.1.0",
|
|
76
76
|
"leven": "^3.1.0",
|
|
77
77
|
"lodash": "^4.17.20",
|
|
78
|
-
"mini-css-extract-plugin": "^
|
|
78
|
+
"mini-css-extract-plugin": "^2.5.3",
|
|
79
79
|
"nprogress": "^0.2.0",
|
|
80
80
|
"postcss": "^8.3.7",
|
|
81
81
|
"postcss-loader": "^6.1.1",
|
|
82
82
|
"prompts": "^2.4.1",
|
|
83
83
|
"react-dev-utils": "^12.0.0",
|
|
84
|
-
"react-helmet": "^
|
|
84
|
+
"react-helmet-async": "^1.2.2",
|
|
85
85
|
"react-loadable": "npm:@docusaurus/react-loadable@5.5.2",
|
|
86
86
|
"react-loadable-ssr-addon-v5-slorber": "^1.0.1",
|
|
87
87
|
"react-router": "^5.2.0",
|
|
@@ -92,27 +92,25 @@
|
|
|
92
92
|
"semver": "^7.3.4",
|
|
93
93
|
"serve-handler": "^6.1.3",
|
|
94
94
|
"shelljs": "^0.8.4",
|
|
95
|
-
"strip-ansi": "^6.0.0",
|
|
96
95
|
"terser-webpack-plugin": "^5.2.4",
|
|
97
96
|
"tslib": "^2.3.1",
|
|
98
97
|
"update-notifier": "^5.1.0",
|
|
99
98
|
"url-loader": "^4.1.1",
|
|
100
99
|
"wait-on": "^6.0.0",
|
|
101
|
-
"webpack": "^5.
|
|
100
|
+
"webpack": "^5.68.0",
|
|
102
101
|
"webpack-bundle-analyzer": "^4.4.2",
|
|
103
102
|
"webpack-dev-server": "^4.7.1",
|
|
104
103
|
"webpack-merge": "^5.8.0",
|
|
105
104
|
"webpackbar": "^5.0.2"
|
|
106
105
|
},
|
|
107
106
|
"devDependencies": {
|
|
108
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
109
|
-
"@docusaurus/types": "0.0.0-
|
|
110
|
-
"@types/copy-webpack-plugin": "^
|
|
107
|
+
"@docusaurus/module-type-aliases": "0.0.0-4535",
|
|
108
|
+
"@docusaurus/types": "0.0.0-4535",
|
|
109
|
+
"@types/copy-webpack-plugin": "^10.1.0",
|
|
111
110
|
"@types/detect-port": "^1.3.0",
|
|
112
|
-
"@types/mini-css-extract-plugin": "^
|
|
111
|
+
"@types/mini-css-extract-plugin": "^2.5.1",
|
|
113
112
|
"@types/nprogress": "^0.2.0",
|
|
114
113
|
"@types/react-dom": "^17.0.9",
|
|
115
|
-
"@types/react-helmet": "^6.0.0",
|
|
116
114
|
"@types/react-router-config": "^5.0.1",
|
|
117
115
|
"@types/rtl-detect": "^1.0.0",
|
|
118
116
|
"@types/serve-handler": "^6.1.1",
|
|
@@ -129,5 +127,5 @@
|
|
|
129
127
|
"engines": {
|
|
130
128
|
"node": ">=14"
|
|
131
129
|
},
|
|
132
|
-
"gitHead": "
|
|
130
|
+
"gitHead": "0b364b0c7b89c1c7cfd77d8d5155efd8247251ef"
|
|
133
131
|
}
|