Migrating Your Code
Starting with Kendo UI for Angular v19.0.0 and Kendo CLI v1.9.0, you can speed up the migration between major Kendo UI for Angular versions with the Kendo CLI. The Kendo CLI is a powerful code transformation tool that automates updates and helps migrate your Kendo UI for Angular components through codemods.
Overview
During the migration process, the codemods automatically transform the Kendo UI for Angular components in your project code by updating:
- Component HTML templates
- Standalone HTML files
- Component TypeScript logic
The codemods support three transformation patterns: updating property names, modifying property values, handling property deprecation and removal.
To get started with the migration process, follow these steps to set up the Kendo CLI and run the available codemods.
-
Install Kendo CLI globally and run a guided migration using one of the following methods:
-
Install Kendo CLI through NPM and run the migration manually:
bashnpm i -g @progress/kendo-cli
bashkendo migrate
-
Install Kendo CLI and automatically run the guided migration using NPX:
bashnpx @progress/kendo-cli migrate
-
Once Kendo CLI is installed, you can run commands with the
kendo
handle instead ofnpx @progress/kendo-cli
.For example:
kendo migrate
.
- Next, the migration command will check for available Kendo UI updates (including any peer dependencies), prompt you to install the updates, and then apply any available codemods on top.
- Confirm that you want to install the available updates.
- Confirm that you want to apply the available transformations.
- Review and accept the suggested transformations.
The Kendo CLI begins to apply the available codemods version by version, starting with the transformations for the earliest version. - Finally, do a test run of your project to verify that everything works as expected.
Best Practices
For most projects, running all available codemods for the affected Kendo UI for Angular packages at once is an effective and practical approach.
Depending on your project size, complexity, or preferences, you may also consider the following practices:
- Migrate between consecutive major versions—For example, migrate from v18.0.0 to v19.0.0. This lets you review and adjust your code version by version, which can help avoid possible conflicts between breaking changes in larger or more complex projects.
- Migrate one package at a time—This provides finer control over the migration process and allows you to focus on individual updates, making it easier to monitor changes and resolve any issues as they arise.
CLI Quick Guide
The following list describes the most common migration scenarios, providing useful commands and explanations to help you efficiently update your Kendo UI for Angular packages using the Kendo CLI:
You can run any of the listed commands with or without a package specified.
-
Install the Kendo CLI globally.
bashnpm i -g @progress/kendo-cli
-
Run a guided migration. You will be prompted every step of the way.
bashkendo migrate
-
Migrate a specific package.
bashkendo migrate @progress/kendo-angular-dropdowns
-
Migrate between specific versions.
bashkendo migrate --from=18 --to=19
-
Run a quick migration without any prompts.
bashkendo migrate --force
-
Only install the available updates. Do not run any codemods. Useful when you want to manually migrate your code.
bashkendo migrate --no-codemods
-
Only run the available codemods. Do not install any packages. Useful when you already have the packages installed.
bashkendo migrate --no-install
CLI Arguments
If you want more control over the migration, you can use any of the following arguments when running kendo migrate
.
Argument | Description | Sample Use |
---|---|---|
<pkg> | Specifies one or more packages for which to execute the assisted migration (with any additional arguments). If not set, runs for all available Kendo packages. | kendo migrate @progress/kendo-angular-dropdowns |
--help | Prints the help for the command. | kendo migrate --help |
--version | Prints the version of the Kendo CLI. | kendo --version |
--verbose | Sets the verbosity level of the command output on a level from 0 (silent) to 5 (most verbose). By default: 1. | kendo migrate --verbose=3 |
--quiet | Silences the output as much as possible. Shorthand for --verbose=0 . | kendo migrate --quiet |
--force | Runs in force mode and does not ask for any confirmations. | kendo migrate --force |
--to | Specifies the package version to migrate to. If not set, migrates to the latest available version of the respective package(s). | kendo migrate @progress/kendo-angular-dropdowns --codemods --to=19 |
--from | Specifies the package version to migrate from. If not set, uses the current version. | kendo migrate @progress/kendo-angular-dropdowns --codemods --from=18 |
--no-install | Skips the installation part of the migration. Use this option if you have already updated your packages and want to only run the available codemods. | kendo migrate --no-install |
--no-codemods | Skips the codemods step of the migration. Use this option to only install the available updates. | kendo migrate --no-codemods |
--no-peer-deps | Skips the installation of any peer dependencies for the updated packages. By default, the migrate command always installs the available peer dependencies. | kendo migrate --no-peer-deps |
--no-optional | Skips the optional codemods, if any. Use this option to run only the required transformations. | kendo migrate --no-optional |
--ignore-pattern | Specifies a glob pattern to ignore specific files or directories during the migration. Use this option to exclude files that you do not want to be modified. | kendo migrate --ignore-pattern="dist/**" |
Available Codemods
Codemods automatically update all Kendo UI for Angular related code in your project during migrations between major versions. They are designed to handle all breaking changes introduced in each major release.
The table below lists the components that introduce breaking changes for the specified migration path—these are the components for which the codemods will apply the necessary updates in your codebase:
Migration Path | Affected Components with Breaking Changes |
---|---|
From v18.0.0 to v19.0.0 |