Upgrade From 5.4.0 to 5.5.0
Learn how to upgrade Webiny from 5.4.0 to 5.5.0.
- how to upgrade Webiny from 5.4.0 to 5.5.0
Upgrade Webiny Packages
The first step is to upgrade all @webiny/*
packages, which can be done by running the following command in the root of your project:
# Execute in your project root.
yarn up "@webiny/*@5.5.0"
Once the upgrade has finished, running the yarn webiny --version
command in your terminal should return 5.5.0
.
Upgrade Webiny Project
Before running the below webiny upgrade
command, please run the following from your project root:
npx https://gist.github.com/doitadrian/80c1407e3b513f8e1daaf77ae9e4703b
Running this command will apply a minor fix to the webiny upgrade
command that you’re about to execute.
Once you’ve run the above upgrade command, run the following:
# Execute in your project root.
yarn webiny upgrade 5.5.0
Before running the webiny upgrade
command, we recommend that you commit any active code changes you might have in your working branch.
Additional Manual Upgrade Steps
Once the webiny upgrade
command has finished, a couple of manual steps remain to be completed, after which, your project should be completely updated.
1. Add apolloLinks.ts
File (Located in Your Website Project Application)
In your Website project application (apps/website
), we need to add the new apolloLinks.ts
file, that contains a couple of plugins, necessary for resolving a couple of pre-rendering related issues .
Copy and paste the above mentioned apolloLinks.ts
file to apps/website/code/src/plugins/apolloLinks.ts
, and also, make sure it’s imported in the index.ts , located in the same plugins
folder:
import { plugins } from "@webiny/plugins";
import imageComponent from "@webiny/app/plugins/image";
import pageBuilder from "./pageBuilder";
import formBuilder from "./formBuilder";
import apolloLinks from "./apolloLinks";
import theme from "theme";
plugins.register([imageComponent(), pageBuilder, formBuilder, apolloLinks(), theme()]);
2. Update Page
React Component (Located in Your Website Project Application)
Open your /apps/website/code/src/components/Page/index.tsx
file and replace its content with the new one . This change is also related to new pre-rendering related fixes.
3. Optionally, Add Necessary Environment Variables to Enable Newly Introduced Logs Forwarding
The newwebiny watch
command enables you to stream logs from your application code directly to your terminal. And while all new projects will have this feature automatically enabled, there are a couple of manual steps that needs to be done for projects that are making the upgrade to version 5.5.0
.In api/pulumi/dev/index.ts , upon instantiating both Graphql
and HeadlessCMS
classes, make sure to pass the WEBINY_LOGS_FORWARD_URL: String(process.env.WEBINY_LOGS_FORWARD_URL)
as an environment variable.
With that, you will also need to add the @webiny/handler-logs
dependency to api-graphql
and api-headless-cms
packages, and register its plugins in respective index.ts / index.ts files.
This will enable logs forwarding for your main GraphQL API and HeadlessCMS GraphQL API Lambda functions.
4. Fix the buildFunction
in the transform
Lambda Function Handler
We’ve received several reports of the webiny.config.ts
not importing the correct buildFunction
. Before doing any deployments, please ensure that the config file imports the correct buildFunction
:
import { buildFunction } from "@webiny/api-file-manager/handlers/transform/bundle";
Upgrade Headless CMS Permissions
After a successful deployment, open your Admin Area to execute the automated upgrade of Headless CMS permissions. It will update permissions data structure on user groups and API keys.
We recommend verifying your CMS permissions after the upgrade, to make sure they reflect exactly what is expected.