Skip to content

Commit d11c847

Browse files
authored
[FSSDK-9096] chore: Prepare release 5.0.0-beta (#822)
1 parent 082c086 commit d11c847

File tree

8 files changed

+221
-179
lines changed

8 files changed

+221
-179
lines changed

packages/optimizely-sdk/CHANGELOG.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,49 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10-
### Breaking Changes
10+
## 5.0.0-beta
11+
May 4, 2023
12+
13+
### New Features
14+
15+
The 5.0.0-beta release introduces a new primary feature, [Advanced Audience Targeting]( https://docs.developers.optimizely.com/feature-experimentation/docs/optimizely-data-platform-advanced-audience-targeting) enabled through integration with [Optimizely Data Platform (ODP)](https://docs.developers.optimizely.com/optimizely-data-platform/docs) ([#765](https://github.com/optimizely/javascript-sdk/pull/765), [#775](https://github.com/optimizely/javascript-sdk/pull/775), [#776](https://github.com/optimizely/javascript-sdk/pull/776), [#777](https://github.com/optimizely/javascript-sdk/pull/777), [#778](https://github.com/optimizely/javascript-sdk/pull/778), [#786](https://github.com/optimizely/javascript-sdk/pull/786), [#789](https://github.com/optimizely/javascript-sdk/pull/789), [#790](https://github.com/optimizely/javascript-sdk/pull/790), [#797](https://github.com/optimizely/javascript-sdk/pull/797), [#799](https://github.com/optimizely/javascript-sdk/pull/799), [#808](https://github.com/optimizely/javascript-sdk/pull/808)).
16+
17+
You can use ODP, a high-performance [Customer Data Platform (CDP)]( https://www.optimizely.com/optimization-glossary/customer-data-platform/), to easily create complex real-time segments (RTS) using first-party and 50+ third-party data sources out of the box. You can create custom schemas that support the user attributes important for your business, and stitch together user behavior done on different devices to better understand and target your customers for personalized user experiences. ODP can be used as a single source of truth for these segments in any Optimizely or 3rd party tool.
18+
19+
With ODP accounts integrated into Optimizely projects, you can build audiences using segments pre-defined in ODP. The SDK will fetch the segments for given users and make decisions using the segments. For access to ODP audience targeting in your Feature Experimentation account, please contact your Customer Success Manager.
20+
21+
This version includes the following changes:
22+
23+
- New API added to `OptimizelyUserContext`:
24+
25+
- `fetchQualifiedSegments()`: this API will retrieve user segments from the ODP server. The fetched segments will be used for audience evaluation. The fetched data will be stored in the local cache to avoid repeated network delays.
26+
27+
- When an `OptimizelyUserContext` is created, the SDK will automatically send an identify request to the ODP server to facilitate observing user activities.
28+
29+
- New APIs added to `OptimizelyClient`:
30+
31+
- `sendOdpEvent()`: customers can build/send arbitrary ODP events that will bind user identifiers and data to user profiles in ODP.
32+
33+
- `createUserContext()` with anonymous user IDs: user-contexts can be created without a userId. The SDK will create and use a persistent `VUID` specific to a device when userId is not provided.
34+
35+
For details, refer to our documentation pages:
36+
37+
- [Advanced Audience Targeting](https://docs.developers.optimizely.com/feature-experimentation/docs/optimizely-data-platform-advanced-audience-targeting)
38+
39+
- [Client SDK Support](https://docs.developers.optimizely.com/feature-experimentation/v1.0/docs/advanced-audience-targeting-for-client-side-sdks)
40+
41+
- [Initialize JavaScript SDK](https://docs.developers.optimizely.com/feature-experimentation/docs/initialize-sdk-javascript-aat)
42+
43+
- [OptimizelyUserContext JavaScript SDK](https://docs.developers.optimizely.com/feature-experimentation/docs/optimizelyusercontext-javascript-aat)
44+
45+
- [Advanced Audience Targeting segment qualification methods](https://docs.developers.optimizely.com/feature-experimentation/docs/advanced-audience-targeting-segment-qualification-methods-javascript)
46+
47+
- [Send Optimizely Data Platform data using Advanced Audience Targeting](https://docs.developers.optimizely.com/feature-experimentation/docs/send-odp-data-using-advanced-audience-targeting-javascript)
48+
49+
Additionally, a handful of major package updates are also included in this release including `murmurhash`, `uuid`, and others. For more information, check out the **Breaking Changes** section below. ([#762](https://github.com/optimizely/javascript-sdk/pull/762))
50+
51+
### Breaking Changes
52+
- `ODPManager` in the SDK is enabled by default. Unless an ODP account is integrated into the Optimizely projects, most `ODPManager` functions will be ignored. If needed, `ODPManager` can be disabled when `OptimizelyClient` is instantiated.
1153
- Updated `murmurhash` dependency to version `2.0.1`.
1254
- Updated `uuid` dependency to version `8.3.2`.
1355
- Dropped support for the following browser versions.
@@ -19,6 +61,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1961
- Safari versions earlier than `13.0`.
2062
- Dropped support for Node JS versions earlier than `14`.
2163

64+
## Changed
65+
- Updated `createUserContext`'s `userId` parameter to be optional due to the Browser variation's use of the new `vuid` field. Note: The Node variation of the SDK does **not** use the new `vuid` field and you should pass in a `userId` when within the context of the Node variant.
66+
2267
## [4.9.3] - March 17, 2023
2368

2469
### Changed

packages/optimizely-sdk/lib/index.browser.tests.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ describe('javascript-sdk (Browser)', function() {
187187
optlyInstance.onReady().catch(function() {});
188188

189189
assert.instanceOf(optlyInstance, Optimizely);
190-
assert.equal(optlyInstance.clientVersion, '4.9.3');
190+
assert.equal(optlyInstance.clientVersion, '5.0.0-beta');
191191
});
192192

193193
it('should set the JavaScript client engine and version', function() {
@@ -1055,9 +1055,9 @@ describe('javascript-sdk (Browser)', function() {
10551055
const apiManager = new BrowserOdpEventApiManager(mockRequestHandler, logger);
10561056
sinon.spy(apiManager, 'sendEvents');
10571057
const eventManager = new BrowserOdpEventManager({
1058-
odpConfig,
1059-
apiManager,
1060-
logger,
1058+
odpConfig,
1059+
apiManager,
1060+
logger,
10611061
});
10621062
const datafile = testData.getOdpIntegratedConfigWithSegments();
10631063
const client = optimizelyFactory.createInstance({
@@ -1078,7 +1078,7 @@ describe('javascript-sdk (Browser)', function() {
10781078

10791079
clock.tick(100);
10801080

1081-
const [,,events] = apiManager.sendEvents.getCall(0).args;
1081+
const [, , events] = apiManager.sendEvents.getCall(0).args;
10821082
const [firstEvent] = events;
10831083
assert.equal(firstEvent.action, 'client_initialized');
10841084
assert.equal(firstEvent.type, 'fullstack');

packages/optimizely-sdk/lib/index.lite.tests.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ import * as loggerPlugin from './plugins/logger';
2222
import optimizelyFactory from './index.lite';
2323
import configValidator from './utils/config_validator';
2424

25-
describe('optimizelyFactory', function () {
26-
describe('APIs', function () {
27-
it('should expose logger, errorHandler, eventDispatcher and enums', function () {
25+
describe('optimizelyFactory', function() {
26+
describe('APIs', function() {
27+
it('should expose logger, errorHandler, eventDispatcher and enums', function() {
2828
assert.isDefined(optimizelyFactory.logging);
2929
assert.isDefined(optimizelyFactory.logging.createLogger);
3030
assert.isDefined(optimizelyFactory.logging.createNoOpLogger);
@@ -33,50 +33,50 @@ describe('optimizelyFactory', function () {
3333
assert.isDefined(optimizelyFactory.enums);
3434
});
3535

36-
describe('createInstance', function () {
37-
var fakeErrorHandler = { handleError: function () { } };
38-
var fakeEventDispatcher = { dispatchEvent: function () { } };
36+
describe('createInstance', function() {
37+
var fakeErrorHandler = { handleError: function() {} };
38+
var fakeEventDispatcher = { dispatchEvent: function() {} };
3939
var fakeLogger;
4040

41-
beforeEach(function () {
41+
beforeEach(function() {
4242
fakeLogger = { log: sinon.spy(), setLogLevel: sinon.spy() };
4343
sinon.stub(loggerPlugin, 'createLogger').returns(fakeLogger);
4444
sinon.stub(configValidator, 'validate');
4545
sinon.stub(console, 'error');
4646
});
4747

48-
afterEach(function () {
48+
afterEach(function() {
4949
loggerPlugin.createLogger.restore();
5050
configValidator.validate.restore();
5151
console.error.restore();
5252
});
5353

54-
it('should not throw if the provided config is not valid and log an error if logger is passed in', function () {
54+
it('should not throw if the provided config is not valid and log an error if logger is passed in', function() {
5555
configValidator.validate.throws(new Error('Invalid config or something'));
5656
var localLogger = loggerPlugin.createLogger({ logLevel: enums.LOG_LEVEL.INFO });
57-
assert.doesNotThrow(function () {
57+
assert.doesNotThrow(function() {
5858
var optlyInstance = optimizelyFactory.createInstance({
5959
datafile: {},
6060
logger: localLogger,
6161
});
6262
// Invalid datafile causes onReady Promise rejection - catch this
63-
optlyInstance.onReady().catch(function () { });
63+
optlyInstance.onReady().catch(function() {});
6464
});
6565
sinon.assert.calledWith(localLogger.log, enums.LOG_LEVEL.ERROR);
6666
});
6767

68-
it('should create an instance of optimizely', function () {
68+
it('should create an instance of optimizely', function() {
6969
var optlyInstance = optimizelyFactory.createInstance({
7070
datafile: {},
7171
errorHandler: fakeErrorHandler,
7272
eventDispatcher: fakeEventDispatcher,
7373
logger: fakeLogger,
7474
});
7575
// Invalid datafile causes onReady Promise rejection - catch this
76-
optlyInstance.onReady().catch(function () { });
76+
optlyInstance.onReady().catch(function() {});
7777

7878
assert.instanceOf(optlyInstance, Optimizely);
79-
assert.equal(optlyInstance.clientVersion, '4.9.3');
79+
assert.equal(optlyInstance.clientVersion, '5.0.0-beta');
8080
});
8181
});
8282
});

packages/optimizely-sdk/lib/index.node.tests.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import * as loggerPlugin from './plugins/logger';
2424
import optimizelyFactory from './index.node';
2525
import configValidator from './utils/config_validator';
2626

27-
describe('optimizelyFactory', function () {
28-
describe('APIs', function () {
29-
it('should expose logger, errorHandler, eventDispatcher and enums', function () {
27+
describe('optimizelyFactory', function() {
28+
describe('APIs', function() {
29+
it('should expose logger, errorHandler, eventDispatcher and enums', function() {
3030
assert.isDefined(optimizelyFactory.logging);
3131
assert.isDefined(optimizelyFactory.logging.createLogger);
3232
assert.isDefined(optimizelyFactory.logging.createNoOpLogger);
@@ -35,75 +35,75 @@ describe('optimizelyFactory', function () {
3535
assert.isDefined(optimizelyFactory.enums);
3636
});
3737

38-
describe('createInstance', function () {
39-
var fakeErrorHandler = { handleError: function () { } };
40-
var fakeEventDispatcher = { dispatchEvent: function () { } };
38+
describe('createInstance', function() {
39+
var fakeErrorHandler = { handleError: function() {} };
40+
var fakeEventDispatcher = { dispatchEvent: function() {} };
4141
var fakeLogger;
4242

43-
beforeEach(function () {
43+
beforeEach(function() {
4444
fakeLogger = { log: sinon.spy(), setLogLevel: sinon.spy() };
4545
sinon.stub(loggerPlugin, 'createLogger').returns(fakeLogger);
4646
sinon.stub(configValidator, 'validate');
4747
sinon.stub(console, 'error');
4848
});
4949

50-
afterEach(function () {
50+
afterEach(function() {
5151
loggerPlugin.createLogger.restore();
5252
configValidator.validate.restore();
5353
console.error.restore();
5454
});
5555

56-
it('should not throw if the provided config is not valid and log an error if logger is passed in', function () {
56+
it('should not throw if the provided config is not valid and log an error if logger is passed in', function() {
5757
configValidator.validate.throws(new Error('Invalid config or something'));
5858
var localLogger = loggerPlugin.createLogger({ logLevel: enums.LOG_LEVEL.INFO });
59-
assert.doesNotThrow(function () {
59+
assert.doesNotThrow(function() {
6060
var optlyInstance = optimizelyFactory.createInstance({
6161
datafile: {},
6262
logger: localLogger,
6363
});
6464
// Invalid datafile causes onReady Promise rejection - catch this
65-
optlyInstance.onReady().catch(function () { });
65+
optlyInstance.onReady().catch(function() {});
6666
});
6767
sinon.assert.calledWith(localLogger.log, enums.LOG_LEVEL.ERROR);
6868
});
6969

70-
it('should not throw if the provided config is not valid and log an error if no logger is provided', function () {
70+
it('should not throw if the provided config is not valid and log an error if no logger is provided', function() {
7171
configValidator.validate.throws(new Error('Invalid config or something'));
72-
assert.doesNotThrow(function () {
72+
assert.doesNotThrow(function() {
7373
var optlyInstance = optimizelyFactory.createInstance({
7474
datafile: {},
7575
});
7676
// Invalid datafile causes onReady Promise rejection - catch this
77-
optlyInstance.onReady().catch(function () { });
77+
optlyInstance.onReady().catch(function() {});
7878
});
7979
sinon.assert.calledOnce(console.error);
8080
});
8181

82-
it('should create an instance of optimizely', function () {
82+
it('should create an instance of optimizely', function() {
8383
var optlyInstance = optimizelyFactory.createInstance({
8484
datafile: {},
8585
errorHandler: fakeErrorHandler,
8686
eventDispatcher: fakeEventDispatcher,
8787
logger: fakeLogger,
8888
});
8989
// Invalid datafile causes onReady Promise rejection - catch this
90-
optlyInstance.onReady().catch(function () { });
90+
optlyInstance.onReady().catch(function() {});
9191

9292
assert.instanceOf(optlyInstance, Optimizely);
93-
assert.equal(optlyInstance.clientVersion, '4.9.3');
93+
assert.equal(optlyInstance.clientVersion, '5.0.0-beta');
9494
});
9595

96-
describe('event processor configuration', function () {
96+
describe('event processor configuration', function() {
9797
var eventProcessorSpy;
98-
beforeEach(function () {
98+
beforeEach(function() {
9999
eventProcessorSpy = sinon.stub(eventProcessor, 'createEventProcessor').callThrough();
100100
});
101101

102-
afterEach(function () {
102+
afterEach(function() {
103103
eventProcessor.createEventProcessor.restore();
104104
});
105105

106-
it('should ignore invalid event flush interval and use default instead', function () {
106+
it('should ignore invalid event flush interval and use default instead', function() {
107107
optimizelyFactory.createInstance({
108108
datafile: testData.getTestProjectConfigWithFeatures(),
109109
errorHandler: fakeErrorHandler,
@@ -119,7 +119,7 @@ describe('optimizelyFactory', function () {
119119
);
120120
});
121121

122-
it('should use default event flush interval when none is provided', function () {
122+
it('should use default event flush interval when none is provided', function() {
123123
optimizelyFactory.createInstance({
124124
datafile: testData.getTestProjectConfigWithFeatures(),
125125
errorHandler: fakeErrorHandler,
@@ -134,7 +134,7 @@ describe('optimizelyFactory', function () {
134134
);
135135
});
136136

137-
it('should use provided event flush interval when valid', function () {
137+
it('should use provided event flush interval when valid', function() {
138138
optimizelyFactory.createInstance({
139139
datafile: testData.getTestProjectConfigWithFeatures(),
140140
errorHandler: fakeErrorHandler,
@@ -150,7 +150,7 @@ describe('optimizelyFactory', function () {
150150
);
151151
});
152152

153-
it('should ignore invalid event batch size and use default instead', function () {
153+
it('should ignore invalid event batch size and use default instead', function() {
154154
optimizelyFactory.createInstance({
155155
datafile: testData.getTestProjectConfigWithFeatures(),
156156
errorHandler: fakeErrorHandler,
@@ -166,7 +166,7 @@ describe('optimizelyFactory', function () {
166166
);
167167
});
168168

169-
it('should use default event batch size when none is provided', function () {
169+
it('should use default event batch size when none is provided', function() {
170170
optimizelyFactory.createInstance({
171171
datafile: testData.getTestProjectConfigWithFeatures(),
172172
errorHandler: fakeErrorHandler,
@@ -181,7 +181,7 @@ describe('optimizelyFactory', function () {
181181
);
182182
});
183183

184-
it('should use provided event batch size when valid', function () {
184+
it('should use provided event batch size when valid', function() {
185185
optimizelyFactory.createInstance({
186186
datafile: testData.getTestProjectConfigWithFeatures(),
187187
errorHandler: fakeErrorHandler,

packages/optimizely-sdk/lib/utils/enums/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ export const NODE_CLIENT_ENGINE = 'node-sdk';
223223
export const REACT_CLIENT_ENGINE = 'react-sdk';
224224
export const REACT_NATIVE_CLIENT_ENGINE = 'react-native-sdk';
225225
export const REACT_NATIVE_JS_CLIENT_ENGINE = 'react-native-js-sdk';
226-
export const BROWSER_CLIENT_VERSION = '4.9.3';
227-
export const NODE_CLIENT_VERSION = '4.9.3';
226+
export const BROWSER_CLIENT_VERSION = '5.0.0-beta';
227+
export const NODE_CLIENT_VERSION = '5.0.0-beta';
228228

229229
export const DECISION_NOTIFICATION_TYPES = {
230230
AB_TEST: 'ab-test',

packages/optimizely-sdk/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/optimizely-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@optimizely/optimizely-sdk",
3-
"version": "4.9.3",
3+
"version": "5.0.0-beta",
44
"description": "JavaScript SDK for Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts",
55
"module": "dist/optimizely.browser.es.js",
66
"main": "dist/optimizely.node.min.js",

0 commit comments

Comments
 (0)