Skip to content

Marking activate listener as deprecated and preparing for 3.1.0 release #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 22, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
46 changes: 46 additions & 0 deletions packages/optimizely-sdk/CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,52 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
Changes that have landed but are not yet released.

## [3.1.0] - April 22nd, 2019

### New Features:

- Introduced Decision notification listener to be able to record:
- Variation assignments for users activated in an experiment.
- Feature access for users.
- Feature variable value for users.

### Changed

* New APIs for setting `logger` and `logLevel` on the optimizelySDK singleton ([#232](https://github.com/optimizely/javascript-sdk/pull/232))
* `logger` and `logLevel` are now set globally for all instances of Optimizely. If you were passing
different loggers to individual instances of Optimizely, logging behavior may now be different.

#### Setting a ConsoleLogger

```js
var optimizelySDK = require('@optimizely/optimizely-sdk')

// logger and logLevel are now set on the optimizelySDK singleton
optimizelySDK.setLogger(optimizelySDK.logging.createLogger())

// valid levels: 'DEBUG', 'INFO', 'WARN', 'ERROR'
optimizelySDK.setLogLevel('WARN')
// enums can also be used
optimizelySDK.setLogLevel(optimizelySDK.enums.LOG_LEVEL.ERROR)
```

#### Disable logging

```js
var optimizelySDK = require('@optimizely/optimizely-sdk')

optimizelySDK.setLogger(null)
```

### Bug Fixes

* Feature variable APIs now return default variable value when featureEnabled property is false. ([#249](https://github.com/optimizely/javascript-sdk/pull/249))

### Deprecated

* 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.


## [3.1.0-beta1] - March 5th, 2019

### Changed
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizely-sdk/lib/index.browser.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe('javascript-sdk', function() {
});

assert.instanceOf(optlyInstance, Optimizely);
assert.equal(optlyInstance.clientVersion, '3.1.0-beta1');
assert.equal(optlyInstance.clientVersion, '3.1.0');
});

it('should set the JavaScript client engine and version', function() {
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizely-sdk/lib/index.node.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('optimizelyFactory', function() {
});

assert.instanceOf(optlyInstance, Optimizely);
assert.equal(optlyInstance.clientVersion, '3.1.0-beta1');
assert.equal(optlyInstance.clientVersion, '3.1.0');
});
});
});
Expand Down
20 changes: 11 additions & 9 deletions packages/optimizely-sdk/lib/utils/enums/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,15 @@ exports.CONTROL_ATTRIBUTES = {

exports.JAVASCRIPT_CLIENT_ENGINE = 'javascript-sdk';
exports.NODE_CLIENT_ENGINE = 'node-sdk';
exports.NODE_CLIENT_VERSION = '3.1.0-beta1';
exports.NODE_CLIENT_VERSION = '3.1.0';

/*
* Notification types for use with NotificationCenter
* Format is EVENT: <list of parameters to callback>
*
* SDK consumers can use these to register callbacks with the notification center.
*
* @deprecated since 3.1.0
* ACTIVATE: An impression event will be sent to Optimizely
* Callbacks will receive an object argument with the following properties:
* - experiment {Object}
Expand All @@ -168,25 +169,26 @@ exports.NODE_CLIENT_VERSION = '3.1.0-beta1';
* - variation {Object}
* - logEvent {Object}
*
* DECISION: A decision is made in the system. i.e. user activation,
* feature access or feature-variable value retrieval
* Callbacks will receive an object argument with the following properties:
* - type {string}
* - userId {string}
* - attributes {Object|undefined}
* - decisionInfo {Object|undefined}
*
* TRACK: A conversion event will be sent to Optimizely
* Callbacks will receive the an object argument with the following properties:
* - eventKey {string}
* - userId {string}
* - attributes {Object|undefined}
* - eventTags {Object|undefined}
* - logEvent {Object}
* DECISION: A decision is made in the system. i.e. user activation,
* feature access or feature-variable value retrieval
* Callbacks will receive an object argument with the following properties:
* - type {string}
* - userId {string}
* - attributes {Object|undefined}
* - decisionInfo {Object|undefined}
*/
exports.NOTIFICATION_TYPES = {
ACTIVATE: 'ACTIVATE:experiment, user_id,attributes, variation, event',
TRACK: 'TRACK:event_key, user_id, attributes, event_tags, event',
DECISION: 'DECISION:type, userId, attributes, decisionInfo',
TRACK: 'TRACK:event_key, user_id, attributes, event_tags, event',
};

exports.DECISION_NOTIFICATION_TYPES = {
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizely-sdk/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 packages/optimizely-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@optimizely/optimizely-sdk",
"version": "3.1.0-beta1",
"version": "3.1.0",
"description": "JavaScript SDK for Optimizely X Full Stack",
"main": "lib/index.node.js",
"browser": "lib/index.browser.js",
Expand Down