@docusaurus/core 0.0.0-4707 → 0.0.0-4710
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.
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React, { useContext
|
|
7
|
+
import React, { useContext } from 'react';
|
|
8
8
|
export const createStatefulLinksCollector = () => {
|
|
9
9
|
// Set to dedup, as it's not useful to collect multiple times the same link
|
|
10
10
|
const allLinks = new Set();
|
|
@@ -15,7 +15,7 @@ export const createStatefulLinksCollector = () => {
|
|
|
15
15
|
getCollectedLinks: () => [...allLinks],
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
const Context = createContext({
|
|
18
|
+
const Context = React.createContext({
|
|
19
19
|
collectLink: () => {
|
|
20
20
|
// noop by default for client
|
|
21
21
|
// we only use the broken links checker server-side
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import
|
|
8
|
+
import ReactDOM from 'react-dom';
|
|
9
9
|
import { BrowserRouter } from 'react-router-dom';
|
|
10
10
|
import { HelmetProvider } from 'react-helmet-async';
|
|
11
11
|
import routes from '@generated/routes';
|
|
@@ -21,7 +21,7 @@ if (ExecutionEnvironment.canUseDOM) {
|
|
|
21
21
|
// first-load experience.
|
|
22
22
|
// For development, there is no existing markup so we had to render it.
|
|
23
23
|
// We also preload async component to avoid first-load loading screen.
|
|
24
|
-
const renderMethod = process.env.NODE_ENV === 'production' ? hydrate : render;
|
|
24
|
+
const renderMethod = process.env.NODE_ENV === 'production' ? ReactDOM.hydrate : ReactDOM.render;
|
|
25
25
|
preload(routes, window.location.pathname).then(() => {
|
|
26
26
|
renderMethod(<HelmetProvider>
|
|
27
27
|
<BrowserRouter>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React from 'react';
|
|
7
|
+
import React, { isValidElement } from 'react';
|
|
8
8
|
/*
|
|
9
9
|
Minimal implementation of a React interpolate component.
|
|
10
10
|
We don't ship a markdown parser nor a feature-complete i18n library on purpose.
|
|
@@ -19,7 +19,7 @@ export function interpolate(text, values) {
|
|
|
19
19
|
const key = match.substring(1, match.length - 1);
|
|
20
20
|
const value = values?.[key];
|
|
21
21
|
if (typeof value !== 'undefined') {
|
|
22
|
-
const element =
|
|
22
|
+
const element = isValidElement(value)
|
|
23
23
|
? value
|
|
24
24
|
: // For non-React elements: basic primitive->string conversion
|
|
25
25
|
String(value);
|
|
@@ -20,7 +20,9 @@ function sortAliases(aliases) {
|
|
|
20
20
|
// Alphabetical order by default
|
|
21
21
|
const entries = lodash_1.default.sortBy(Object.entries(aliases), ([alias]) => alias);
|
|
22
22
|
// @theme/NavbarItem should be after @theme/NavbarItem/LocaleDropdown
|
|
23
|
-
entries.sort(([alias1], [alias2]) =>
|
|
23
|
+
entries.sort(([alias1], [alias2]) =>
|
|
24
|
+
// eslint-disable-next-line no-nested-ternary
|
|
25
|
+
alias1.includes(`${alias2}/`) ? -1 : alias2.includes(`${alias1}/`) ? 1 : 0);
|
|
24
26
|
return Object.fromEntries(entries);
|
|
25
27
|
}
|
|
26
28
|
exports.sortAliases = sortAliases;
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
const
|
|
9
|
+
const tslib_1 = require("tslib");
|
|
10
|
+
const webpack_1 = tslib_1.__importDefault(require("webpack"));
|
|
10
11
|
const pluginName = 'chunk-asset-plugin';
|
|
11
12
|
/**
|
|
12
13
|
* We modify webpack runtime to add an extra function called
|
|
@@ -42,7 +43,7 @@ class ChunkAssetPlugin {
|
|
|
42
43
|
// prefetching
|
|
43
44
|
// Note: we previously used jsonpScriptSrc (Webpack 4)
|
|
44
45
|
`__webpack_require__.gca = function(chunkId) { chunkId = ${JSON.stringify(chunkNameToId)}[chunkId]||chunkId; return __webpack_require__.p + __webpack_require__.u(chunkId); };`);
|
|
45
|
-
return webpack_1.Template.asString(buf);
|
|
46
|
+
return webpack_1.default.Template.asString(buf);
|
|
46
47
|
});
|
|
47
48
|
});
|
|
48
49
|
}
|
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-4710",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"@babel/runtime": "^7.17.2",
|
|
42
42
|
"@babel/runtime-corejs3": "^7.17.2",
|
|
43
43
|
"@babel/traverse": "^7.17.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-4710",
|
|
45
|
+
"@docusaurus/logger": "0.0.0-4710",
|
|
46
|
+
"@docusaurus/mdx-loader": "0.0.0-4710",
|
|
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-4710",
|
|
49
|
+
"@docusaurus/utils-common": "0.0.0-4710",
|
|
50
|
+
"@docusaurus/utils-validation": "0.0.0-4710",
|
|
51
51
|
"@slorber/static-site-generator-webpack-plugin": "^4.0.1",
|
|
52
52
|
"@svgr/webpack": "^6.2.1",
|
|
53
53
|
"autoprefixer": "^10.4.2",
|
|
@@ -106,8 +106,8 @@
|
|
|
106
106
|
"webpackbar": "^5.0.2"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
110
|
-
"@docusaurus/types": "0.0.0-
|
|
109
|
+
"@docusaurus/module-type-aliases": "0.0.0-4710",
|
|
110
|
+
"@docusaurus/types": "0.0.0-4710",
|
|
111
111
|
"@types/detect-port": "^1.3.2",
|
|
112
112
|
"@types/nprogress": "^0.2.0",
|
|
113
113
|
"@types/react-dom": "^17.0.13",
|
|
@@ -128,5 +128,5 @@
|
|
|
128
128
|
"engines": {
|
|
129
129
|
"node": ">=14"
|
|
130
130
|
},
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "b87b7d90b4b0f155d034b52406c2056ea1dced54"
|
|
132
132
|
}
|