Conversation
…config The `future.experimental_storage` config has been promoted to a stable top-level `storage` site config attribute. Using the old config path now throws a clear error pointing users to the new location. Also adds a `future.v4.siteStorageNamespacing` flag (default: false) that changes the default of `storage.namespace` to `true`, enabling automatic browser storage key namespacing in v4. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Joi.object<FutureConfig> generic enforced the type, but experimental_storage is no longer on FutureConfig. Remove the generic to allow the extra key for the error-throwing validator. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
✅ [V2]
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Size Change: +2.3 kB (+0.02%) Total Size: 11.9 MB
ℹ️ View Unchanged
|
⚡️ Lighthouse report for the deploy preview of this PR
|
|
Size Change: +1.23 kB (+0.01%) Total Size: 12.3 MB
ℹ️ View Unchanged
|
siteConfig.storage to stable + add future.v4.siteStorageNamespacing flag [Claude]
slorber
commented
Mar 12, 2026
packages/docusaurus/src/server/__tests__/configValidation.test.ts
Outdated
Show resolved
Hide resolved
packages/docusaurus/src/server/__tests__/configValidation.test.ts
Outdated
Show resolved
Hide resolved
slorber
commented
Mar 12, 2026
slorber
commented
Mar 12, 2026
- Use Joi .forbidden() instead of .custom() for cleaner error messages
- Move storageContaining() helper to describe('future') scope for reuse
- Add dedicated describe('siteStorageNamespacing') test block
- Add test for siteStorageNamespacing = false
- Add siteStorageNamespacing to v4 flags example in docs
- Use storageContaining() helper consistently in storage tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…acing unit tests under v4
Storage+v4 namespace interaction tests belong in describe('storage') > describe('namespace').
Dedicated describe('siteStorageNamespacing') unit tests added inside describe('v4')
following the same pattern as other v4 flags.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
slorber
commented
Mar 12, 2026
packages/docusaurus/src/server/__tests__/configValidation.test.ts
Outdated
Show resolved
Hide resolved
slorber
commented
Mar 12, 2026
packages/docusaurus/src/server/__tests__/configValidation.test.ts
Outdated
Show resolved
Hide resolved
slorber
commented
Mar 12, 2026
packages/docusaurus/src/server/__tests__/configValidation.test.ts
Outdated
Show resolved
Hide resolved
- Storage tests are now a top-level describe('storage') block since
storage is no longer under future config
- storageContaining() helper moved back inside describe('storage')
- Fix 'rejects - null' test to actually use null instead of 42
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
future.experimental_storageto a stable top-levelstoragesite config attributefuture.experimental_storageconfig now throws a clear error pointing users to the new location (breaking change acceptable since it was experimental)future.v4.siteStorageNamespacingflag (default:false) that changes the default ofstorage.namespacetotrue, enabling automatic browser storage key namespacing and opting in for the upcoming Docusaurus v4 breaking changeMigration
const config = { + storage: { + type: 'localStorage', + namespace: true, + }, future: { - experimental_storage: { - type: 'localStorage', - namespace: true, - }, }, };Or simply enable the v4 future flag to get
namespace: trueby default, which will become the new default in Docusaurus v4:Namespacing - Need to preserve existing storage?
The localStorage keys using namespacing will now use a suffix.
For example,
themebecomestheme-xyz123This means that when turning on namespacing, the theme of your website's visitor will likely reset to
undefined.If you want to enable storage namespacing, but have stored important values that need to be preserved, you will need to migrate these values. It's possible to migrate them with a client-side script.
We give an example of how to do so in this PR: #10121
Note:
namespace: falseto preserve the retrocompatible v3 behavior.Test plan
packages/docusaurus/src/server/__tests__/storage.test.ts- all passpackages/docusaurus/src/server/__tests__/configValidation.test.ts- all pass (new tests for: error on old config, v4 flag namespace resolution,siteStorageNamespacingunit tests underdescribe('v4'))packages/docusaurus/src/server/__tests__/config.test.ts- snapshots updatedpackages/docusaurus/src/server/__tests__/site.test.ts- snapshots updated🤖 Generated with Claude Code