Javascript-SDK - 4.0.0
3 min
[4.0.0] - April 30, 2020
New Features
- Removed lodash dependency
- ES module entry point for the browser - "module" property of package.json points to dist/optimizely.browser.es.min.js (#445)
Breaking Changes
- Removed Promise polyfill from browser entry point (417).
- Changed functionality of JSON schema validation in all entry points (442).
- Previously, skipJSONValidation flag was used by the user to specify whether the JSON object should be validated.
- Now, skipJSONValidation has been removed entirely from all entry points. Instead, a user will need to import jsonSchemaValidator from @optimizely/optimizely-sdk/dist/optimizely.json_schema_validator.min.js and pass it to createInstance to perform validation as shown below:
const optimizelySDK = require('@optimizely/optimizely-sdk');
const jsonSchemaValidator = require('@optimizely/optimizely-sdk/dist/optimizely.json_schema_validator.min');
// Require JSON schema validation for the datafile
var optimizelyClientInstance = optimizely.createInstance({
datafile: datafile,
jsonSchemaValidator: jsonSchemaValidator,
});- Dropped support for Node.js version <8 (#456)
Bug fixes
- Changed track() to log a warning instead of an error when the event isn't in the datafile (#418)
- Fixed return type for close method in TypeScript type definitions (#410)
- Node.js datafile manager uses gzip,deflate compression for requests (#456)