Releases: launchdarkly/js-client-sdk
Releases · launchdarkly/js-client-sdk
2.7.3
2.7.2
[2.7.2] - 2018-10-17
Fixed:
- Disconnecting from the stream does not close the browser tab anymore.
(Thanks, Sawtaytoes.) - The configuration property
evaluationReasons
was misnamed asevaluationExplanations
in the TypeScript definitions.
2.7.1
[2.7.1] - 2018-09-27
Fixed:
- Event posts did not include the HTTP header that specifies the SDK version. They now do again. Note that the
sendLDHeaders
option does not affect this; if the header is turned off for flag requests, it should still be sent in events, since events always require a CORS preflight check anyway (and are delivered asynchronously, so the OPTIONS request does not slow down page loads).
2.7.0
[2.7.0] - 2018-09-19
Added:
- New client method
waitForInitialization
returns a Promise, likewaitUntilReady
; but whilewaitUntilReady
will be resolved as soon as client initialization either succeeds or fails,waitForInitialization
will be resolved only if initialization succeeds, and will be rejected (with an error object) if it fails. - New config option
fetchGoals
(default: true) allows you to control whether the client will request A/B testing parameters from LaunchDarkly. If you do not use A/B testing, you may wish to disable this to reduce the number of HTTP requests. - New config option
sendLDHeaders
(default: true) allows you to control whether the client will add a custom header to LaunchDarkly HTTP requests (to indicate the SDK version). You may wish to disable this behavior if you have performance concerns, as it causes browsers to make an additional CORS preflight check (since it is no longer a simple request).
2.6.0
[2.6.0] - 2018-09-07
Added:
- The new configuration option
evaluationReasons
causes LaunchDarkly to report information about how each feature flag value was determined; you can access this information with the new client methodvariationDetail
. The new method returns an object that contains both the flag value and a "reason" object which will tell you, for instance, if the user was individually targeted for the flag or was matched by one of the flag's rules, or if the flag returned the default value due to an error.
Changed:
- In streaming mode, the client will attempt to reconnect if it receives an HTTP error status from LaunchDarkly. Previously, it would only retry if the connection was lost.
2.5.0
[2.5.0] - 2018-08-27
Changed:
- Starting in version 2.0.0, there was a problem where analytics events would not be generated correctly if you initialized the client with bootstrap data, because the bootstrap data did not include some flag metadata that the front end uses for events. The client now supports an extended format for bootstrap data that fixes this problem; this is generated by calling a new method that has been added to the server-side SDKs,
allFlagsState
/all_flags_state
(previouslyallFlags
/all_flags
). Therefore, if you want analytics event data and you are using bootstrap data from the back end, you should upgrade both your JavaScript SDK and your server-side SDK, and useallFlagsState
on the back end. This does not require any changes in your JavaScript code. If you use bootstrap data in the old format, the SDK will still be usable but events will not work correctly. - When posting events to LaunchDarkly, if a request fails, it will be retried once.
- The TypeScript mappings for the SDK were omitted from the distribution in the previous release. They are now in the distribution again, in the root folder instead of in
src
, and have been renamed fromindex.d.ts
totypings.d.ts
.
2.4.1
[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 byallFlags()
. - Added TypeScript definitions for the result values of
identify()
. (Thanks, 1999!) - Documented all optional compatibility polyfills in
README.md
.
2.4.0
2.3.1
[2.3.1] - 2018-06-29
Fixed:
- If a polling request has failed due to an invalid environment key, calling
variation
now returns the default value; previously, it sometimes caused a null reference error.
2.3.0
[2.3.0] - 2018-06-26
Changed:
The client will now stop trying to send analytics events if it receives almost any HTTP 4xx error from LaunchDarkly; such errors indicate either a configuration problem (invalid SDK key) or a bug, which is not likely to resolve without a restart or an upgrade. This does not apply if the error is 400, 408, or 429.