Skip to content

Commit 55e2628

Browse files
Marking activate listener as deprecated and preparing for 3.1.0 release (#260)
1 parent cc5ffee commit 55e2628

File tree

6 files changed

+61
-13
lines changed

6 files changed

+61
-13
lines changed

packages/optimizely-sdk/CHANGELOG.MD

+46
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,52 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77
## [Unreleased]
88
Changes that have landed but are not yet released.
99

10+
## [3.1.0] - April 22nd, 2019
11+
12+
### New Features:
13+
14+
- Introduced Decision notification listener to be able to record:
15+
- Variation assignments for users activated in an experiment.
16+
- Feature access for users.
17+
- Feature variable value for users.
18+
19+
### Changed
20+
21+
* New APIs for setting `logger` and `logLevel` on the optimizelySDK singleton ([#232](https://github.com/optimizely/javascript-sdk/pull/232))
22+
* `logger` and `logLevel` are now set globally for all instances of Optimizely. If you were passing
23+
different loggers to individual instances of Optimizely, logging behavior may now be different.
24+
25+
#### Setting a ConsoleLogger
26+
27+
```js
28+
var optimizelySDK = require('@optimizely/optimizely-sdk')
29+
30+
// logger and logLevel are now set on the optimizelySDK singleton
31+
optimizelySDK.setLogger(optimizelySDK.logging.createLogger())
32+
33+
// valid levels: 'DEBUG', 'INFO', 'WARN', 'ERROR'
34+
optimizelySDK.setLogLevel('WARN')
35+
// enums can also be used
36+
optimizelySDK.setLogLevel(optimizelySDK.enums.LOG_LEVEL.ERROR)
37+
```
38+
39+
#### Disable logging
40+
41+
```js
42+
var optimizelySDK = require('@optimizely/optimizely-sdk')
43+
44+
optimizelySDK.setLogger(null)
45+
```
46+
47+
### Bug Fixes
48+
49+
* Feature variable APIs now return default variable value when featureEnabled property is false. ([#249](https://github.com/optimizely/javascript-sdk/pull/249))
50+
51+
### Deprecated
52+
53+
* Activate notification listener is deprecated as of this release. Recommendation is to use the new Decision notification listener. Activate notification listener will be removed in the next major release.
54+
55+
1056
## [3.1.0-beta1] - March 5th, 2019
1157

1258
### Changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ describe('javascript-sdk', function() {
112112
});
113113

114114
assert.instanceOf(optlyInstance, Optimizely);
115-
assert.equal(optlyInstance.clientVersion, '3.1.0-beta1');
115+
assert.equal(optlyInstance.clientVersion, '3.1.0');
116116
});
117117

118118
it('should set the JavaScript client engine and version', function() {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ describe('optimizelyFactory', function() {
8484
});
8585

8686
assert.instanceOf(optlyInstance, Optimizely);
87-
assert.equal(optlyInstance.clientVersion, '3.1.0-beta1');
87+
assert.equal(optlyInstance.clientVersion, '3.1.0');
8888
});
8989
});
9090
});

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

+11-9
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,15 @@ exports.CONTROL_ATTRIBUTES = {
152152

153153
exports.JAVASCRIPT_CLIENT_ENGINE = 'javascript-sdk';
154154
exports.NODE_CLIENT_ENGINE = 'node-sdk';
155-
exports.NODE_CLIENT_VERSION = '3.1.0-beta1';
155+
exports.NODE_CLIENT_VERSION = '3.1.0';
156156

157157
/*
158158
* Notification types for use with NotificationCenter
159159
* Format is EVENT: <list of parameters to callback>
160160
*
161161
* SDK consumers can use these to register callbacks with the notification center.
162162
*
163+
* @deprecated since 3.1.0
163164
* ACTIVATE: An impression event will be sent to Optimizely
164165
* Callbacks will receive an object argument with the following properties:
165166
* - experiment {Object}
@@ -168,25 +169,26 @@ exports.NODE_CLIENT_VERSION = '3.1.0-beta1';
168169
* - variation {Object}
169170
* - logEvent {Object}
170171
*
172+
* DECISION: A decision is made in the system. i.e. user activation,
173+
* feature access or feature-variable value retrieval
174+
* Callbacks will receive an object argument with the following properties:
175+
* - type {string}
176+
* - userId {string}
177+
* - attributes {Object|undefined}
178+
* - decisionInfo {Object|undefined}
179+
*
171180
* TRACK: A conversion event will be sent to Optimizely
172181
* Callbacks will receive the an object argument with the following properties:
173182
* - eventKey {string}
174183
* - userId {string}
175184
* - attributes {Object|undefined}
176185
* - eventTags {Object|undefined}
177186
* - logEvent {Object}
178-
* DECISION: A decision is made in the system. i.e. user activation,
179-
* feature access or feature-variable value retrieval
180-
* Callbacks will receive an object argument with the following properties:
181-
* - type {string}
182-
* - userId {string}
183-
* - attributes {Object|undefined}
184-
* - decisionInfo {Object|undefined}
185187
*/
186188
exports.NOTIFICATION_TYPES = {
187189
ACTIVATE: 'ACTIVATE:experiment, user_id,attributes, variation, event',
188-
TRACK: 'TRACK:event_key, user_id, attributes, event_tags, event',
189190
DECISION: 'DECISION:type, userId, attributes, decisionInfo',
191+
TRACK: 'TRACK:event_key, user_id, attributes, event_tags, event',
190192
};
191193

192194
exports.DECISION_NOTIFICATION_TYPES = {

packages/optimizely-sdk/package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/optimizely-sdk/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@optimizely/optimizely-sdk",
3-
"version": "3.1.0-beta1",
3+
"version": "3.1.0",
44
"description": "JavaScript SDK for Optimizely X Full Stack",
55
"main": "lib/index.node.js",
66
"browser": "lib/index.browser.js",

0 commit comments

Comments
 (0)