Skip to content

Commit 819e79a

Browse files
author
Kaushik Shetty
committed
doc: add v2.0.0 migration guide
1 parent 5ad88c3 commit 819e79a

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ npm i @contentstack/venus-components --save
9393

9494
For more information on styling your application, refer to our [style guide](https://www.contentstack.com/docs/developers/venus-component-library/).
9595

96+
**App SDK v2.0.0 Migration and Upgrade Guide**
97+
98+
This guide provides instructions for migrating your application to App SDK version 2.0.0. It covers changes in metadata responses, field modifier and full page location updates, and the transition from the `_extension` property to `_uiLocation`. If you are upgrading your app to the latest version, make sure to follow these steps for a smooth transition.
99+
100+
[Read the Migration Guide](docs/app-sdk-v2-migration.md)
101+
96102
## More information
97103

98104
- [App SDK API Reference](https://github.com/contentstack/app-sdk-docs#readme)

docs/app-sdk-v2-migration.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# App SDK v2.0.0 Migration Guide
2+
3+
With the release of **App SDK version 2.0.0**, certain breaking changes have been introduced to enhance the SDK's functionality and structure. To ensure a smooth transition to the new version, please follow the migration instructions below:
4+
5+
## Managing Metadata Response Changes
6+
7+
If your application previously utilized the metadata module's methods to handle app metadata, you'll need to update your approach for handling the response structure.
8+
9+
Make note of the updated response structures for the following methods:
10+
11+
##### `createMetaData()`
12+
13+
##### `retrieveMetaData()`
14+
15+
##### `retrieveAllMetaData()`
16+
17+
##### `updateMetaData()`
18+
19+
##### `deleteMetaData()`
20+
21+
Here's a comparison of the old and new response structures:
22+
23+
#### Older Response (Version 1.x):
24+
25+
```json
26+
{
27+
data: {
28+
metadata: {} // Actual metadata response to be returned,
29+
},
30+
origin: app.contentstack.com, // origin where the app is running
31+
source: global{} // Source information
32+
}
33+
```
34+
35+
#### Newer Response (Version 2.0.0):
36+
37+
```json
38+
{
39+
"metadata": {} // Actual metadata response to be returned,
40+
}
41+
```
42+
43+
## Field Modifier and Full Page Location Changes
44+
45+
If you were utilizing the `EntryFieldLocation` and `FullscreenAppWidget` properties to manage your field modifier or full page applications, it's essential to adapt to the new property names introduced in version 2.0.0:
46+
47+
Replace occurrences of `appSDK.location.EntryFieldLocation` with `appSDK.location.FieldModifierLocation`.
48+
49+
Replace occurrences of `appSDK.location.FullscreenAppWidget` with `appSDK.location.FullPage`.
50+
51+
## Update for `_extension` Property
52+
53+
In prior versions of the App SDK, the `_extension` property was available on the App SDK instance returned after initialization. In version 2.0.0, this property has been replaced with `_uiLocation`. Make the following adjustment in your code:
54+
55+
Replace `appSdk._extension` with `appSdk._uiLocation`.
56+
57+
Here's an example of how the change can be applied:
58+
59+
```javascript
60+
ContentstackAppSDK.init((appSdk) => {
61+
// Previous version
62+
appSdk._extension; // No longer available
63+
64+
// Updated version
65+
appSdk._uiLocation; // Instance of the UiLocation
66+
});
67+
```
68+
69+
These migration instructions will help you seamlessly transition to App SDK version 2.0.0. Should you have any questions or need further assistance, please don't hesitate to reach out.

0 commit comments

Comments
 (0)