From da762b7aea07dcdfcbba815b31bf3a83d03c2b99 Mon Sep 17 00:00:00 2001 From: Dhinesh Ponnarasan Date: Sat, 6 Jun 2026 20:31:19 -0400 Subject: [PATCH 1/8] fix(examples): update stale engine and sandbox node version (#12120) The example artifacts were regenerated for the v3.10.1 maintenance release, which reverted the engine field from '>=24.14' back to '>=20.0' and left the sandbox node version at '18'. Update the examples to reflect current maintainer intent: - Bump engines.node from '>=20.0' to '>=24.14' (reapplies PR #11914 change overwritten by PR #11985) - Bump sandbox.config.json node from '18' to '24' (syncs with generateExamples.js updated in PR #12080) --- examples/classic-typescript/package.json | 2 +- examples/classic-typescript/sandbox.config.json | 4 ++-- examples/classic/package.json | 2 +- examples/classic/sandbox.config.json | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/classic-typescript/package.json b/examples/classic-typescript/package.json index 6b6f7d4a8c51..54920c448c42 100644 --- a/examples/classic-typescript/package.json +++ b/examples/classic-typescript/package.json @@ -45,7 +45,7 @@ ] }, "engines": { - "node": ">=20.0" + "node": ">=24.14" }, "description": "Docusaurus example project (classic-typescript template)" } diff --git a/examples/classic-typescript/sandbox.config.json b/examples/classic-typescript/sandbox.config.json index fe547f732fe2..ea89f63c60eb 100644 --- a/examples/classic-typescript/sandbox.config.json +++ b/examples/classic-typescript/sandbox.config.json @@ -3,8 +3,8 @@ "hardReloadOnChange": true, "view": "browser", "template": "docusaurus", - "node": "18", + "node": "24", "container": { - "node": "18" + "node": "24" } } diff --git a/examples/classic/package.json b/examples/classic/package.json index 65f9d0692602..ad79f19b9007 100644 --- a/examples/classic/package.json +++ b/examples/classic/package.json @@ -41,7 +41,7 @@ ] }, "engines": { - "node": ">=20.0" + "node": ">=24.14" }, "description": "Docusaurus example project" } diff --git a/examples/classic/sandbox.config.json b/examples/classic/sandbox.config.json index fe547f732fe2..ea89f63c60eb 100644 --- a/examples/classic/sandbox.config.json +++ b/examples/classic/sandbox.config.json @@ -3,8 +3,8 @@ "hardReloadOnChange": true, "view": "browser", "template": "docusaurus", - "node": "18", + "node": "24", "container": { - "node": "18" + "node": "24" } } From d9619db91bea796a2351d2bb822c7f0d4256672f Mon Sep 17 00:00:00 2001 From: Dhinesh Ponnarasan Date: Tue, 7 Jul 2026 19:41:13 -0400 Subject: [PATCH 2/8] fix(core): accept boolean attributes in headTags config validation (#12233) (AI-assisted) --- .../server/__tests__/configValidation.test.ts | 22 ++++++++++++++++--- .../docusaurus/src/server/configValidation.ts | 5 ++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/packages/docusaurus/src/server/__tests__/configValidation.test.ts b/packages/docusaurus/src/server/__tests__/configValidation.test.ts index 63dce02913f5..a94d8d18ba9a 100644 --- a/packages/docusaurus/src/server/__tests__/configValidation.test.ts +++ b/packages/docusaurus/src/server/__tests__/configValidation.test.ts @@ -330,24 +330,40 @@ describe('headTags', () => { ).not.toThrow(); }); - it("throws error if headTags doesn't have string attributes", () => { + it('throws error if headTags has invalid attribute values', () => { expect(() => { normalizeConfig({ headTags: [ { tagName: 'link', attributes: { - rel: false, + rel: 123, href: 'img/docusaurus.png', }, }, ], }); }).toThrowErrorMatchingInlineSnapshot(` - [Error: "headTags[0].attributes.rel" must be a string + [Error: "headTags[0].attributes.rel" must be one of [string, boolean] ] `); }); + + it('accepts headTags with boolean attributes', () => { + expect(() => { + normalizeConfig({ + headTags: [ + { + tagName: 'script', + attributes: { + src: '/analytics.js', + async: true, + }, + }, + ], + }); + }).not.toThrow(); + }); }); describe('css', () => { diff --git a/packages/docusaurus/src/server/configValidation.ts b/packages/docusaurus/src/server/configValidation.ts index 462e5b2274d6..1c4ea8dacbfe 100644 --- a/packages/docusaurus/src/server/configValidation.ts +++ b/packages/docusaurus/src/server/configValidation.ts @@ -469,7 +469,10 @@ export const ConfigSchema = Joi.object({ is: Joi.valid(true), then: Joi.optional(), otherwise: Joi.object() - .pattern(/[\w-]+/, Joi.string()) + .pattern( + /[\w-]+/, + Joi.alternatives().try(Joi.string(), Joi.boolean()), + ) .required(), }), customElement: Joi.bool().default(false), From 1c536ed29ebb357dd648738f60d9a7f9e61df1d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lorber?= Date: Thu, 9 Jul 2026 17:01:01 +0200 Subject: [PATCH 3/8] Update examples/classic-typescript/package.json --- examples/classic-typescript/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/classic-typescript/package.json b/examples/classic-typescript/package.json index 54920c448c42..6b6f7d4a8c51 100644 --- a/examples/classic-typescript/package.json +++ b/examples/classic-typescript/package.json @@ -45,7 +45,7 @@ ] }, "engines": { - "node": ">=24.14" + "node": ">=20.0" }, "description": "Docusaurus example project (classic-typescript template)" } From a4be020abe10e6ca9ced224e253a570953bd47a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lorber?= Date: Thu, 9 Jul 2026 17:01:08 +0200 Subject: [PATCH 4/8] Update examples/classic-typescript/sandbox.config.json --- examples/classic-typescript/sandbox.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/classic-typescript/sandbox.config.json b/examples/classic-typescript/sandbox.config.json index ea89f63c60eb..08c8d6ed5563 100644 --- a/examples/classic-typescript/sandbox.config.json +++ b/examples/classic-typescript/sandbox.config.json @@ -5,6 +5,6 @@ "template": "docusaurus", "node": "24", "container": { - "node": "24" + "node": "18" } } From cbd010910ecdeceb736f902d53ec7616d1b8305b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lorber?= Date: Thu, 9 Jul 2026 17:01:15 +0200 Subject: [PATCH 5/8] Update examples/classic/sandbox.config.json --- examples/classic/sandbox.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/classic/sandbox.config.json b/examples/classic/sandbox.config.json index ea89f63c60eb..36372e73e9f1 100644 --- a/examples/classic/sandbox.config.json +++ b/examples/classic/sandbox.config.json @@ -3,7 +3,7 @@ "hardReloadOnChange": true, "view": "browser", "template": "docusaurus", - "node": "24", + "node": "18", "container": { "node": "24" } From a7e3ba2449064ed384c1ebe497e2e001e186aade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lorber?= Date: Thu, 9 Jul 2026 17:01:22 +0200 Subject: [PATCH 6/8] Update examples/classic-typescript/sandbox.config.json --- examples/classic-typescript/sandbox.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/classic-typescript/sandbox.config.json b/examples/classic-typescript/sandbox.config.json index 08c8d6ed5563..fe547f732fe2 100644 --- a/examples/classic-typescript/sandbox.config.json +++ b/examples/classic-typescript/sandbox.config.json @@ -3,7 +3,7 @@ "hardReloadOnChange": true, "view": "browser", "template": "docusaurus", - "node": "24", + "node": "18", "container": { "node": "18" } From bdddfac6a815bf37b8fa63e630f45a77e5ce273f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lorber?= Date: Thu, 9 Jul 2026 17:01:27 +0200 Subject: [PATCH 7/8] Update examples/classic/package.json --- examples/classic/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/classic/package.json b/examples/classic/package.json index ad79f19b9007..65f9d0692602 100644 --- a/examples/classic/package.json +++ b/examples/classic/package.json @@ -41,7 +41,7 @@ ] }, "engines": { - "node": ">=24.14" + "node": ">=20.0" }, "description": "Docusaurus example project" } From 7fd4eb144ad1b1b6f89a321383b3e9170b9218c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lorber?= Date: Thu, 9 Jul 2026 17:01:35 +0200 Subject: [PATCH 8/8] Update examples/classic/sandbox.config.json --- examples/classic/sandbox.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/classic/sandbox.config.json b/examples/classic/sandbox.config.json index 36372e73e9f1..fe547f732fe2 100644 --- a/examples/classic/sandbox.config.json +++ b/examples/classic/sandbox.config.json @@ -5,6 +5,6 @@ "template": "docusaurus", "node": "18", "container": { - "node": "24" + "node": "18" } }