Migration guide

Migrating to Styloviz 2.0

From a Styloviz 1.x application to 2.0. Run ng update first: it makes the changes it can and lists the files it cannot change for you. Then work through the two tables below. Every component that 2.0 renames or removes has a row, and a build check holds that list against the 1.0.2 release, so nothing is missing from it.

1. Run ng update

Start from a clean working tree, so you can review the diff. Every Styloviz package lists the whole kit as its package group, so this one command moves every free and Pro package you use to 2.0 together. Run it on the package your package.json lists: core if you installed packages one by one, the bundle if you installed @styloviz/all or @styloviz-pro/all. ng update only updates what package.json lists, and npm installs core as a peer without listing it — so if core is missing there, add it at your current version first.

Update

terminal.shCode
# Installed packages one by one. If @styloviz/core is not in your
# package.json (npm installed it as a peer), list it first:
npm install @styloviz/core@1
ng update @styloviz/core

# Installed a bundle (the getting-started way)
ng update @styloviz/all          # or: ng update @styloviz-pro/all

It renames 3 of the components below in templates (.html and inline) and TypeScript. It also registers the full icon set, so no icon disappears. Where a change needs a decision from you, such as folding a record grid into the table it wraps, it prints each file that needs one. Then run ng build: with strict templates on, a selector or input that is gone fails the build with its file and line.

2. Renamed and removed components

Every 1.x component selector and exported class that 2.0 no longer has. Each replacement links to its documentation.

1.x components renamed or removed in 2.0
1.x2.0ng update
<sv-default-pie-chart>SvDefaultPieChartComponent · @styloviz/charts<sv-pie-chart>SvPieChartComponent Yes v2-pie-family
<sv-default-pie-chart-pro>SvDefaultPieChartProComponent · @styloviz-pro/charts<sv-pie-chart-pro>SvPieChartProComponent Yes v2-pie-family
<sv-donut-chart>SvDonutChartComponent · @styloviz-pro/charts<sv-pie-chart-pro variant="donut">SvPieChartProComponent Yes v2-pie-family
<sv-performance-chart>SvPerformanceChartComponent · @styloviz/charts<sv-line-chart renderer="large-data">SvLineChartComponent No, by hand
<sv-performance-chart-pro>SvPerformanceChartProComponent · @styloviz-pro/charts<sv-line-chart-pro renderer="large-data">SvLineChartProComponent No, by hand
<sv-live-spline-chart>SvLiveSplineChartComponent · @styloviz-pro/charts<sv-line-chart-pro [live]="true" [liveWindow]="n" chartType="spline">SvLineChartProComponent No, by hand
<sv-live-stock-chart>SvLiveStockChartComponent · @styloviz-pro/charts<sv-candlestick-chart [sessions]="…" [liveWindow]="n">SvCandlestickChartComponent No, by hand
<sv-live-sort-chart>SvLiveSortChartComponent · @styloviz-pro/charts<sv-bar-chart-pro sort="descending">SvBarChartProComponent No, by hand
<sv-record-grid>SvRecordGridComponent · @styloviz/data-table<sv-data-table responsive="records" recordTitleKey="…">SvDataTableComponent Lists each file v2-data-table-responsive
<sv-record-grid-pro>SvRecordGridProComponent · @styloviz-pro/data-table<sv-data-table-pro responsive="records" recordTitleKey="…">SvDataTableProComponent Lists each file v2-data-table-responsive
<ng-template svRecordTable>SvRecordTableDirective · @styloviz/data-tableNothing: the records view is the table itselfSvDataTableComponent Lists each file v2-data-table-responsive
<ng-template svRecordTablePro>SvRecordTableProDirective · @styloviz-pro/data-tableNothing: the records view is the table itselfSvDataTableProComponent Lists each file v2-data-table-responsive
<sv-popout>SvPopoutComponent · @styloviz-pro/overlays<sv-popover trigger="click" [interactive]="true" [autoFocus]="true" padding="none">SvPopoverComponent No, by hand

3. Other breaking changes

Changes that keep the selector but change an input, a provider or what you see.

  • Icons are registered per glyph

    ng update: Yes (v2-register-icons)

    A name your templates draw renders only once it is registered: provideSvIcons([bellIcon]), each glyph imported from @styloviz/icons/glyph/<name>. The migration registers the full set, provideSvIcons(svAllIcons), so every icon keeps rendering; trim it to the glyphs you use afterwards.

    Documentation for Icons are registered per glyph
  • Data table: cardOnMobile is responsive="cards"

    ng update: Yes (v2-data-table-responsive)

    [cardOnMobile]="true" on sv-data-table and sv-data-table-pro becomes responsive="cards". The card list is unchanged.

    Documentation for Data table: cardOnMobile is responsive="cards"
  • One locale for the whole kit

    ng update: No, by hand

    Every display format reads SV_LOCALE, which defaults to Angular's LOCALE_ID. Set it once with provideSvLocale('de-DE'). A component's own locale input still wins for that instance.

    Documentation for One locale for the whole kit
  • App shell is slot-based

    ng update: No, by hand

    sv-dashboard-shell, sv-sidebar, sv-topbar and sv-footer no longer render the Styloviz site's own links. Project your sidebar, topbar, outlet and footer into the shell ([svShellSidebar], [svShellTopbar], [svShellFooter]) and your brand into their slots.

    Documentation for App shell is slot-based
  • Tooltip bubbles are portalled

    ng update: No, by hand

    sv-tooltip and sv-tooltip-pro render the bubble on <body>, so an overflow: hidden parent no longer clips it. [portal]="false" keeps the 1.x placement.

    Documentation for Tooltip bubbles are portalled
  • Form builder control ids are scoped to the form

    ng update: No, by hand

    Ids are sv-fb-<n>-<path>, unique per form, where they were sv-fb-<path>. Select a control by its name or a data-sv-* hook.

    Documentation for Form builder control ids are scoped to the form
  • Select dropdown: search, async, windowing and bulk move to feature children

    ng update: No, by hand

    [searchable] and its settings move to <ng-container svSelectSearch />, windowing to svSelectVirtual, select-all to svSelectBulk, and loadOptions to [source]="svSelectSource({ search })".

    Documentation for Select dropdown: search, async, windowing and bulk move to feature children
  • Stepper: verticalRowPaddingClass() is removed

    ng update: No, by hand

    The deprecated method is gone from sv-stepper and sv-stepper-pro. Nothing read it.

    Documentation for Stepper: verticalRowPaddingClass() is removed
  • Deprecated members are removed

    ng update: No, by hand

    Every member 1.x kept only so old code would compile is gone, each with a documented replacement: for example the data table's compact input (density="compact") and (serverPageChange) ((queryChange)), and provideStylviz() (provideStyloviz()).

  • SortDirection in the Pro bundle names the table's sort

    ng update: No, by hand

    With the live sort chart gone, SortDirection from the @styloviz/pro bundle is the data table's sort direction. For a bar chart's order, use BarChartSort.

    Documentation for SortDirection in the Pro bundle names the table's sort
  • New peer dependencies

    ng update: No, by hand

    A few packages now build on others, for example @styloviz/overlays on @styloviz/kbd. npm 7 and later installs them with the package; with another package manager, add the ones it reports.

4. Every detail

The changelog has the full before-and-after table for each change: every renamed input, option type and label, and what looks different after the upgrade. Read the 2.0 changelog (opens in a new tab).

Coming from another library?

The PrimeNG guide moves an application one screen at a time, with code that compiles.