Install

Works with Drupal: ^11 || ^12

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 144.76 KB
MD5: 3075220e9f9dc9a1b0943f81c4457145
SHA-1: 2155a5eadc73db38a58f55624e4aab882158dc79
SHA-256: c6f67b7e1c930a6f14891b5e51cec36fc32672e6787f66bcd0b91a3759866a52
Download zip 279.8 KB
MD5: cac44611057226a923ad0f0263bbfbd2
SHA-1: 79e3a3f295f1778ae2f20804b44b05a8d9a7ef92
SHA-256: 8c57d8117315417940ca1935d150fb933fafdfd9f0f3b90eeb57def0cf6e6613

Release notes

Web Component Runtime 1.5.0 adds a component migration runner. When a component library generated by [cem_sdc_generator](https://www.drupal.org/project/cem_sdc_generator) changes a component in a breaking way, its own hooks migrate the components already placed on a site, without the generator being installed.

### New

- **A component migration API**, under `Drupal\web_component_runtime\Migration`, for libraries' update and deploy hooks (#3627948: Let a process variable name a user by user ID, username or email address, for Users by variable and the Views user display and filters(https://git.drupalcode.org/project/web_component_runtime/-/work_items/36...)). A hook describes each change as a `ComponentChange`: a renamed or removed prop or slot, or one that needs a person to review it, such as a prop whose type changed. The `web_component_runtime.component_migration_runner` service then finds and migrates the placed instances it affects:
- UI Patterns blocks in Block Layout and Layout Builder, both default layouts and per-entity overrides.
- Canvas component trees in content.
- **Two hooks per migration.** Canvas only registers a component's new version after a normal cache rebuild, never during an update run. So a library migrates blocks in `hook_update_N()` and Canvas content in `hook_deploy_NAME()`, which `drush deploy` runs after rebuilding caches. The deploy hook also works on its own with `drush deploy:hook`.
- **Renamed props and slots survive in Canvas.** Their values and slotted children are moved before Canvas's own updater runs, which would otherwise treat a rename as a removal.
- **Notices when a step is skipped or needs a person:**
- A summary in each hook's message.
- A `web_component_runtime` log entry for each instance that needs manual review, saying where it is and what changed.
- A status report warning while a library's deploy hook is pending, for sites that deploy with update.php and never run deploy hooks.

### Upgrading

Nothing changes for existing sites until a library ships migration hooks. When one does:

- **With `drush deploy`,** everything runs in the right order.
- **With separate commands,** run `drush updatedb`, then `drush cache:rebuild`, then `drush deploy:hook`.
- **With update.php only,** blocks are migrated, but Canvas content waits for `drush deploy:hook`. The status report warns until it has run.

The README's "Component migrations" section explains each path, what to do if a deploy hook stops with an error, and what isn't migrated.

### For library maintainers

The `ComponentChange` constructor, the `ChangeAction`, `KeyType` and `MigrationTarget` enums, both service IDs, the `run()` and `summary()` signatures, and `MigrationDeferredException` are covered by a backward-compatibility promise, because a shipped hook never changes. A library whose hooks use them should require `drupal/web_component_runtime: ^1.5`. cem_sdc_generator 1.4.0 (#3618763: static_suite 1.2.15(https://git.drupalcode.org/project/cem_sdc_generator/-/work_items/3618763)) writes these hooks for generated libraries.

Created by: matthand
Created on: 5 Dec 2026 at 15:39 UTC
Last updated: 5 Dec 2026 at 15:39 UTC
New features

Other releases