diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b37043b..6f58add8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to the LaunchDarkly client-side JavaScript SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org). +## [2.4.1] - 2018-08-14 +### Fixed: +- The result value of `identify()` (provided by either a promise or a callback, once the flag values for the new user have been retrieved) used to be a simple map of flag keys to values, until it was accidentally changed to an internal data structure in version 2.0.0. It is now a map of flag keys to values again, consistent with what is returned by `allFlags()`. +- Added TypeScript definitions for the result values of `identify()`. (Thanks, [1999](https://github.com/launchdarkly/js-client/pull/102)!) +- Documented all optional compatibility polyfills in `README.md`. + ## [2.4.0] - 2018-07-12 ### Added: - Named exports for the `initialize` method and `version` number exports. diff --git a/README.md b/README.md index 94fd592c..e2214596 100644 --- a/README.md +++ b/README.md @@ -28,17 +28,22 @@ when `client.on('change')` is called. ### EventSource polyfill If you need streaming support, and you wish to support browsers that do not -support `EventSource` natively, you can install a polyfill, such as +support `EventSource` natively, you can install a polyfill such as [EventSource](https://github.com/Yaffle/EventSource). -You can load the polyfill via a script tag in the `
` before the script -where you initialize `LDClient`: +#### CDN - +You can load the polyfill via a script tag in the `` before the script where you initialize `LDClient`: -If you use [webpack](https://webpack.github.io/) or -[browserify](http://browserify.org/), make sure to require the polyfill before -`LDClient` is initialized. + + +#### NPM or Yarn + + npm install event-source-polyfill@0.0.12 + +Then import it before the module that initializes the LaunchDarkly client: + + require('event-source-polyfill'); ### Document.querySelectorAll() polyfill @@ -46,11 +51,39 @@ If you need to run A/B tests on IE7 or IE8 you will need to install a polyfill for `document.querySelector()` such as [polyfill-queryselector](https://github.com/cobbdb/polyfill-queryselector). -You can load the polyfll via a script tag in the ``: +#### CDN + +You can load the polyfill via a script tag in the `` before the script where you initialize `LDClient`: + + + +#### NPM or Yarn + + npm install polyfill-queryselector@1.0.2 + +Then import it before the module that initializes the LaunchDarkly client: + + require('polyfill-queryselector'); + +### Promise polyfill + +The newer versions of the use `Promise`. If you need to support older browsers, you will +need to install a polyfill for it, such as [es6-promise](https://github.com/stefanpenner/es6-promise). + +#### CDN + +You can load the polyfill via a script tag in the `` before the script where you initialize `LDClient`: + + + +#### NPM or Yarn + + npm install es6-promise@4.2.4 + +Then import it before the module that initializes the LaunchDarkly client: - + require('es6-promise/auto'); -You can also install it with `npm install polyfill-queryselector` or `bower install polyfill-queryselector`. ## Installation diff --git a/package-lock.json b/package-lock.json index 7ae9e1b7..14e87b43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ldclient-js", - "version": "2.1.2", + "version": "2.4.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 32aa5f9c..2328a91b 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ldclient-js", - "version": "2.4.0", + "version": "2.4.1", "description": "LaunchDarkly SDK for JavaScript", "author": "LaunchDarkly