You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MIGRATION.md
+43-38Lines changed: 43 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,10 +21,9 @@ This guide will help you migrate your implementation from Optimizely JavaScript
21
21
In v6, the SDK architecture has been modularized to give you more control over different components:
22
22
23
23
- The monolithic `createInstance` call is now split into multiple factory functions
24
-
- Project configuration management is now configurable through dedicated components
25
-
- Event processing has dedicated implementations for different use cases
26
-
- ODP and VUID management are separate components
27
-
- Logger and error handler are created through factory functions
24
+
- Core functionality (project configuration, event processing, ODP, VUID, logging, and error handling) is now configured through dedicated components created via factory functions, giving you greater flexibility and control in enabling/disabling certain components and allowing optimizing the bundle size for frontend projects.
25
+
- Event dispatcher interface has been updated to use Promises
In v5, ODP functionality was configured via `odpOptions`. In v6, use the dedicated ODP Manager:
201
+
In v5, ODP functionality was configured via `odpOptions` and enabled by default. In v6, instantiate an OdpManager and pass to `createInstance` to enable ODP:
172
202
173
203
### v5 (Before)
174
204
@@ -207,7 +237,7 @@ To disable ODP functionality in v6, simply don't provide an ODP Manager to the c
207
237
208
238
## VUID Management
209
239
210
-
In v6, VUID tracking is disabled by default and must be explicitly enabled:
240
+
In v6, VUID tracking is disabled by default and must be explicitly enabled by createing a vuidManager with `enableVuid` set to `true` and passing it to `createInstance`:
The `onReady()` method behavior has changed in v6. In v5, onReady() fulfilled with an object that had two fields: `success` and `reason`. If the instance failed to initialize, `success` would be `false` and `reason` will contain an error message. In v6, if onReady() fulfills, that means the instance is ready to use, the fulfillment value is of unknown type and need not to be inspected. If the promise rejects, that means there was an error during initialization.
294
314
295
315
### v5 (Before)
296
316
@@ -318,21 +338,6 @@ optimizely
318
338
});
319
339
```
320
340
321
-
## Dispose of Client
322
-
323
-
Both versions require proper cleanup with the `close()` method. In v6, you can also make a client disposable:
0 commit comments