Release 3.3.0-beta
Pre-release
Pre-release
[3.3.0-beta] - August 21st, 2019
New Features
- Added support for event batching via the event processor.
- Events generated by methods like
activate,track, andisFeatureEnabledwill be held in a queue until the configured batch size is reached, or the configured flush interval has elapsed. Then, they will be combined into a request and sent to the event dispatcher. - To configure event batching, include the
eventBatchSizeandeventFlushIntervalnumber properties in the object you pass tocreateInstance. - Event batching is enabled by default.
eventBatchSizedefaults to10.eventFlushIntervaldefaults to30000in Node and1000in browsers.
- Events generated by methods like
- Added
localStoragemitigation against lost events in the browser- When event requests are dispatched, they are written to
localStorage, and when a response is received, they are removed fromlocalStorage. - When the SDK is initialized for the first time in the browser, if any requests remain in
localStorage, they will be sent, and removed fromlocalStoragewhen a response is received.
- When event requests are dispatched, they are written to
- Updated the
closemethod to return aPromiserepresenting the process of closing the instance. Whencloseis called, any events waiting to be sent as part of a batched event request will be immediately batched and sent to the event dispatcher.- If any such requests were sent to the event dispatcher,
closereturns aPromisethat fulfills after the event dispatcher calls the response callback for each request. Otherwise,closereturns an immediately-fulfilledPromise. - The
Promisereturned fromcloseis fulfilled with a result object containingsuccess(boolean) andreason(string, only when success isfalse) properties. In the result object,successistrueif all events in the queue at the time close was called were combined into requests, sent to the event dispatcher, and the event dispatcher called the callbacks for each request.successis false if an unexpected error was encountered during the close process.
- If any such requests were sent to the event dispatcher,
- Added non-typed
getFeatureVariablemethod (#298) as a more idiomatic approach to getting values of feature variables.- Typed
getFeatureVariablemethods will still be available for use.
- Typed