Migrating to v22

Moving an application to ExhaustiveUI v22: Angular 22, the Signals API, OnPush and the automated migrations.

ExhaustiveUI v22 requires Angular 22 and moves every component and directive to the Angular Signals API. Templates bind as before: [name], [(name)] and (name) keep working. Most of the work is done by ng update. What is left is code that reaches into a component instance, data mutated in place under OnPush components, and the few places the migrations report.

This guide covers three starting points:

  • A v22 alpha or release candidate of ExhaustiveUI: update to 22.0.0 with ng update, which runs the migrations. They leave code that is already migrated as it is, so running them again is safe.
  • PrimeNG v21: switch to ExhaustiveUI with the migrate-from-primeng schematic, then run the v22 migrations explicitly.
  • Optimus UI v2, which shares the PrimeNG v21 API: swap the packages and imports, then run the v22 migrations explicitly.

Updating later within v22, or to a future major, is covered by the update guide. Every breaking change below is also listed in the changelog.

  • Angular 22. The peer dependencies are ^22.0.0. Update Angular first with the Angular update guide, and use the Node.js and TypeScript versions it requires.
  • A clean git working tree. Commit or stash your work, so the changes made by the migrations can be reviewed, and reverted, on their own.
  • A build and test run that passes before you start, so anything that breaks afterwards comes from the update.
  • PrimeFlex, if the project uses it: it is not part of the update. The migrate-from-primeflex schematic translates its classes to Tailwind CSS, as a separate step.

From an ExhaustiveUI alpha or release candidate

Update Angular, then ExhaustiveUI. Every installed @exhaustive-ui/* package moves to 22.0.0 together, and the migrations run.

ng update @angular/core@22 @angular/cli@22
ng update @exhaustive-ui/core@22

From PrimeNG v21

Update Angular to 22, install ExhaustiveUI and run the migrate-from-primeng schematic. It swaps the primeng, @primeuix/* and PrimeIcons dependencies, rewrites the imports (primeng/button becomes @exhaustive-ui/core/button) and renames the configuration API (providePrimeNG becomes provideExhaustive). The workspace did not go through ng update, so run the v22 migrations explicitly afterwards.

ng update @angular/core@22 @angular/cli@22 --force
npm install @exhaustive-ui/core@22
ng generate @exhaustive-ui/core:migrate-from-primeng
ng update @exhaustive-ui/core --migrate-only --from=3.0.0

Projects on PrimeNG v20 or older upgrade to PrimeNG v21 first; the schematic checks the version and refuses otherwise. The PrimeNG migration guide details each step, including the --force the Angular update needs while primeng is installed.

From Optimus UI v2

Optimus UI v2 has the PrimeNG v21 API under other package names. The migrate-from-optimus schematic swaps its packages for their @exhaustive-ui/* counterparts and renames the imports, the configuration API and the CSS layer; then run the v22 migrations explicitly. The Optimus UI migration guide details each step.

npm install @exhaustive-ui/core@22
ng generate @exhaustive-ui/core:migrate-from-optimus
ng update @exhaustive-ui/core --migrate-only --from=3.0.0

Then

  1. Read the report the migrations printed, see Reviewing the report below.
  2. Fix the TypeScript errors: most come from the Signals API and the removed TypeScript API.
  3. Check the screens that mutate data bound to a component, which no longer refresh under OnPush.
  4. Read the behavior changes, then build and run your tests.

ng update applies nine migrations to the templates (inline and external) and the TypeScript code of every project in the workspace. Each one only touches the ExhaustiveUI elements and APIs it knows, and reports what it cannot rewrite safely.

  • styleclass-to-class: styleClass/[styleClass] becomes class/[class] on the ~60 components whose deprecated styleClass input was removed, such as Tag, Card, Select, Table, DatePicker, Panel, AvatarGroup and InputGroupAddon.
  • renamed-inputs: Drawer showCloseIcon becomes closable and ariaCloseLabel becomes closeAriaLabel; Paginator dropdownAppendTo becomes appendTo; Password maxLength becomes maxlength; AutoComplete minLength becomes minQueryLength; TreeSelect containerStyleClass/containerStyle become class/style; TreeTable virtualRowHeight becomes virtualScrollItemSize; Listbox and MultiSelect filterPlaceHolder becomes filterPlaceholder; ImageCompare ariaLabelledby becomes ariaLabelledBy; Dialog [content], which set the header template, becomes [headerTemplate]; the pt* pass-through aliases of pButton, pButtonLabel, pButtonIcon, pBadge, pInputText and pTooltip become pButtonPT, pButtonLabelPT, pButtonIconPT, pBadgePT, pInputTextPT and pTooltipPT; pBadge size on a plain element becomes badgeSize.
  • renamed-outputs: OrderList onFilterEvent becomes onFilter; Table selectAllChange becomes onSelectAllChange; MultiSelect onPanelShow/onPanelHide become onShow/onHide. The payloads are unchanged, so handlers reading $event keep working.
  • renamed-templates: the MultiSelect removetokenicon template becomes chipicon, with the same context.
  • remove-dead-inputs: removes the bindings of about eighty inputs that had already stopped doing anything, such as the *TransitionOptions inputs (replaced by motionOptions), autoZIndex/baseZIndex on sub menus, Table frozenColumns/frozenWidth, the ConfirmDialog aria labels and the trackBy inputs of DataView, OrderList and PickList.
  • remove-dead-outputs: removes Overlay onAnimationStart/onAnimationDone and MenubarSub menuFocus/menuBlur/menuKeydown.
  • config-overlay-options-signal: Exhaustive.overlayOptions is a signal. Assignments become .set() and reads become calls.
  • config-input-style-to-variant: the global inputStyle option becomes inputVariant (same values), in provideExhaustive()/setConfig() objects and on the Exhaustive service.
  • removed-exports: Password_VALUE_ACCESSOR becomes PASSWORD_VALUE_ACCESSOR; the removed InplaceDisplay/InplaceContent wrappers are dropped from imports and their elements become <span>.

Each migration prints the files it changed, then the places it left for you, with the file and line. These are the cases it reports and what to do with them.

  • Programmatic access to a removed or renamed name, such as drawer.showCloseIcon = true or table.selectAllChange.subscribe(...): use the new name, and the Signals API described below.
  • A tag that binds both the old and the new name: keep the new one and delete the old one, after checking which value you meant.
  • A Table [(selectAll)] two-way binding, which relied on the renamed selectAllChange: bind [selectAll]="selectAll" and (onSelectAllChange)="selectAll = $event.checked".
  • A MultiSelect that already projects a chipicon template next to removetokenicon: keep one of them.
  • A configuration object that sets both inputStyle and inputVariant, or a receiver the migration cannot prove to be the Exhaustive service: set inputVariant only.
  • Imports of rendering internals that are no longer exported: the SelectItem option component of Select (the SelectItem interface of @exhaustive-ui/core/api is unchanged), Menu's SafeHtmlPipe, MapperPipe, RadioControlRegistry and MenubarService. Remove the import; the components no longer need them from you.

Coding agents can check the result with the validate_usage tool of the @exhaustive-ui/mcp server, which names the replacement of every input removed or renamed in v22, and follow its update_to_v22 prompt.

Every input is an input(), every two-way property a model(), every output an output() and every query a signal query. No @Input, @Output, @ViewChild or @ContentChild decorator is left. Templates are not affected, and the migrations do not rewrite this kind of code: the compiler points at each place.

  • Read an input by calling it: table.first(), not table.first.
  • Inputs can no longer be assigned from code. Bind them in the template to a field or a signal of your component, and change that instead.
  • Two-way properties are model() signals: write them with .set(), as in drawer.visible.set(true). The value and change-event pairs became models, for example first, rows and selection on Table and TreeTable, and visible on Dialog, Drawer and Galleria. [(x)] bindings keep working.
  • Outputs are OutputEmitterRefs: .subscribe() still works, .pipe() and the other EventEmitter members do not. Use outputToObservable() when you need an observable.
  • Public child references of a component are signal queries too, and are read with a call.
  • The global configuration is a set of signals on the Exhaustive service: config.ripple.set(true), config.inputVariant().
// Before
@ViewChild(Table) table!: Table;
@ViewChild(Drawer) drawer!: Drawer;

reset() {
    const first = this.table.first;
    this.table.selection = [];
    this.drawer.visible = false;
    this.config.ripple = true;
}

// After
table = viewChild.required(Table);
drawer = viewChild.required(Drawer);

reset() {
    const first = this.table().first();
    this.table().selection.set([]);
    this.drawer().visible.set(false);
    this.config.ripple.set(true);
}

Every component uses OnPush change detection, except Table, TreeTable and DynamicDialog, which stay Eager on purpose because they render objects that applications commonly mutate in place. An OnPush component refreshes when one of its inputs gets a new value, when it handles an event, or when a signal it reads changes. It does not see a change made inside an array or an object it already holds.

The symptom is a component that does not update: options added with push() that do not appear in a Select, a Tree node renamed in place, a chart that keeps its old data. Give the component a new array or object, or keep the data in a signal.

// Before: the Select does not show the new option under OnPush
this.cities.push({ name: 'Paris', code: 'PRS' });

// After: a new array
this.cities = [...this.cities, { name: 'Paris', code: 'PRS' }];

// Or a signal, bound with [options]="cities()"
cities = signal<City[]>([]);
this.cities.update((cities) => [...cities, { name: 'Paris', code: 'PRS' }]);

Templates use the built-in @if, @for and @switch control flow, and option lists, menus, Paginator and DatePicker reuse their rows when the data is replaced instead of recreating them. Replacing the array is therefore cheap, and no NG0955 or NG0956 warning comes from the library.

These removals have no migration: they only appear in TypeScript code, and the compiler points at each use.

  • OverlayOptions.showTransitionOptions/hideTransitionOptions and DynamicDialogConfig.rtl/transitionOptions: nothing read them. Use motionOptions.
  • @exhaustive-ui/utils: classNames becomes cn, createStyleAsString becomes createStyleMarkup, createStyleTag becomes createStyleElement, mergeKeys becomes deepMerge.
  • @exhaustive-ui/styled: getDirective on the theme service becomes getComponent.
  • Sub components that render the inside of a component (ContextMenuSub, TieredMenuSub, MenuItemContent, MultiSelectItem, ToastItem, TableBody, TTBody, UITreeNode, the Galleria parts...), PARENT_INSTANCE and the pre-signals helpers of @exhaustive-ui/core/utils are still exported in v22 but tagged @internal. They are not public API and can change in a minor release.

These changes compile without error but can change what users see, or what a test asserts. Most come from fixes of bugs inherited from PrimeNG and Optimus UI. The issue numbers in the changelog are Optimus UI's.

Forms

  • InputText: when [invalid] is bound, it alone decides the invalid style; the automatic ng-invalid ng-dirty border no longer applies on top of it.
  • InputNumber: a keystroke that would make the formatted value longer than maxlength is rejected instead of truncating the text. The native min/max attributes are gone; the bounds stay in aria-valuemin/aria-valuemax.
  • Select: a Select inside a disabled <fieldset> is disabled, except inside the fieldset's first <legend>, as for native controls.
  • Select, MultiSelect and CascadeSelect use the SVG spinner of Button as their default loading icon, instead of the pi-spin icon class.
  • PickList: moving items sets source and target to new arrays and emits sourceChange/targetChange, so [(source)]/[(target)] bindings follow.
  • TreeTable: the selection change can fire once per intermediate step while a checkbox propagates.
  • DatePicker: the data-date attribute of day cells uses a 1-based month.
  • AutoFocus: the native autofocus attribute is only rendered when autofocus is on; Button and the other components no longer carry it by default.

Overlays and menus

  • Overlays are placed against the viewport without its scrollbars, so an overlay at the right edge no longer goes under the vertical scrollbar.
  • Tooltip honours the global overlayAppendTo option.
  • TieredMenu: with autoDisplay, submenus open on hover from the start, without a first click. A popup TieredMenu gives the focus back to its trigger when an item is picked.
  • ContextMenu: showing a context menu closes any other one that is open.
  • ConfirmPopup: an accepticon/rejecticon template replaces the acceptIcon/rejectIcon class instead of rendering next to it, as in ConfirmDialog.

Accessibility markup

  • Stepper: the tablist role is on p-step-list. Splitter: the separator role is on the focusable gutter handle.
  • FocusTrap sentinels are no longer aria-hidden. ConfirmDialog no longer puts a role on the p-dialog host.
  • Table announces keyboard column and row moves through the new aria.columnMoved and aria.rowMoved translation keys. A custom aria translation without them falls back to English.

Theming and display

  • A token overridden under colorScheme.light wins over the preset's top-level token, as it already did in dark mode. A top-level override passed to definePreset, updatePreset or usePreset still wins.
  • MeterGroup: meter widths use the exact percentage; labels keep the rounded value.
  • ToggleSwitch has no size input any more: it had no effect.

Some types now describe what the components actually emit or accept. Code that relied on the old types may need a cast or a narrower check.

  • Table onFilter: filters is typed FilterMetadata | FilterMetadata[].
  • TreeTable TreeTableLazyLoadEvent: first is a number and last an optional number, as in TableLazyLoadEvent.
  • CascadeSelect: options is typed as an array, and the value accepts an object.
  • Dialog and ConfirmDialog: pt.root is typed as the options of the root element.
  • Chart onDataSelect emits the new exported ChartDataSelectEvent type.
  • Confirmation accepts draggable, and DatePicker hourFormat also accepts a number.
  • Angular 22 installed, and ng update (or --migrate-only --from=3.0.0) run on a clean working tree.
  • Every place listed in the migration report handled.
  • The project compiles: inputs are read with a call, two-way properties written with .set(), removed TypeScript API replaced.
  • No styleClass, removed input or pt* alias left in templates: validate_usage of the MCP server can check this.
  • Screens that change data bound to a component show the change: new arrays and objects, or signals, rather than in-place mutation.
  • Behavior changes reviewed against your tests and screenshots.
  • Signal Forms, if you adopt them: since 22.8.3 a field bound with [formField] is styled as invalid once it is touched or the form is submitted, so an [invalid] binding next to [formField] is no longer needed.