Skip to content

Commit b83b481

Browse files
author
Mike Ng
committed
Bump version to 1.0.0
Summary: Fixes references to Full Stack and also bumps to General Availability version 1.0.0. Test Plan: Unit Reviewers: #oasis_team_review Differential Revision: https://phabricator.optimizely.com/D13153
1 parent c5bca24 commit b83b481

File tree

7 files changed

+45
-10
lines changed

7 files changed

+45
-10
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ node_js:
66
branches:
77
only:
88
- master
9+
- devel
910
install: "npm install"
1011
script:
1112
- "npm test"

CHANGELOG

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
-------------------------------------------------------------------------------
2+
1.0.0
3+
-------------------------------------------------------------------------------
4+
* Introduce support for Full Stack projects in Optimizely X with no breaking changes from previous version.
5+
* Introduce more graceful exception handling in instantiation and core methods.
6+
* Update whitelisting to take precedence over audience condition evaluation.
7+
* Fix bug activating/tracking with attributes not in the datafile.
8+
-------------------------------------------------------------------------------
9+
110
-------------------------------------------------------------------------------
211
0.1.4
312
-------------------------------------------------------------------------------

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Optimizely JavaScript SDK
22

3-
This repository houses the JavaScript SDK for Optimizely's server-side testing product, which is currently in private beta.
3+
This repository houses the JavaScript SDK for Optimizely X Full Stack.
44

55
##Getting Started
66

@@ -13,7 +13,7 @@ npm install optimizely-client-sdk --save
1313
```
1414

1515
###Using the SDK
16-
See the Optimizely server-side testing [developer documentation](http://developers.optimizely.com/server/reference/index.html) to learn how to set up your first custom project and use the SDK. **Please note that you must be a member of the private server-side testing beta to create custom projects and use this SDK.**
16+
See the Optimizely X Full Stack testing [developer documentation](http://developers.optimizely.com/server/reference/index.html) to learn how to set up your first JavaScript project and use the SDK.
1717

1818
##Development
1919

dist/optimizely.min.js

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

index.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ var logger = require('optimizely-server-sdk/lib/plugins/logger');
77

88
var Optimizely = require('optimizely-server-sdk/lib/optimizely');
99

10+
var JAVASCRIPT_CLIENT_VERSION = '1.0.0';
11+
var MODULE_NAME = 'INDEX';
12+
1013
/**
1114
* Entry point into the Optimizely Node testing SDK
1215
*/
@@ -26,12 +29,21 @@ module.exports = {
2629
if (config) {
2730
try {
2831
configValidator.validate(config);
32+
config.isValidInstance = true;
2933
} catch (ex) {
30-
defaultLogger.log(enums.LOG_LEVEL.ERROR, ex.message);
34+
var errorMessage = MODULE_NAME + ':' + ex.message;
35+
if (config.logger) {
36+
config.logger.log(enums.LOG_LEVEL.ERROR, errorMessage);
37+
} else {
38+
defaultLogger.log(enums.LOG_LEVEL.ERROR, errorMessage);
39+
}
40+
config.isValidInstance = false;
3141
}
3242
}
3343

3444
config = _.assignIn({
45+
clientEngine: enums.JAVASCRIPT_CLIENT_ENGINE,
46+
clientVersion: JAVASCRIPT_CLIENT_VERSION,
3547
errorHandler: defaultErrorHandler,
3648
eventDispatcher: defaultEventDispatcher,
3749
logger: logger.createLogger({ logLevel: enums.LOG_LEVEL.INFO }),

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "optimizely-client-sdk",
3-
"version": "0.1.4",
4-
"description": "Javascript SDK for client testing",
3+
"version": "1.0.0",
4+
"description": "JavaScript SDK for client testing",
55
"main": "index.js",
66
"scripts": {
77
"test": "./node_modules/.bin/mocha ./tests.js",
@@ -21,7 +21,7 @@
2121
"dependencies": {
2222
"es6-promise": "^3.3.1",
2323
"lodash": "^4.13.1",
24-
"optimizely-server-sdk": "^0.1.4"
24+
"optimizely-server-sdk": "^1.0.0"
2525
},
2626
"devDependencies": {
2727
"chai": "^3.5.0",

tests.js

+13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var configValidator = require('optimizely-server-sdk/lib/utils/config_validator');
22
var Optimizely = require('optimizely-server-sdk/lib/optimizely');
33
var optimizelyFactory = require('./');
4+
var packageJSON = require('./package.json');
45

56
var chai = require('chai');
67
var assert = chai.assert;
@@ -42,6 +43,18 @@ describe('javascript-sdk', function() {
4243

4344
assert.instanceOf(optlyInstance, Optimizely);
4445
});
46+
47+
it('should set the Javascript client engine and version', function() {
48+
var optlyInstance = optimizelyFactory.createInstance({
49+
datafile: {},
50+
errorHandler: fakeErrorHandler,
51+
eventDispatcher: fakeEventDispatcher,
52+
logger: fakeLogger,
53+
});
54+
55+
assert.equal('javascript-sdk', optlyInstance.clientEngine);
56+
assert.equal(packageJSON.version, optlyInstance.clientVersion);
57+
});
4558
});
4659
});
4760
});

0 commit comments

Comments
 (0)