Skip to content

Commit 0bff2d9

Browse files
[FSSDK-12659] release prep (#337)
1 parent 264693f commit 0bff2d9

3 files changed

Lines changed: 56 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,58 @@
11
# Changelog
22

3+
## [4.0.0] - May 18, 2026
4+
5+
v4 is a ground-up rewrite of the React SDK. For a detailed upgrade guide, see [MIGRATION.md](MIGRATION.md). For the official documentation, see the [React SDK Developer Docs](https://docs.developers.optimizely.com/feature-experimentation/docs/javascript-react-sdk).
6+
7+
### New Features
8+
9+
- **New hook API**`useDecide`, `useDecideForKeys`, `useDecideAll` replace the old `useDecision`, `useExperiment`, and `useFeature` hooks. Return type changed from positional tuples (`[decision, clientReady, didTimeout]`) to discriminated union objects (`{ decision, isLoading, error }`).
10+
- **Async decision hooks**`useDecideAsync`, `useDecideForKeysAsync`, `useDecideAllAsync` for use with CMAB (Contextual Multi-Armed Bandit) experiments and async User Profile Service lookups.
11+
- **`useOptimizelyClient` hook** — Access the Optimizely `Client` instance directly (replaces `withOptimizely` HOC).
12+
- **`useOptimizelyUserContext` hook** — Access the current `OptimizelyUserContext`, with `{ userContext, isLoading, error }` return type. Use for event tracking and forced decisions.
13+
- **Modular client configuration**`createInstance` now accepts dedicated factory-created components (`createPollingProjectConfigManager`, `createStaticProjectConfigManager`, `createBatchEventProcessor`, `createForwardingEventProcessor`, `createOdpManager`, `createVuidManager`, `createErrorNotifier`, `createLogger`) for granular control and smaller bundles.
14+
- **CMAB support** — Contextual Multi-Armed Bandit experiments via async decide hooks (`useDecideAsync`). New decide options: `IGNORE_CMAB_CACHE`, `RESET_CMAB_CACHE`, `INVALIDATE_USER_CMAB_CACHE`.
15+
- **Holdouts support** — Holdouts Feature Experimentation capability.
16+
- **Feature Rollouts** — A new experiment type combining Targeted Delivery simplicity with A/B test measurement capabilities, including full impact analytics and metric tracking.
17+
- **Async User Profile Service** — Support for asynchronous user profile service lookups.
18+
- **`getSendBeaconEventDispatcher` export** — New event dispatcher using the Beacon API for reliable event delivery on page unload.
19+
20+
### Breaking Changes
21+
22+
- **Underlying JS SDK upgraded from v5 to v6** — See the [JavaScript SDK v6 Migration Guide](https://github.com/optimizely/javascript-sdk/blob/master/MIGRATION.md) for details.
23+
- **ESM only** — No CommonJS entry point. Projects using `require()` must switch to ESM imports or configure their bundler.
24+
- **Node.js >=18.0.0 required** (was >=14.0.0).
25+
- **Provider prop renamed**`optimizely``client`.
26+
- **Provider `user` prop no longer accepts a `Promise`** — Resolve the user before rendering.
27+
- **Removed Provider props**`isServerSide`, `userId`, `userAttributes`.
28+
- **Default `timeout` changed** — From `5000` ms to `30000` ms.
29+
- **`onReady()` behavior changed** — Resolves on success, rejects on failure (no longer returns `{ success, reason }`).
30+
- **`createInstance` throws on invalid config** (previously returned `null`).
31+
- **Event processing, ODP, VUID, and logging are opt-in** — Must be explicitly enabled via factory functions.
32+
- **Removed components**`OptimizelyExperiment`, `OptimizelyFeature`, `OptimizelyVariation`.
33+
- **Removed HOC**`withOptimizely`.
34+
- **Removed hooks**`useDecision` (renamed to `useDecide`), `useExperiment`, `useFeature`, `useTrackEvent`.
35+
- **Removed per-hook `autoUpdate` option** — Hooks now automatically re-evaluate on datafile polling updates. No opt-in needed.
36+
- **Removed per-hook `overrideUserId` / `overrideAttributes`** — Use separate `<OptimizelyProvider>` instances for different users instead.
37+
- **Removed exports**`ReactSDKClient`, `OptimizelyContext`, `setLogger`, `setLogLevel`, `logOnlyEventDispatcher`, `enums`, `logging`, `errorHandler`.
38+
- **`createLogger` replaces `setLogger`/`setLogLevel`** — Logging disabled by default; pass `createLogger({ logLevel })` to `createInstance`.
39+
- **`getQualifiedSegments` return type changed** — Now returns `{ segments, error }` instead of `string[] | null`.
40+
41+
### Changed
42+
43+
- **Null/undefined user behavior** — Provider now accepts `user={null}` in addition to `undefined`. When no user is provided, hooks return `{ isLoading: true }` instead of attempting to create a user context.
44+
45+
## [3.4.0] - Mar 9, 2026
46+
47+
### New Features
48+
- Add a server-safe bundle that is automatically resolved when imported in React Server Components, excluding client-only React APIs ([#318](https://github.com/optimizely/react-sdk/pull/318))
49+
- Add `qualifiedSegments` prop to `OptimizelyProvider` for passing pre-fetched ODP segments, enabling synchronous ODP-based decisions during SSR ([#318](https://github.com/optimizely/react-sdk/pull/318))
50+
- Add `getQualifiedSegments` utility for fetching ODP audience segments server-side ([#318](https://github.com/optimizely/react-sdk/pull/318))
51+
52+
### Enhancements
53+
- Improve `useExperiment`, `useFeature`, and `useDecision` hooks to compute decisions when config and user context (including segments) are available, without waiting for `onReady` ([#318](https://github.com/optimizely/react-sdk/pull/318))
54+
- Add comprehensive server-side rendering integration guide covering SSR, SSG, and App Router patterns ([#318](https://github.com/optimizely/react-sdk/pull/318))
55+
356
## [3.3.1] - Dec 8, 2025
457

558
### Changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@optimizely/react-sdk",
3-
"version": "3.3.1",
3+
"version": "4.0.0",
44
"description": "React SDK for Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts",
55
"homepage": "https://github.com/optimizely/react-sdk",
66
"repository": "https://github.com/optimizely/react-sdk",

0 commit comments

Comments
 (0)