@docusaurus/core 3.10.1-canary-6644 → 3.10.1-canary-6646
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/serverEntry.js +1 -6
- package/lib/client/serverHelmetUtils.js +0 -1
- package/lib/commands/build/buildLocale.js +0 -4
- package/lib/server/configValidation.js +0 -9
- package/lib/ssg/ssgParams.d.ts +0 -1
- package/lib/ssg/ssgParams.js +0 -1
- package/lib/ssg/ssgRenderer.js +1 -5
- package/package.json +11 -11
|
@@ -13,7 +13,7 @@ import preload from './preload';
|
|
|
13
13
|
import App from './App';
|
|
14
14
|
import { createStatefulBrokenLinks, BrokenLinksProvider, } from './BrokenLinksContext';
|
|
15
15
|
import { toPageCollectedMetadataInternal } from './serverHelmetUtils';
|
|
16
|
-
const render = async ({ pathname
|
|
16
|
+
const render = async ({ pathname }) => {
|
|
17
17
|
await preload(pathname);
|
|
18
18
|
const modules = new Set();
|
|
19
19
|
const routerContext = {};
|
|
@@ -33,11 +33,6 @@ const render = async ({ pathname, v4RemoveLegacyPostBuildHeadAttribute, }) => {
|
|
|
33
33
|
const html = await renderToHtml(app);
|
|
34
34
|
const { helmet } = helmetContext;
|
|
35
35
|
const metadata = toPageCollectedMetadataInternal({ helmet });
|
|
36
|
-
// TODO Docusaurus v4 remove with deprecated postBuild({head}) API
|
|
37
|
-
// the returned collectedData must be serializable to run in workers
|
|
38
|
-
if (v4RemoveLegacyPostBuildHeadAttribute) {
|
|
39
|
-
metadata.helmet = null;
|
|
40
|
-
}
|
|
41
36
|
const collectedData = {
|
|
42
37
|
metadata,
|
|
43
38
|
anchors: statefulBrokenLinks.getCollectedAnchors(),
|
|
@@ -99,9 +99,6 @@ async function buildLocale({ siteDir, locale, cliOptions, }) {
|
|
|
99
99
|
logger_1.default.success `Generated static files in path=${path_1.default.relative(process.cwd(), outDir)}.`;
|
|
100
100
|
}
|
|
101
101
|
async function executePluginsPostBuild({ plugins, props, collectedData, }) {
|
|
102
|
-
const head = props.siteConfig.future.v4.removeLegacyPostBuildHeadAttribute
|
|
103
|
-
? {}
|
|
104
|
-
: lodash_1.default.mapValues(collectedData, (d) => d.metadata.helmet);
|
|
105
102
|
const routesBuildMetadata = lodash_1.default.mapValues(collectedData, (d) => d.metadata.public);
|
|
106
103
|
await Promise.all(plugins.map(async (plugin) => {
|
|
107
104
|
if (!plugin.postBuild) {
|
|
@@ -109,7 +106,6 @@ async function executePluginsPostBuild({ plugins, props, collectedData, }) {
|
|
|
109
106
|
}
|
|
110
107
|
await plugin.postBuild({
|
|
111
108
|
...props,
|
|
112
|
-
head,
|
|
113
109
|
routesBuildMetadata,
|
|
114
110
|
content: plugin.content,
|
|
115
111
|
});
|
|
@@ -70,7 +70,6 @@ exports.DEFAULT_FASTER_CONFIG_TRUE = {
|
|
|
70
70
|
gitEagerVcs: true,
|
|
71
71
|
};
|
|
72
72
|
exports.DEFAULT_FUTURE_V4_CONFIG = {
|
|
73
|
-
removeLegacyPostBuildHeadAttribute: false,
|
|
74
73
|
useCssCascadeLayers: false,
|
|
75
74
|
siteStorageNamespacing: false,
|
|
76
75
|
fasterByDefault: false,
|
|
@@ -78,7 +77,6 @@ exports.DEFAULT_FUTURE_V4_CONFIG = {
|
|
|
78
77
|
};
|
|
79
78
|
// When using the "v4: true" shortcut
|
|
80
79
|
exports.DEFAULT_FUTURE_V4_CONFIG_TRUE = {
|
|
81
|
-
removeLegacyPostBuildHeadAttribute: true,
|
|
82
80
|
useCssCascadeLayers: true,
|
|
83
81
|
siteStorageNamespacing: true,
|
|
84
82
|
fasterByDefault: true,
|
|
@@ -227,7 +225,6 @@ const FASTER_CONFIG_SCHEMA = utils_validation_1.Joi.alternatives()
|
|
|
227
225
|
.optional();
|
|
228
226
|
const FUTURE_V4_SCHEMA = utils_validation_1.Joi.alternatives()
|
|
229
227
|
.try(utils_validation_1.Joi.object({
|
|
230
|
-
removeLegacyPostBuildHeadAttribute: utils_validation_1.Joi.boolean().default(exports.DEFAULT_FUTURE_V4_CONFIG.removeLegacyPostBuildHeadAttribute),
|
|
231
228
|
useCssCascadeLayers: utils_validation_1.Joi.boolean().default(exports.DEFAULT_FUTURE_V4_CONFIG.useCssCascadeLayers),
|
|
232
229
|
siteStorageNamespacing: utils_validation_1.Joi.boolean().default(exports.DEFAULT_FUTURE_V4_CONFIG.siteStorageNamespacing),
|
|
233
230
|
fasterByDefault: utils_validation_1.Joi.boolean().default(exports.DEFAULT_FUTURE_V4_CONFIG.fasterByDefault),
|
|
@@ -470,12 +467,6 @@ Please migrate and move this option to code=${'siteConfig.markdown.hooks.onBroke
|
|
|
470
467
|
: (0, utils_1.getVcsPreset)('disabled');
|
|
471
468
|
config.future.experimental_vcs = vcsConfig;
|
|
472
469
|
}
|
|
473
|
-
if (config.future.faster.ssgWorkerThreads &&
|
|
474
|
-
!config.future.v4.removeLegacyPostBuildHeadAttribute) {
|
|
475
|
-
throw new Error(`Docusaurus config ${logger_1.default.code('future.faster.ssgWorkerThreads')} requires the future flag ${logger_1.default.code('future.v4.removeLegacyPostBuildHeadAttribute')} to be turned on.
|
|
476
|
-
If you use Docusaurus Faster, we recommend that you also activate Docusaurus v4 future flags: ${logger_1.default.code('{future: {v4: true}}')}
|
|
477
|
-
All the v4 future flags are documented here: https://docusaurus.io/docs/api/docusaurus-config#future`);
|
|
478
|
-
}
|
|
479
470
|
if (config.future.faster.rspackPersistentCache &&
|
|
480
471
|
!config.future.faster.rspackBundler) {
|
|
481
472
|
throw new Error(`Docusaurus config flag ${logger_1.default.code('future.faster.rspackPersistentCache')} requires the flag ${logger_1.default.code('future.faster.rspackBundler')} to be turned on.`);
|
package/lib/ssg/ssgParams.d.ts
CHANGED
|
@@ -20,7 +20,6 @@ export type SSGParams = {
|
|
|
20
20
|
htmlMinifierType: HtmlMinifierType;
|
|
21
21
|
serverBundlePath: string;
|
|
22
22
|
ssgTemplateContent: string;
|
|
23
|
-
v4RemoveLegacyPostBuildHeadAttribute: boolean;
|
|
24
23
|
};
|
|
25
24
|
export declare function createSSGParams({ props, serverBundlePath, clientManifestPath, }: {
|
|
26
25
|
props: Props;
|
package/lib/ssg/ssgParams.js
CHANGED
|
@@ -29,7 +29,6 @@ async function createSSGParams({ props, serverBundlePath, clientManifestPath, })
|
|
|
29
29
|
htmlMinifierType: props.siteConfig.future.faster.swcHtmlMinimizer
|
|
30
30
|
? 'swc'
|
|
31
31
|
: 'terser',
|
|
32
|
-
v4RemoveLegacyPostBuildHeadAttribute: props.siteConfig.future.v4.removeLegacyPostBuildHeadAttribute,
|
|
33
32
|
};
|
|
34
33
|
// Useless but ensures that SSG params remain serializable
|
|
35
34
|
return structuredClone(params);
|
package/lib/ssg/ssgRenderer.js
CHANGED
|
@@ -86,7 +86,6 @@ function reduceCollectedData(pageCollectedData) {
|
|
|
86
86
|
anchors: pageCollectedData.anchors,
|
|
87
87
|
metadata: {
|
|
88
88
|
public: pageCollectedData.metadata.public,
|
|
89
|
-
helmet: pageCollectedData.metadata.helmet,
|
|
90
89
|
},
|
|
91
90
|
links: pageCollectedData.links,
|
|
92
91
|
};
|
|
@@ -94,10 +93,7 @@ function reduceCollectedData(pageCollectedData) {
|
|
|
94
93
|
async function generateStaticFile({ pathname, appRenderer, params, htmlMinifier, ssgTemplate, }) {
|
|
95
94
|
try {
|
|
96
95
|
// This only renders the app HTML
|
|
97
|
-
const appRenderResult = await appRenderer.render({
|
|
98
|
-
pathname,
|
|
99
|
-
v4RemoveLegacyPostBuildHeadAttribute: params.v4RemoveLegacyPostBuildHeadAttribute,
|
|
100
|
-
});
|
|
96
|
+
const appRenderResult = await appRenderer.render({ pathname });
|
|
101
97
|
// This renders the full page HTML, including head tags...
|
|
102
98
|
const fullPageHtml = (0, ssgTemplate_1.renderSSGTemplate)({
|
|
103
99
|
params,
|
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": "3.10.1-canary-
|
|
4
|
+
"version": "3.10.1-canary-6646",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"url": "https://github.com/facebook/docusaurus/issues"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@docusaurus/babel": "3.10.1-canary-
|
|
37
|
-
"@docusaurus/bundler": "3.10.1-canary-
|
|
38
|
-
"@docusaurus/logger": "3.10.1-canary-
|
|
39
|
-
"@docusaurus/mdx-loader": "3.10.1-canary-
|
|
40
|
-
"@docusaurus/utils": "3.10.1-canary-
|
|
41
|
-
"@docusaurus/utils-common": "3.10.1-canary-
|
|
42
|
-
"@docusaurus/utils-validation": "3.10.1-canary-
|
|
36
|
+
"@docusaurus/babel": "3.10.1-canary-6646",
|
|
37
|
+
"@docusaurus/bundler": "3.10.1-canary-6646",
|
|
38
|
+
"@docusaurus/logger": "3.10.1-canary-6646",
|
|
39
|
+
"@docusaurus/mdx-loader": "3.10.1-canary-6646",
|
|
40
|
+
"@docusaurus/utils": "3.10.1-canary-6646",
|
|
41
|
+
"@docusaurus/utils-common": "3.10.1-canary-6646",
|
|
42
|
+
"@docusaurus/utils-validation": "3.10.1-canary-6646",
|
|
43
43
|
"boxen": "^6.2.1",
|
|
44
44
|
"chalk": "^4.1.2",
|
|
45
45
|
"chokidar": "^3.5.3",
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
"webpack-merge": "^6.0.1"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@docusaurus/module-type-aliases": "3.10.1-canary-
|
|
81
|
-
"@docusaurus/types": "3.10.1-canary-
|
|
80
|
+
"@docusaurus/module-type-aliases": "3.10.1-canary-6646",
|
|
81
|
+
"@docusaurus/types": "3.10.1-canary-6646",
|
|
82
82
|
"@total-typescript/shoehorn": "^0.1.2",
|
|
83
83
|
"@types/detect-port": "^1.3.3",
|
|
84
84
|
"@types/react-dom": "^19.2.3",
|
|
@@ -104,5 +104,5 @@
|
|
|
104
104
|
"engines": {
|
|
105
105
|
"node": ">=24.14"
|
|
106
106
|
},
|
|
107
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "25810ccd5d6bbcc497e3b73331ebf11837327d5d"
|
|
108
108
|
}
|