From the CSA project root, bump the version of @scandipwa/scandipwa-scripts
to the latest release and install it:
Yarn (recommended)
yarn add @scandipwa/scandipwa-scripts@latest
NPM
npm install @scandipwa/scandipwa-scripts@latest
<aside> ➡️ This will update the packages of Create ScandiPWA App. Find more information here.
</aside>
We commit to keeping the breaking changes to a minimum. However, you should check if there are any migration instructions in the changelog and follow them to adapt to a new version.
Restart the compilation script and verify that everything is working as expected.
In this example, we will upgrade SPWA v5.3.0 to v6.0.3.
First, you will need to go to PWA dir and open the terminal and run the following command:
yarn add @scandipwa/[email protected]
or using the corresponding command with npm
and you will need to upgrade the versions of package.json in PWA dir as well and then you will run the following command in PWA dir:
yarn
or npm i
Second, you will need to upgrade the versions of the required modules in composer.json file in the PWA dir.
By going to pwa > node_modules > @scandipwa > scandipwa > composer.json
and copying all the require section and paste it into pwa > composer.json
You may need to run the following command in the root dir:
composer update scandipwa/* -W
You can open the admin page and scroll down to the footer you will see the versions of SPWA and magneto.
Finally, you’re ready to start working on the compatibility of the extension. Best of luck 🎉🎉🎉
Sometimes the package is not linked to SPWA, so you will need to go to packages/YourEXTName dir and run the following commands:
yarn unlink
and then yarn link
If you’re working on compatibility and you need to install both versions in your local as the current example “Magento v2.4.3 Community edition with SPWA v5.3.0, and Magento v2.4.4 Enterprise edition with SPWA v6.0.3” so you can compare between then and test them.
You may face the following issue:
For example, if you setup Magento v2.4.3 Community edition with ****SPWA v5.3.0 first, what going to happen is the packages/YourEXTName of this setup ****is registered and you can say it’s registered globally, so when you start with the setup of Magento v2.4.4 Enterprise edition with SPWA v6.0.3 the linked package will be the one of the first setup, not the one of current setup, so you will need to do the following steps:
yarn unlink
yarn link
<aside> ➡️
Note: when you’re switching between setups you will need to unlink the package from the setup you switching from and link the package of the current setup.
</aside>