Skip to content

Commit 04556b9

Browse files
committed
additional mods to migration section
1 parent 1a1bc42 commit 04556b9

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

docs/sdks/sdk-ref-javascript.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ The `init()` function can throw the following errors.
355355

356356
#### Legacy Callback Function
357357

358-
This is provided for backward compatibility only: new integrations should use the new-style [callback function](#callback-function). Note that the callback parameters are not compatible in either direction: legacy callbacks cannot be registered using the [Array Push Pattern](#array-push-pattern), and new-style callbacks cannot be provided to `init`.
358+
This is provided only for backward compatibility between version 3 and earlier versions: new integrations should use the new-style [callback function](#callback-function). Note that the callback parameters are not compatible in either direction: legacy callbacks cannot be registered using the [Array Push Pattern](#array-push-pattern), and new-style callbacks cannot be provided to `init`.
359359

360360
For details, see [Legacy Callback Function](./sdk-ref-javascript-v2#callback-function) in the documentation for earlier versions of this SDK.
361361

@@ -540,20 +540,23 @@ Version 3 of the SDK is fully backwards-compatible with earlier versions, but in
540540

541541
#### Benefits in Version 3
542542

543-
- The script is now distributed using the UID2 CDN, and should therefore load faster.
543+
In version 3:
544+
545+
- The script is distributed using the UID2 CDN, and should therefore load faster than previous versions.
544546
- The SDK tries to use local storage instead of cookies for storing the identity. If the cookie provides a newer token than the one in local storage, the SDK still loads the identity from the cookie.
545547

546548
Notes about this approach:
547-
- A default of local storage has been requested by a number of publishers who are close to the maximum size limit for cookies.
549+
- A default of local storage was requested by a number of publishers who are close to the maximum size limit for cookies.
548550
- If you rely on setting a first-party cookie to provide a new identity, you do not gain any benefit from this change.
549551
- If you only provide the identity by passing it to `init`, the SDK no longer writes to the cookie.
550552

551-
Some of the functionality from earlier versions has been deprecated, and you should make changes to future-proof your integration.
552-
- The legacy callback system has been deprecated and will eventually be removed.
553+
Some of the functionality from version 2 and earlier were deprecated in version 3, and we recommended that anyone upgrading to version 3 should future proof their integration by making some code updates. This functionality was removed in version 4. If your integration references any of the items listed in [Changes From Version 3](#changes-from-version-3), and is not updated, you **must** make those updates as part of upgrading to version 4.
554+
555+
The legacy callback system was deprecated in version 3 and removed in version 4.
553556

554-
By updating your integration, you can take advantage of the additional features available:
555-
- Script loading using `async` or `defer` is now fully supported.
556-
- The callback system is simpler, with fewer states to manage.
557+
By updating your integration, you can take advantage of these features added in version 3 and 4:
558+
- Script loading using `async` or `defer` is fully supported.
559+
- The callback system was simplified, with fewer states to manage.
557560
- You can provide multiple callbacks, and they can be registered at any time—before or after `init` has been called.
558561
- Full TypeScript support.
559562
- Functions to set the identity after `init()` has been called.
@@ -566,20 +569,24 @@ Version 4 is more robust than earlier versions. For a summary of the benefits, s
566569

567570
### Required Changes
568571

569-
To migrate to version 4, update your script tag to load the SDK from the version 4.0.1 CDN URL. See [Include the SDK Script](#include-the-sdk-script).
572+
To migrate to version 4, the steps are a little different depending on how your current implementation is configured:
573+
574+
- **Migration from version 3, with no elements from earlier versions**: The only step needed is to update your script tag to load the SDK from the version 4.0.1 CDN URL. See [Include the SDK Script](#include-the-sdk-script).
570575

571-
This is the only required change for migrating from any earlier version to version 4. However, if you're upgrading from a version earlier than v3, there are other recommended and optional changes you should make. See [Additional Changes: Migration from v2 or Earlier](#additional-changes-migration-from-v2-or-earlier).
576+
- **Migration from version 3, and you previously migrated from version 2 without completing the steps to update your implementation**: Update your script tag, and also update your code so that it doesn't reference elements deprecated in version 3. See [Additional Changes: Migration from v2 or Earlier](#additional-changes-migration-from-v2-or-earlier).
577+
.
578+
- **Migration from version 2 or earlier**: Update your script tag, and also update your code so that it doesn't reference elements deprecated in version 3. See [Additional Changes: Migration from v2 or Earlier](#additional-changes-migration-from-v2-or-earlier).
572579

573580
### Additional Changes: Migration from v2 or Earlier
574581

575-
If you're upgrading from a version earlier than v3, consider the following recommended and optional changes to improve your implementation of the UID2 JavaScript SDK:
582+
If you're migrating from a version earlier than v3, or if you previously migrated from an earlier version to version 3 without updating your code, consider the following recommended and optional changes to improve your implementation of the UID2 JavaScript SDK:
576583

577584
- [Recommended Changes](#recommended-changes)
578585
- [Optional Changes](#optional-changes)
579586

580587
#### Recommended Changes
581588

582-
If you're upgrading from a version earlier than v3, we strongly recommend that you implement the following changes to benefit from the improvements in version 3 of the SDK:
589+
If you're migrating from a version earlier than v3, or if you previously migrated from an earlier version to version 3 without updating your code, implement the following changes in your code:
583590

584591
- [Migrate to the Version 3 Callback System](#migrate-to-the-version-3-callback-system)
585592
- [Take advantage of `setIdentity` and other new features](#take-advantage-of-setidentity-and-other-new-features)

0 commit comments

Comments
 (0)