How to upgrade
Real-life applications are too complex for us to upgrade automatically. A lot depends on your business logic that we cannot predict. That is why you still need to complete manual upgrade steps that are specific to each version.
Typical upgrade
In every upgrade, you do the following:
- Run the
update:appcommand - Perform the required manual steps if needed
- Verify your upgrade manually
- Merge the upgrade branch
See First automated upgrade below.
Run update:app
At the root of your application run:
npx @jutro/cli-internal@latest update:app
jutro migration commands
When upgrading your Jutro app to a new version you should use the jutro commands:
jutro update:app, migrates your app to a new version you select.jutro update:cliupdatesjutroto the latest version.
To learn more about the available options, run:
jutro update --helpjutro update {action} --help- to learn about options for action provided (e.g.,:app,metadata, orjs)
Perform manual steps
To find out what manual steps you need:
- Check the upgrade page to see manual steps required for a specific version.
- Read through the CHANGELOG to understand if there are any other changes you must make.
Verify your upgrade manually
After the upgrade, follow these general steps:
- In
package.json, verify that all@jutro dependenciesare on the latest version. Do not use wildcards in version numbers (like"^3.0.1"). Use the exact version. - Verify that all packages have the same version.
- If you make any changes, run
npm install. - Run your automated tests, like unit, e2e, or any other.
- Start your application.
- Check the console log in your browser for any errors or warnings.
- Go through all manual test cases you have for your app.
Merge the changes in a new branch
Merge those changes to the desired branch to update your code with the changed files
First automated upgrade
If you used an old version of Jutro (or Elixir) to create your app, you may need to restructure to successfully upgrade to the latest version.
You must follow our naming conventions.
File naming conventions
The following naming conventions are mandatory, if you want automated upgradability:
Component.jsComponent.metadata.json5Component.module.scssComponent.messages.js__tests__Component.test.js
Aligning your folder structure with Jutro app
To align your app folder structure with that expected by the Jutro app version you are upgrading to:
-
Move your app root component into
src/app/. If it is calledElixir.js, rename it toApp.js. -
Move any associated files and rename them according to the conventions. You resulting file structure should be similar to:
src
app
__tests__
App.test.js
App.js
App.config.json5
App.module.scss
App.messages.js -
Create a new file,
src/app/App.routes.jsand put your route configuration in there:import FormPage from './Pages/FormPage/FormPage';
import CodelessForm from './Pages/CodelessForm/CodelessForm';
export const routes = [
{
path: '/',
exact: true,
showOnNavBar: false,
redirect: '/codeless',
},
{
title: 'Codeless Form',
path: '/codeless',
exact: true,
component: 'CodelessForm',
},
. . .
];
export const componentMap = {
FormPage,
CodelessForm,
AuthPage,
}; -
In
App.js:-
Remove explicit route configuration.
-
Import routes from the new file:
import { routes, componentMap } from './routes'; -
Remove unnecessary imports.
-
-
Extract the
configItemsfromoverrides.config.jsto a separate file,configItems.js.For example, to use the default configuration for
pathsandjest, and to override thebabelLoaderRulefor 'webpack', put the following inconfigItems.js.module.exports = [
'paths',
'jest',
{
name: 'webpack',
overrides: {
getBabelLoaderRule: (loaders) => loaders.tsLoaderRule,
},
},
];
config-overrides.js file instead of overrides.config.js, see the webpack migration documentation.What's the latest version of Jutro?
You can check the latest major published version using the version dropdown on this site.
But if you want the latest not necessarily stable version, you can use one of the following methods.
Check the version in Artifactory
- Go to https://artifactory.guidewire.com.
- Search for
jutro. - Find the latest version by looking at the Modified column.