Skip to content

Commit

Permalink
Document future flags, config future and semver policy
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed May 10, 2024
1 parent 40fd927 commit 29c8338
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
6 changes: 6 additions & 0 deletions website/community/5-release-process.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ We will outline what accounts as the public API surface.
- `@docusaurus/types` TypeScript types
- We still retain the freedom to make types stricter (which may break type-checking).

❌ Our public API **excludes**:

- Docusaurus config [`future`](/docs/api/docusaurus-config#future) features
- All features prefixed by `experimental_` or `unstable_`
- All features prefixed by `v<MajorVersion>_` (`v6_` `v7_`, etc.)

:::tip

For non-theme APIs, any documented API is considered public (and will be stable); any undocumented API is considered internal.
Expand Down
35 changes: 35 additions & 0 deletions website/docs/api/docusaurus.config.js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,41 @@ export default {
- `calendar`: the [calendar](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/calendar) used to calculate the date era. Note that it doesn't control the actual string displayed: `MM/DD/YYYY` and `DD/MM/YYYY` are both `gregory`. To choose the format (`DD/MM/YYYY` or `MM/DD/YYYY`), set your locale name to `en-GB` or `en-US` (`en` means `en-US`).
- `path`: Root folder that all plugin localization folders of this locale are relative to. Will be resolved against `i18n.path`. Defaults to the locale's name. Note: this has no effect on the locale's `baseUrl`—customization of base URL is a work-in-progress.

### `future` {#future}

- Type: `Object`

The `future` configuration object permits to opt-in for upcoming/unstable/experimental Docusaurus features that are not ready for prime time.

It is also a way to opt-in for upcoming breaking changes coming in the next major versions, enabling you to prepare your site for the next version while staying on the previous one. The [Remix Future Flags blog post](https://remix.run/blog/future-flags) greatly explains this idea.

:::danger Breaking changes in minor versions

Features prefixed by `experimental_` or `unstable_` are subject to changes in **minor versions**, and not considered as [Semantic Versioning breaking changes](/community/release-process).

Features prefixed by `v<MajorVersion>_` (`v6_` `v7_`, etc.) are future flags that are expected to be turned on by default in the next major versions. These are less likely to change, but we keep the possibility to do so.

`future` API breaking changes should be easy to handle, and will be documented in minor/major version blog posts.

:::

Example:

```js title="docusaurus.config.js"
export default {
future: {
experimental_storage: {
type: 'localStorage',
namespace: true,
},
},
};
```

- `experimental_storage`: Site-wide browser storage options that theme authors should strive to respect.
- `type`: The browser storage theme authors should use. Possible values are `localStorage` and `sessionStorage`. Defaults to `localStorage`.
- `namespace`: Whether to namespace the browser storage keys to avoid storage key conflicts when Docusaurus sites are hosted under the same domain, or on localhost. Possible values are `string | boolean`. The namespace is appended at the end of the storage keys `key-namespace`. Use `true` to automatically generate a random namespace from your site `url + baseUrl`. Defaults to `false` (no namespace, historical behavior).

### `noIndex` {#noIndex}

- Type: `boolean`
Expand Down

0 comments on commit 29c8338

Please sign in to comment.