Migration guide from OS 2.1 to OS 3.0
This guide provides an understanding of the differences between Online Store 2.1 (OS 2.1) and Online Store 3.0 (OS 3.0) versions of theme app extensions, as well as the steps required for migration.
Directory upgrade
The following shows the main differences in the theme app extension directories between OS 2.1 and OS 3.0:
| OS 2.1 Directory | OS 3.0 Directory |
|---|---|
| assets | public |
| locales | i18n |
| snippets | components |
For more detailed information on the directories for theme app extensions in OS 2.1 and OS 3.0, refer to:
Syntax upgrade
| OS 2.1 | OS 3.0 |
|---|---|
| Handlebars | Sline |
Migration steps
If you need to upgrade your existing project to support the OS 3.0 theme, follow these steps:
- Add
compatibility: truein the.shopline-cli.ymlfile.
---
compatibility: true # Newly added
project_type: extension
organization_id: 0
EXTENSION_TYPE: THEME_APP_EXTENSION
- Create a new
compatibilitydirectory in the root of your project. Place the OS 2.1 theme app extension directories into thiscompatibilityfolder.
└── theme-app-extension
├── blocks
│ └── ...
├── components
│ └── ...
├── i18n
│ └── ...
├── public
│ └── ...
├── compatibility # New directory
│ ├── assets
│ ├── blocks
│ ├── locales
│ ├── snippets
│ └── ...
└── .shopline-cli.yml
- Migrate the
localesfield within the deprecated schema to thei18ndirectory.
<div>{{ "title" | t() }}</div>
{{#schema}}
{
...
locales: { # Deprecated
"en": {
"title": "Title"
},
"zh-hans-cn": {
"title": "标题"
}
}
}
{{/schema}}
Migrate English content to i18n/en.json:
{
"title": "Title"
}
Migrate Chinese content to i18n/zh-hans-cn.json:
{
"title": "标题"
}
- Install and use the new version of the SHOPLINE CLI.
npm install @shoplineos/cli -g
Was this article helpful to you?