Migration Guide
Guidelines for migrating to V4
Summary
In the transition from v3 to v4, several enhancements have been incorporated, accompanied by the removal of unused components for improved efficiency. Additionally, certain CSS and JS scripts have been renamed for better organization and clarity.
In addition to these changes, a significant modification involves the discontinuation of the standalone @avalara/skylab-react package.
Instead, a React wrapper is now integrated as an integral component of the core package.
Breaking changes V3 -> V4
aui-ie-banner
- The
aui-ie-bannercomponent is no longer supported. - There is no support for the IE browser.
aui-content-switcher
- The
aui-content-switchercomponent is no longer supported.
custom-properties.css
custom-properties.cssis no longer published as a separate file. These custom properties are defined in the main stylesheet.customPropertiesCssUrlis not available as an export from the Artifactory package's index.js as it is already defined inmain.cssfile.
v3 suffix
- Do not use
-v3as a version suffix in any file name. For instance,skylab-sdk-v3.jswill becomeskylab-sdk.jsin v4. - Updated asset paths from
/v3/<version>/to simply<version>/.
Latest version
<assetsPath>/latestnow represents the most recent version, rather than the latest version of v2.
Guidelines for migrating to V3
Summary
Skylab SDK components are now being implemented using Stencil.js instead of HyperHTML (reasons for making the switch can be found in our Web Component framework research wiki). The change in frameworks has resulted in a better developer experience when creating and updating Skylab components, which will make inner-source contribution easier.
Although the look and functionality of Skylab components are unchanged in V3, there have been some changes to component APIs. CDN asset files (JS and CSS) have also been renamed and relocated. Please see detailed instructions below for more information.
Version 3: Installation and use (non-React)
Install Skylab SDK package
The @avalara/skylab-sdk node module contains useful information, but the main bundle is meant to be
brought into your app with the <script> tag as described below. The following are exported from @avalara/skylab-sdk:
versionassetPath(enables a single source of truth when using server-side rendering for your app's Skylab SDK version)customPropertiesCssUrl
Stylesheet
Scripts
Include both of these before your app code.
Version 3: Installation and use (React)
Install Skylab SDK package
See instructions above, and see Skylab React for usage instructions.
Stylesheet
See instructions above.
Scripts
See instructions above.
Breaking changes V2 -> V3
s-box
secondaryclass styling removed.
s-dialog
- Specify slot names for all s-dialog children elements (
slot="header",slot="body",slot="footer"). Use of the<header>and<footer>tags is no longer accepted. - The
noscrollattribute is no longer supported.
Icon
- Removed icons:
- doc-pdf
- document
- document-2
- document-alert
- doc-csv-filled
- doc-pdf-filled
- folder-2
- image
- image-filled
- pencil
s-input-extended
- The public
valuegetter is no longer available. It has been replaced with a publicgetValue()method, which returns a Promise that resolves to the input's value (a string).
s-menu
s-menuaccepts only<li>children (notaorbutton).
s-select
- The public
valuegetter is no longer available. It has been replaced with a publicgetValue()method, which returns a Promise that resolves to the select's value (single select returns a string; multi-select returns an array of strings).
aui-service-notification
aui-service-notificationis now restricted to text content (no longer accepts HTML children)
s-tag
- Provide tag's text content inside a
spanwithslot="content". - To add an icon to a tag, use the
iconnameattribute instead of adding ans-iconinside the tag.
s-toasts
persistentprop has been deprecated. Toasts will always be persistent. As part of the effort to ensure Skylab SDK meets accessibility compliance requirements, auto-dismissing toasts must not be used.
s-tooltip
- Provide tooltip text content inside an element with
slot="content".
React components
- Tag names have changed for React-wrapped custom elements with the
s-prefix. The React equivalents of these components were formerly calledAlert,Badge,RowExpander, etc. The new tag names are prefixed withS:SAlert,SBadge,SRowExpander, etc.Auiprefixed component tag names are unchanged. - The
RadioGroupReact component tag name has been changed toSRadiogroup. - All event handler names have changed. The former naming pattern (
onSDismiss,onSSelect, etc.) has been changed toonS-dismiss,onS-select, etc.
Migration strategy
Web Component library
Tag and attribute names have not changed in non-React components, so migration should be fairly simple. See the Breaking Changes section for the complete list of API changes. Do a global search for affected components' tag names within your codebase and make changes individually.
React library
Migration from standalone package
The following applies for migration from the standalone @avalara/skylab-react package to the react component library included in the primary Skylab package via @avalara/skylab-sdk/react.
This applies to users migrating from both V2 as well as V3 versions of the @avalara/skylab-react package.
React components are available via a containerRegistry which is initialized at runtime.
This change was made to ensure that the version of the react components used will match the version of skylab included on the page.
Importing components works the same, however it is important to note that it is now necessary that the skylab custom elements have been registered on the page. See the implementation notes on the React usage page.
Previously it was possible for the bundle built with @avalara/skylab-react to include an obsolete version of skylab components even when the page itself was including the latest version of the skylab script.
/* Old way */ // import { Alert } from "@avalara/skylab-react"; // V2 // import { SAlert } from "@avalara/skylab-react"; // V3 // import type { TabItem } from '@avalara/skylab-react'; /* New way */ import { SAlert } from "@avalara/skylab-sdk/react" import type { TabItem } from '@avalara/skylab-sdk';
If your app is using typescript, it may be necessary to use a bundler for client module resololution.
// tsconfig.json "compilerOptions": { "moduleResolution": "bundler", "module": "esnext", }
Migration from V2
When migrating from V2, it will also be necessary to update almost all Skylab tag names. One way to do this is to search/replace V2
component opening/closing tags (e.g. search "<Alert", replace with "<SAlert"). Another way to approach this is to use
import aliases in order to continue using V2 tag names in your code:
import { SAlert as Alert } from "@avalara/skylab-sdk/react"; render() { return <Alert status="warning">Alert text here</Alert> }
Event handler names can easily be changed with a regex find/replace. Search for /\bonS([A-Z])/ (make sure you are
using the case-sensitive setting if using a find/replace panel in your code editor) and replace with /onS-\l$1/.
Component-specific breaking changes apply to React components as well as Web Components.
React 19 and Above Compatibility
Skylab SDK now supports React 19 and above without the need for the React wrapper package (@avalara/skylab-sdk/react).
You will need to add the following file to your React 19 project:
// skylab.d.ts
import { SkylabJSX } from '@avalara/skylab-sdk';
declare module 'react' {
namespace JSX {
interface IntrinsicElements extends SkylabJSX {}
}
}
This will resolve the TypeScript errors you would otherwise experience with Skylab web components.
Questions?
The best place to reach out to us is on the #skylab Slack channel.