diff --git a/docs/reference/technologies/client/kotlin.mdx b/docs/reference/technologies/client/kotlin.mdx index 84d5e5bfa..886e8601f 100644 --- a/docs/reference/technologies/client/kotlin.mdx +++ b/docs/reference/technologies/client/kotlin.mdx @@ -10,7 +10,7 @@ This content has been automatically generated from kotlin-sdk. Edits should be made here: https://github.com/open-feature/kotlin-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Tue May 07 2024 20:53:29 GMT+0000 (Coordinated Universal Time) +Last updated at Wed May 15 2024 08:07:55 GMT+0000 (Coordinated Universal Time) -->

diff --git a/docs/reference/technologies/client/swift.mdx b/docs/reference/technologies/client/swift.mdx index 1394790ba..81351ea1f 100644 --- a/docs/reference/technologies/client/swift.mdx +++ b/docs/reference/technologies/client/swift.mdx @@ -10,7 +10,7 @@ This content has been automatically generated from swift-sdk. Edits should be made here: https://github.com/open-feature/swift-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Tue May 07 2024 20:53:29 GMT+0000 (Coordinated Universal Time) +Last updated at Wed May 15 2024 08:07:55 GMT+0000 (Coordinated Universal Time) -->

diff --git a/docs/reference/technologies/client/web/index.mdx b/docs/reference/technologies/client/web/index.mdx index c3647e964..84a68bcc5 100644 --- a/docs/reference/technologies/client/web/index.mdx +++ b/docs/reference/technologies/client/web/index.mdx @@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk. Edits should be made here: https://github.com/open-feature/js-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Tue May 07 2024 20:53:28 GMT+0000 (Coordinated Universal Time) +Last updated at Wed May 15 2024 08:07:55 GMT+0000 (Coordinated Universal Time) -->

@@ -18,8 +18,8 @@ Last updated at Tue May 07 2024 20:53:28 GMT+0000 (Coordinated Universal Time) Specification - - Release + + Release
@@ -118,7 +118,7 @@ To register a provider and ensure it is ready before further actions are taken, ```ts await OpenFeature.setProviderAndWait(new MyProvider()); -``` +``` #### Synchronous @@ -155,9 +155,16 @@ Sometimes, the value of a flag must consider some dynamic criteria about the app In OpenFeature, we refer to this as [targeting](/specification/glossary#targeting). If the flag management system you're using supports targeting, you can provide the input data using the [evaluation context](/docs/reference/concepts/evaluation-context). +```ts +// Sets global context during provider registration +await OpenFeature.setProvider(new MyProvider(), { origin: document.location.host }); +``` + +Change context after the provider has been registered using `setContext`. + ```ts // Set a value to the global context -await OpenFeature.setContext({ origin: document.location.host }); +await OpenFeature.setContext({ targetingKey: localStorage.getItem("targetingKey") }); ``` Context is global and setting it is `async`. @@ -230,6 +237,24 @@ const domainScopedClient = OpenFeature.getClient("my-domain"); Domains can be defined on a provider during registration. For more details, please refer to the [providers](#providers) section. +#### Manage evaluation context for domains + +By default, domain-scoped clients use the global context. +This can be overridden by explicitly setting context when registering the provider or by references the domain when updating context: + +```ts +OpenFeature.setProvider("my-domain", new NewCachedProvider(), { targetingKey: localStorage.getItem("targetingKey") }); +``` + +To change context after the provider has been registered, use `setContext` with a name: + +```ts +await OpenFeature.setContext("my-domain", { targetingKey: localStorage.getItem("targetingKey") }) +``` + +Once context has been defined for a named client, it will override the global context for all clients using the associated provider. +Context can be cleared using for a named provider using `OpenFeature.clearContext("my-domain")` or call `OpenFeature.clearContexts()` to reset all context. + ### Eventing Events allow you to react to state changes in the provider or underlying flag management system, such as flag definition changes, provider readiness, or error conditions. diff --git a/docs/reference/technologies/client/web/react.mdx b/docs/reference/technologies/client/web/react.mdx index 9eea9c42c..e17d60d69 100644 --- a/docs/reference/technologies/client/web/react.mdx +++ b/docs/reference/technologies/client/web/react.mdx @@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk. Edits should be made here: https://github.com/open-feature/js-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Tue May 07 2024 20:53:28 GMT+0000 (Coordinated Universal Time) +Last updated at Wed May 15 2024 08:07:55 GMT+0000 (Coordinated Universal Time) -->

@@ -18,8 +18,8 @@ Last updated at Tue May 07 2024 20:53:28 GMT+0000 (Coordinated Universal Time) Specification - - Release + + Release
@@ -196,10 +196,14 @@ You can disable this feature in the hook options (or in the [OpenFeatureProvider ```tsx function Page() { - const showNewMessage = useBooleanFlagValue('new-message', false, { updateOnContextChanged: false }); + const { value: showNewMessage } = useFlag('new-message', false, { updateOnContextChanged: false }); return ( - - ) +

+
+ {showNewMessage ?

Welcome to this OpenFeature-enabled React app!

:

Welcome to this React app.

} +
+
+ ); } ``` @@ -213,10 +217,14 @@ You can disable this feature in the hook options (or in the [OpenFeatureProvider ```tsx function Page() { - const showNewMessage = useBooleanFlagValue('new-message', false, { updateOnConfigurationChanged: false }); + const { value: showNewMessage } = useFlag('new-message', false, { updateOnConfigurationChanged: false }); return ( - - ) +
+
+ {showNewMessage ?

Welcome to this OpenFeature-enabled React app!

:

Welcome to this React app.

} +
+
+ ); } ``` @@ -224,9 +232,13 @@ Note that if your provider doesn't support updates, this configuration has no im #### Suspense Support +> [!NOTE] +> React suspense is an experimental feature and subject to change in future versions. + Frequently, providers need to perform some initial startup tasks. It may be desireable not to display components with feature flags until this is complete, or when the context changes. Built-in [suspense](https://react.dev/reference/react/Suspense) support makes this easy. +Use `useSuspenseFlag` or pass `{ suspend: true }` in the hook options to leverage this functionality. ```tsx function Content() { @@ -239,8 +251,8 @@ function Content() { } function Message() { - // component to render after READY. - const showNewMessage = useBooleanFlagValue('new-message', false); + // component to render after READY, equivalent to useFlag('new-message', false, { suspend: true }); + const { value: showNewMessage } = useSuspenseFlag('new-message', false); return ( <> @@ -268,8 +280,9 @@ This can be disabled in the hook options (or in the [OpenFeatureProvider](#openf The OpenFeature React SDK features built-in [suspense support](#suspense-support). This means that it will render your loading fallback automatically while the your provider starts up, and during context reconciliation for any of your components using feature flags! -However, you will see this error if you neglect to create a suspense boundary around any components using feature flags; add a suspense boundary to resolve this issue. -Alternatively, you can disable this feature by setting `suspendWhileReconciling=false` and `suspendUntilReady=false` in the [evaluation hooks](#evaluation-hooks) or the [OpenFeatureProvider](#openfeatureprovider-context-provider) (which applies to all evaluation hooks in child components). +If you use suspense and neglect to create a suspense boundary around any components using feature flags, you will see this error. +Add a suspense boundary to resolve this issue. +Alternatively, you can disable this suspense (the default) by removing `suspendWhileReconciling=true`, `suspendUntilReady=true` or `suspend=true` in the [evaluation hooks](#evaluation-hooks) or the [OpenFeatureProvider](#openfeatureprovider-context-provider) (which applies to all evaluation hooks in child components). > I get odd rendering issues, or errors when components mount, if I use the suspense features. diff --git a/docs/reference/technologies/server/dotnet.mdx b/docs/reference/technologies/server/dotnet.mdx index 43607d388..88f6dab83 100644 --- a/docs/reference/technologies/server/dotnet.mdx +++ b/docs/reference/technologies/server/dotnet.mdx @@ -10,7 +10,7 @@ This content has been automatically generated from dotnet-sdk. Edits should be made here: https://github.com/open-feature/dotnet-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Tue May 07 2024 20:53:27 GMT+0000 (Coordinated Universal Time) +Last updated at Wed May 15 2024 08:07:55 GMT+0000 (Coordinated Universal Time) --> [![Specification](https://img.shields.io/static/v1?label=specification&message=v0.7.0&color=yellow&style=for-the-badge)](https://github.com/open-feature/spec/releases/tag/v0.7.0) diff --git a/docs/reference/technologies/server/go.mdx b/docs/reference/technologies/server/go.mdx index 7b7ee44cf..644543896 100644 --- a/docs/reference/technologies/server/go.mdx +++ b/docs/reference/technologies/server/go.mdx @@ -9,7 +9,7 @@ This content has been automatically generated from go-sdk. Edits should be made here: https://github.com/open-feature/go-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Tue May 07 2024 20:53:27 GMT+0000 (Coordinated Universal Time) +Last updated at Wed May 15 2024 08:07:55 GMT+0000 (Coordinated Universal Time) -->

diff --git a/docs/reference/technologies/server/java.mdx b/docs/reference/technologies/server/java.mdx index 073d9c5e6..442d74336 100644 --- a/docs/reference/technologies/server/java.mdx +++ b/docs/reference/technologies/server/java.mdx @@ -9,7 +9,7 @@ This content has been automatically generated from java-sdk. Edits should be made here: https://github.com/open-feature/java-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Tue May 07 2024 20:53:27 GMT+0000 (Coordinated Universal Time) +Last updated at Wed May 15 2024 08:07:55 GMT+0000 (Coordinated Universal Time) -->

diff --git a/docs/reference/technologies/server/javascript/index.mdx b/docs/reference/technologies/server/javascript/index.mdx index 292b1268c..636513c8f 100644 --- a/docs/reference/technologies/server/javascript/index.mdx +++ b/docs/reference/technologies/server/javascript/index.mdx @@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk. Edits should be made here: https://github.com/open-feature/js-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Tue May 07 2024 20:53:27 GMT+0000 (Coordinated Universal Time) +Last updated at Wed May 15 2024 08:07:55 GMT+0000 (Coordinated Universal Time) -->

@@ -18,8 +18,8 @@ Last updated at Tue May 07 2024 20:53:27 GMT+0000 (Coordinated Universal Time) Specification - - Release + + Release
@@ -41,7 +41,7 @@ Last updated at Tue May 07 2024 20:53:27 GMT+0000 (Coordinated Universal Time) ### Requirements -- Node.js version 16+ +- Node.js version 18+ ### Install @@ -158,6 +158,9 @@ const requestContext = { const boolValue = await client.getBooleanValue('some-flag', false, requestContext); ``` +Context is merged by the SDK before a flag evaluation occurs. +The merge order is defined [here](/specification/sections/evaluation-context#requirement-323) in the OpenFeature specification. + ### Hooks [Hooks](/docs/reference/concepts/hooks) allow for custom logic to be added at well-defined points of the flag evaluation life-cycle. diff --git a/docs/reference/technologies/server/javascript/nestjs.mdx b/docs/reference/technologies/server/javascript/nestjs.mdx index dae017ec0..25acf550f 100644 --- a/docs/reference/technologies/server/javascript/nestjs.mdx +++ b/docs/reference/technologies/server/javascript/nestjs.mdx @@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk. Edits should be made here: https://github.com/open-feature/js-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Tue May 07 2024 20:53:27 GMT+0000 (Coordinated Universal Time) +Last updated at Wed May 15 2024 08:07:55 GMT+0000 (Coordinated Universal Time) -->

@@ -18,8 +18,8 @@ Last updated at Tue May 07 2024 20:53:27 GMT+0000 (Coordinated Universal Time) Specification - - Release + + Release
@@ -47,7 +47,7 @@ Capabilities include: ### Requirements -- Node.js version 16+ +- Node.js version 18+ - NestJS version 8+ ### Install diff --git a/docs/reference/technologies/server/php.mdx b/docs/reference/technologies/server/php.mdx index 29eb56430..11a455a2c 100644 --- a/docs/reference/technologies/server/php.mdx +++ b/docs/reference/technologies/server/php.mdx @@ -9,7 +9,7 @@ This content has been automatically generated from php-sdk. Edits should be made here: https://github.com/open-feature/php-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Tue May 07 2024 20:53:28 GMT+0000 (Coordinated Universal Time) +Last updated at Wed May 15 2024 08:07:55 GMT+0000 (Coordinated Universal Time) -->

diff --git a/docs/reference/technologies/server/python.mdx b/docs/reference/technologies/server/python.mdx index 2e7919d6c..2212c8ad2 100644 --- a/docs/reference/technologies/server/python.mdx +++ b/docs/reference/technologies/server/python.mdx @@ -9,7 +9,7 @@ This content has been automatically generated from python-sdk. Edits should be made here: https://github.com/open-feature/python-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Tue May 07 2024 20:53:28 GMT+0000 (Coordinated Universal Time) +Last updated at Wed May 15 2024 08:07:55 GMT+0000 (Coordinated Universal Time) -->

diff --git a/src/datasets/sdks/sdk-compatibility.json b/src/datasets/sdks/sdk-compatibility.json index 4ca3e943a..2942718d7 100644 --- a/src/datasets/sdks/sdk-compatibility.json +++ b/src/datasets/sdks/sdk-compatibility.json @@ -56,8 +56,8 @@ "path": "/docs/reference/technologies/server/javascript", "category": "Server", "release": { - "href": "https://github.com/open-feature/js-sdk/releases/tag/server-sdk-v1.13.5", - "version": "1.13.5", + "href": "https://github.com/open-feature/js-sdk/releases/tag/server-sdk-v1.14.0", + "version": "1.14.0", "stable": true }, "spec": { @@ -316,8 +316,8 @@ "path": "/docs/reference/technologies/client/web", "category": "Client", "release": { - "href": "https://github.com/open-feature/js-sdk/releases/tag/web-sdk-v1.0.3", - "version": "1.0.3", + "href": "https://github.com/open-feature/js-sdk/releases/tag/web-sdk-v1.1.0", + "version": "1.1.0", "stable": true }, "spec": {