Skip to main content
NOTICE

Maintain an application

Keeping an Ontario.ca Frontend project up-to-date is crucial for maintaining its security and performance over time. There are several different strategies and best practices that you can follow to maintain your application.

Upgrade to a new version of Ontario.ca Frontend

To update Ontario.ca Frontend to its latest version, navigate to your project's root directory from a terminal and run the following npm command:

Terminal
npm i @ontario-digital-service/ontarioca-toolkit-core@latest

Apply best practices for application maintenance

Update other project dependencies

You can use npm to check for new versions of Ontario.ca Frontend and other dependencies in your project. Commands like npm outdated and npm update will check for and apply any updates to dependencies used in a project.

Test updates before deployment

Before deploying an updated application to production, you should test it in a local development environment to ensure that its build processes, plugins, and functionality is not adversely affected by the changes you've made.

Update your Node.js environment

Ontario.ca Frontend is built on Node.js, and it is important that you keep Node.js itself up-to-date in your development environments. Tools like nvm (Node Version Manager) can manage different Node.js versions for different projects easily.

Ontario.ca Frontend maintains a minimum version of Node.js that project teams must meet or exceed in their development environments. As newer versions of Node.js eventually reach their end-of-life, that minimum version will be revised accordingly and listed in the release notes for future versions of Ontario.ca Frontend.

Review breaking changes and deprecations

Each new version of Ontario.ca Frontend comes with release notes that highlight any breaking changes, new features, bug fixes, or deprecated components that are included.

Always read the release notes for new versions of Ontario.ca Frontend or other major dependencies in your project as they are released. Update your project to accommodate any breaking changes or to replace deprecated features with newer alternatives.

Backup regularly

Before applying updates, especially major ones, you should ensure you have complete backups of their project. This includes not just the codebase, but also any underlying data, in case the project must be reverted to a previous version.

Consider using a version control system like Git for managing and versioning your project. Git maintains a comprehensive history of your project's changes and allows you to revert to a previous version if necessary. You can also push your code into remote repositories (such as GitHub, GitLab, or Azure DevOps) to secure your project against potential losses.