Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [6.3.1] - January 26, 2026

### Changed
- **Updated event retry default config**: Adjusted default retry configuration for event processing ([#1131](https://github.com/optimizely/javascript-sdk/pull/1131))

### Bug Fixes
- **Fix UNSTABLE_conditionEvaluators option**: pass custom condition evaluators to decision service ([#1133](https://github.com/optimizely/javascript-sdk/pull/1133))

## [6.3.0] - November 19, 2025

### New Features
Expand Down
36 changes: 34 additions & 2 deletions lib/client_factory.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2025, Optimizely
* Copyright 2025-2026, Optimizely
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,13 +14,25 @@
* limitations under the License.
*/

import { describe, it, expect } from 'vitest';
import { describe, it, expect, vi, beforeEach } from 'vitest';

vi.mock('./optimizely', () => {
return {
default: vi.fn(),
};
});

import { getOptimizelyInstance } from './client_factory';
import { createStaticProjectConfigManager } from './project_config/config_manager_factory';
import Optimizely from './optimizely';

describe('getOptimizelyInstance', () => {
const MockedOptimizely = vi.mocked(Optimizely);

beforeEach(() => {
MockedOptimizely.mockClear();
});

it('should throw if the projectConfigManager is not a valid ProjectConfigManager', () => {
expect(() => getOptimizelyInstance({
projectConfigManager: undefined as any,
Expand Down Expand Up @@ -58,4 +70,24 @@ describe('getOptimizelyInstance', () => {

expect(optimizelyInstance).toBeInstanceOf(Optimizely);
});

it('should pass the provided UNSTABLE_conditionEvaluators to the Optimizely instance', () => {
const mockConditionEvaluators = {
foo: () => true,
bar: () => false,
};

const optimizely = getOptimizelyInstance({
projectConfigManager: createStaticProjectConfigManager({
datafile: '{}',
}),
requestHandler: {} as any,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
UNSTABLE_conditionEvaluators: mockConditionEvaluators,
});

expect(optimizely).toBe(MockedOptimizely.mock.instances[0]);
expect(MockedOptimizely.mock.calls[0][0].UNSTABLE_conditionEvaluators).toBe(mockConditionEvaluators);
});
});
4 changes: 2 additions & 2 deletions lib/index.browser.tests.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2016-2020, 2022-2025 Optimizely
* Copyright 2016-2020, 2022-2026 Optimizely
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -153,7 +153,7 @@ describe('javascript-sdk (Browser)', function() {
});

assert.instanceOf(optlyInstance, Optimizely);
assert.equal(optlyInstance.clientVersion, '6.3.0');
assert.equal(optlyInstance.clientVersion, '6.3.1');
});

it('should set the JavaScript client engine and version', function() {
Expand Down
4 changes: 2 additions & 2 deletions lib/index.node.tests.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2016-2020, 2022-2025 Optimizely
* Copyright 2016-2020, 2022-2026 Optimizely
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -88,7 +88,7 @@ describe('optimizelyFactory', function() {
});

assert.instanceOf(optlyInstance, Optimizely);
assert.equal(optlyInstance.clientVersion, '6.3.0');
assert.equal(optlyInstance.clientVersion, '6.3.1');
});
// TODO: user will create and inject an event processor
// these tests will be refactored accordingly
Expand Down
4 changes: 2 additions & 2 deletions lib/index.react_native.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019-2020, 2022-2025 Optimizely
* Copyright 2019-2020, 2022-2026 Optimizely
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -92,7 +92,7 @@ describe('javascript-sdk/react-native', () => {
expect(optlyInstance).toBeInstanceOf(Optimizely);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
expect(optlyInstance.clientVersion).toEqual('6.3.0');
expect(optlyInstance.clientVersion).toEqual('6.3.1');
});

it('should set the React Native JS client engine and javascript SDK version', () => {
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/enums/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2016-2025, Optimizely
* Copyright 2016-2026, Optimizely
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -44,7 +44,7 @@ export const CONTROL_ATTRIBUTES = {
export const JAVASCRIPT_CLIENT_ENGINE = 'javascript-sdk';
export const NODE_CLIENT_ENGINE = 'node-sdk';
export const REACT_NATIVE_JS_CLIENT_ENGINE = 'react-native-js-sdk';
export const CLIENT_VERSION = '6.3.0';
export const CLIENT_VERSION = '6.3.1';

/*
* Represents the source of a decision for feature management. When a feature
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@optimizely/optimizely-sdk",
"version": "6.3.0",
"version": "6.3.1",
"description": "JavaScript SDK for Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts",
"main": "./dist/index.node.min.js",
"browser": "./dist/index.browser.es.min.js",
Expand Down
3 changes: 2 additions & 1 deletion vitest.browser.config.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2025, Optimizely
* Copyright 2025-2026, Optimizely
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -171,6 +171,7 @@ export default defineConfig({
typecheck: {
enabled: true,
tsconfig: 'tsconfig.spec.json',
exclude: ['.build/**', 'dist/**', 'node_modules/**'],
},
},
});
3 changes: 2 additions & 1 deletion vitest.config.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2024-2025, Optimizely
* Copyright 2024-2026, Optimizely
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,6 +31,7 @@ export default defineConfig({
typecheck: {
enabled: true,
tsconfig: 'tsconfig.spec.json',
exclude: ['.build/**', 'dist/**', 'node_modules/**'],
},
},
});
3 changes: 2 additions & 1 deletion vitest.umd.config.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2025, Optimizely
* Copyright 2025-2026, Optimizely
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -164,6 +164,7 @@ export default defineConfig({
typecheck: {
enabled: true,
tsconfig: 'tsconfig.spec.json',
exclude: ['.build/**', 'dist/**', 'node_modules/**'],
},
},
});
Loading