Skip to content

Migration Guide

Cagatay Civici edited this page Aug 11, 2021 · 22 revisions

12.1.0

PrimeNG 12.1.0 introduces new DataTable scrolling implementation that eliminates the use of multiple tables by using css sticky. New implementation greatly simplifies the codebase by removing significant amount of code related to scrolling and also provides new features like freezing columns on the right and sticky row groups. As a result, breaking changes are mostly related to table scrolling.

Breaking Changes

  • Horizontal scrolling does not require giving a fixed width to the table.
  • colgroup templates are removed.
  • RowGroup functionality is now built-in.
  • Frozen columns are defined with pFrozenColumn directive instead of the frozenCols property.
  • scrollDirection property is required to define scrolling other than vertical. Accepted values are horizontal, vertical and both.
  • frozenrows template is renamed to frozenbody for consistency.
  • Column of a scrollable table are flex based so there are a couple of rules to consider when adjusting the widths of columns, refer to the "Column Widths of a Scrollable Table" section at table documentation.
  • Chart.js is updated to 3.3.2
  • FullCalendar component is deprecated as FullCalendar has its own official Angular component. Instead PrimeNG will continue providing a compatible theme for this library.

12.0.0

There are no breaking changes in v12.0.0.

11.0.0

Breaking Changes

  • PrimeIcons should be upgraded to 4.1.0 as components like table utilize new icons in the library.
  • VirtualScroller implementation of Table is reimplemented and clearCache function is removed as caching is left to the page author instead.
  • locale property functionality of Calendar is removed in favor of the new global i18n API.
  • filterMode of Listbox is renamed to filterMatchMode for consistency.
  • The hacky FilterUtils is replaced with FilterService API
  • Pass the option as a template variable in Select Components without wrapping to SelectItem.

Before

<p-dropdown [options]="options" [(ngModel)]="modelValue">
    <ng-template let-option pTemplate="item">
          {{option.value.propName}}
    </ng-template>
</p-dropdown>

After

<p-dropdown [options]="options" [(ngModel)]="modelValue">
    <ng-template let-option pTemplate="item">
          {{option.propName}}
    </ng-template>
</p-dropdown>

Notes

  • yes-no button order in confirm dialog is changed to align it with other Prime UI libraries, it is possible to reverse it with css e.g. flex order.
  • PrimeIcons should be upgraded to 4.1.0 as components like table utilize new icons in the library.

10.0.0

"PrimeNG 10 Migration Guide"

PrimeNG 10 is the most important version in the history of the project. A new design system called PrimeOne is integrated, ChangeDetection strategy is changed to OnPush, PrimeIcons have been redesigned for 4.0, PrimeFlex CSS utilities have been updated with new helpers and more. As a result, although prior versions were a drop-in replacement, PrimeNG team has decided to include all major changes to V10 so that future versions can offer seamless updating experience.

Breaking Changes

  • Migration to PrimeOne Design renames style classes, please see the PrimeOne Migration page for details.
  • PrimeIcons 4.0 should be used with PrimeNG 10 themes, older versions of PrimeIcons are not supported as they are redesigned with new canvas sizes.
  • Modal option removed from toast.
  • primeng/primeng were deprecated in v5 and removed in v10.
  • Grid CSS was deprecated in 2018 and removed in v10 in favor of PrimeFlex.
  • Nova themes have been renamed, nova-light to nova, nova-dark to nova-alt and nova-colored to nova-accent.

Deprecations

  • Responsive options deprecated from components like Table in favor of custom implementations.
  • Label of RadioButton and Checkbox is deprecated, provide your own label instead.
  • MultiSelect defaultLabel is deprecated in favor of placeholder
  • Slide Menu is deprecated
  • Lightbox is deprecated in favor of Galleria
  • Spinner is deprecated in favor of InputNumber
  • p-header and p-footer are deprecated in favor or ng-template pTemplate="header or footer."

9.0.0

  • Drop-in replacement.

8.0.0

  • Drop-in replacement.

7.0.0

  • Drop-in replacement.

6.0.1

  • Schedule is updated to FullCalendar 4.0.0 as a result jQuery is no longer required for p-schedule.

6.0

Major changes include the new TreeTable and PrimeIcons to replace font-awesome.

  • TreeTable is reimplemented from scratch and it is not backward compatible. Refer to the TreeTable on getting started with the new API. If you have worked with p-table before, it is almost identical.
  • utc property functionality is removed from Calendar component, instead to work with utc or other timezones, use onValueChange property to convert the provided date to your preferred timezone.
  • autoAlign property of Dialog is removed, visit the dynamic content section at dialog documentation for details.

PrimeIcons

PrimeNG components now internally use PrimeIcons library, the official icons suite from PrimeTek. Previous releases depend on font-awesome, with 6.0 there is no such dependency. Visit PrimeIcons documentation for more information.

PrimeIcons is available at npm, run the following command to download it to your project.

npm install primeicons --save

PrimeIcons use the pi pi-{icon} syntax such as pi pi-check. A standalone icon can be displayed using an element such as i or span.

<i class="pi pi-check"></i>
<i class="pi pi-times"></i>

Using an icon on a button is simple as;

<button pButton class="pi pi-check"></button>

Using Font-Awesome

Prior to 6.0, font-awesome icons were provided only with the icon name without the .fa addon such as;

<button pButton class="fa-check"></button>

In 6.0, add .fa prefix to keep continue using font-awesome.

<button pButton class="fa fa-check"></button>

This change also allows using any other icon library, you may also mix different libraries like PrimeIcons, FontAwesome and more.

Icons of Button and Menu components in your application need to be updated to include .fa prefix when migrating to 6.0.