Releases: Shopify/polaris-react
v4.0.0
Polaris React v4.0.0 is a major release that introduces breaking changes, primarily due to updates made to component internals. This builds a stronger foundation that ensures readiness for future React performance improvements.
This release doesn’t include any new components, but it does update some components to use React Hooks. It also deletes several deprecated features and removes dependencies on legacy context and unsafe lifecycle methods. Thanks to these improvements, Polaris React is React Strict Mode compliant.
For instructions on updating from v3 to v4, read the migration guide.
Breaking changes
- Removed
groupsprop onSelect. Pass groups to theoptionsprop instead. (#1831) - Removed
Autocomplete.ComboBox.TextFieldandAutocomplete.ComboBox.OptionList. You should use theAutocomplete.TextFieldandOptionListcomponents instead. (#1830) - Removed
secondaryFooterActionprop onCard. Pass an array of secondary actions to thesecondaryFooterActionsprop instead. (#1831) - Removed
iconBodyprop onNavigation.Item. Pass a string to theiconprop instead. (#1831) - Removed the
WithContextcomponent, as it was an undocumented part of the public API meant for internal use only (#1641) - Removed the
WithRefcomponent, as it was an undocumented part of the public API meant for internal use only (#1610) - Removed support for passing a string into
<Icon source>to load a bundled icon. You must load the required icon directly from@shopify/polaris-iconsinstead. (#1604) - Removed support for passing an
SvgSourceshaped object into<Icon source>to load an icon imported using Shopify’s legacy icon loader. You must update sewing-kit to at least v0.82.0 which replaced the legacy loader with using SVGR. (#1604) - Removed support for passing a React Element into
<Icon source>. You must pass in a React Component that returns an SVG element instead. (#1604) - Removed support for
<Icon untrusted>. Passing a string intosourcewill now always load an untrusted icon, you don't need that additional property. (#1604). - Removed
Navigation.UserMenu. UseTopBar.UserMenuinstead. (#1599) - Made
titlea required prop onChoiceListto improve accessibility. It can be hidden withtitleHidden. (#1575) - Made
i18na required prop onAppProvider. Usage instructions are included in theAppProviderdocs. (#1530) - Upgraded
reactandreact-dompeer-dependencies to 16.8.6 to enable the use of hooks (#1525) - Changed the import method for React to use default imports. Applications consuming Polaris using TypeScript must enable
esModuleInteropintsconfig.json. (#1523) - Removed
LinkLikeComponenttype export. UseAppProviderProps['linkComponent']instead. (#1864) - Removed the
Modal.DialogandTabs.Panelsubcomponents as they were undocumented parts of our public API meant for internal use only (#1899).
Enhancements
- Added a new
create-react-appexample in TypeScript demonstrating use of Polaris withreact-testing(#1937) - Exported
AppliedFilterInterfaceandFilterInterfacefromFilters(#1924) - Improved color contrast of links inside
Banner(#1651) - Add underline to Links and Plain button on hover, so it doesn't rely on color alone for accessibility (#1885)
- Add
onQueryFocuscallback prop to theFilterscomponent (#1948)
Bug fixes
- Fixed types merge of
ActionMenuMenuActionandMenuGroup.actions(#1895) - Fixed the activator buttons of
PageactionGroupsnot toggling thePopoveractivestate on click #1905 - Fixed Windows high contrast support of
Badgeprogress(#1928) - Fixed
BulkActionButtonfrom throwing an error incomponentDidMount(#1913) - Fixed
ToastManagerfrom not working correctly inReact.StrictMode(#1741) - Updated translation.yml with the new locales path (#1649)
- Fixed accessibility issue with
Tabslist item presentation role (#1958) - Fixed cross-origin error being thrown in
Modalwhen loading an external app (#1992) - Fixed regression in
PopoverOverlaycausingonCloseto be fired when Popover is opening and trigger was not the activator (#2000) - Fixed issue with
ContextualSaveBarblocking search when hidden (#2044)
Documentation
- Updated
AppProviderapp bridge example to use ourAppBridgeContext(#1877)
Development workflow
- Added support for React hooks in Storybook (#1665)
- Created
toBeDisabled,mountWithContextand added custom testing matchers (#1596) - Added
PolarisTestProviderhelper to ease configuration of required Polaris contexts in tests, see polaris examples for usage (#1810) - Enabled strict mode in TypeScript (#1883)
- Moved to
unpkg.comfor our CDN CSS assets, instead of usingsdks.shopifycdn.com. Existing URLs will continue to work but new versions will only be available atunpkg.com. (#1960) - Added ChromaUI integration for previewing Storybook builds, to potentially replace our self-hosted Heroku instance (#1975)
Dependency upgrades
- Updated
@shopify/polarisin all examples to 4.0.0-rc.2 (#1937) - Added
@material-ui/react-transition-groupand removedreact-transition-groupto supportReact.StrictMode(#1759) - Added
@shopify/react-testing(#1596) - Removed
@shopify/css-utilities(#1586) - Removed
@types/prop-typesandprop-types(#1505) - Updated
reactto 16.8.6 andenzymeto 3.9.1 (#1392)
Code quality
- Bumped test coverage in
Collapsible(#1929) - Bumped test coverage in
DropZone,Frame,Icon, andLoading(#1927) - Removed unused type definitions (#1862)
- Ignored deprecation warnings related to Shopify App Bridge in tests (#1852)
- Updated
withAppProviderto use a functional component rather than a class component (#1813) - Updated
Linkto useuseI18nrather thanwithAppProvider(#1806) - Updated several components to use hooks instead of
withAppProvider(#1797) - Removed
CSSTransitionfromPopoverOverlay(#1756) - Updated exports in
src/utilitiesandsrc/test-utilitiesto named exports (#1717) - Removed test errors and non-deprecation warnings (#1715)
- Enabled
React.StrictModein test components and Storybook (#1709) - Removed all uses of
ReactDOM.findDOMNode(#1696) - Enabled
react/no-unsafeESLint rule withcheckAliases([#169...
v3.21.1
v3.21.0
Enhancements
- Added a
subtitleandthumbnailprop toPage(#1880)
Bug fixes
- Fixed accessibility issue with ChoiceList errors not being correctly connected to the inputs (#1824)
- Fixed
Tabaria-controlspointing to a non-existentPanelid(#1869) - Fixed
Toastaccessibility issue by movingaria-liveprop toToastManager(#1873)
Code quality
- Use
@shopify/typescript-configsas the base oftsconfig.jsonfor the project (#1829)
v3.20.0
Enhancements
- Added a
verticalAlignprop toDataTable(#1790) - Improved focus and hover states for
Navigation(#1822)
Bug fixes
- Fixed the
SearchInputclear button which was overflowing the search bar in Firefox 65+ (#1795) - Fixed a bug preventing the display of
Tooltipwhen cursor enters from a disabled element (#1783) - Fixed React imports in the
Filterscomponent to useimport * as Reactfor projects that don't useesModuleInterop(#1820) - Fixed
tabIndexonmainelement causing event delegation issues (#1821) - Fixed icon color for destructive ActionList items (#1836)
- Fixed not being able to explictly set
autoCompleteprop onAutocomplete.TextField(#1839)
Documentation
- Added links to App Bridge React component documentation in deprecation notices for embedded components (#1765)
- Improved link text for App Bridge deprecation notices #1802
Development workflow
- Use explicit imports for our base sass mixins instead of having them implicitly defined at build-time. This simplifies our build config and other tooling that wants to build us from source [#1680]
v3.19.0
New components
Filters: Use to filter the items of a list or table (#1718)
Enhancements
- Added the rollover and Windows high contrast mode to
Disclosurebutton onTabs(#1755) - Added support for disabling all choices in
ChoiceList(#1758) - Components in our sass build (the
stylesfolder) are now precompiled to avoid the chance of accidentally overwriting any of our global variables, mixins and functions (#1764) - Changed
Skip to contentto render an anchor instead of a button to meet accessibility level A guidelines (#1785)
Bug fixes
- Fixed a regression introduced in #1247, where icons inside of
Linkwould always be recolored to match the text color (#1729) - Fixed the
DiscardConfirmationModalnot closing when the discard button is clicked (#1784) - Fixed
Navigation.ItemsecondaryActionwrapping when content wraps (#1678)
Documentation
- Added links to App Bridge React component documentation in deprecation notices for embedded components (#1765)
Development workflow
v3.18.0
New components
ActionMenu: Use for display of actions and action groups within the context of a header (#1653)
Enhancements
- Added the
stopAnnouncementsprop toBanner, which disables screen reader announcements when content changes (#1719) - Add
selectableprop toResourceListcomponent (thanks to @vict-shevchenko for the pull request) - Allow
LinkandButtoninteractions when rendered asprefix/suffixwithin<TextField />(#1394) - Improve
TextFieldso that character count is only announced on focus. (#1720) ActionListcan now pass a uniqueaccessibilityLabelto eachItem(#1653)- Greatly reduced complexity of
Page > Header(#1653) - Long
Page > Headerbreadcrumb labels will now truncate instead of breaking layout (#1653) - Improves performance of
TabMeasurecomponent (#1544) - Added
secondaryFooterActionsprop toCardwhich adds an action list of secondary actions to the footer #1625
Bug fixes
- Fixes
monochromevariant ofLinkandButtoncomponents to support multi-line link text (#1686) - Fixed the first column of
DataTablenot rendering in iOS Safari (#1605) - Fixed paint loss on scroll of
TextFieldSpinner(#1740)
Documentation
- Mentioned that the Contextual Save Bar is now available for embedded apps through App Bridge directly #1721
- Mentioned Polaris icons in the Icon component documentation (#1693)
- Added an example to
Cardfor custom action layout with a secondary action and a plain button (thanks to @sharoonthomas for the pull request)
Development workflow
- Updated Storybook to
v5.1.9(#1728)
Code quality
- Updated
PositionedOverlayto no longer usecomponentWillReceiveProps(#1621)
Deprecations
CardsecondaryFooterActionis now deprecated. Set an array of secondary actions on thesecondaryFooterActionsprop instead #1625
v3.17.0
Deprecations
- Deprecated passing a string representing a "bundled icon" into
<Icon source>Pass in an svg component imported from@shopify/polaris-iconsinstead (#1534). - Deprecated all usage of the Shopify App Bridge in Polaris React (#1573)
Enhancements
- Made the
actionprop optional onEmptyState(#1583) - Prevented Firefox from showing an extra dotted border on focused buttons (#1409)
- Added
resolveItemIdprop toResourceListwhich is used in the new multiselect feature (#1261) - Added
actionsprop to<Card.Section>to allow you to easily define header actions in a card section (#1598) - Added
<Card.Subsection>to allow you to further subdivide<Card.Section>in a consistent manner (#1611) - Removed transition on tag button hover state #1337
- Added
textAlignprop to Button (#1576) - Made
Buttonred when given both theplainanddestructiveprops (#1603) - Added support for disabled, destructive, and loading actions in
CardandCard.Section(#1622)
Bug fixes
- Removed unnecessary border-radius from
Modalbody (#1584) - Fixed accessibility issues in
DropZone,Form,Modal,Section,Page,Tabs,TextFieldandTopBar(#1565,#1582). - Fixed inconsistent width depending on your browser/version in
Sheet(#1569) - Fixed text and other elements from being selected in Safari when dragging the color picker (#1562)
- Fixed
Bannertitleoverflowing when set to a single long word (#1553) - Remove export of
CombinedPropsand unneccessary export for Class based components (#1592) - Fixed improper spacing and coloring on a
TextFieldprefix (#1132) - Fixed
ResourcePickernot updating function references foronSelectionandonCancelcallbacks #1451 - Fixed
TextFieldlabelbeing set as the value of thelabelnode, as well as thearia-labelaria-labelledbyattributes, when only one method will suffice (#1615) - Fixed accessibility issues for Windows High Contrast mode on
TabsandPopover(#1629)
Documentation
- Updated icon documentation to use imports from polaris-icons (#1561)
- Fixed an accessibility issue in the
Collapsiblecomponent example (#1591) - Added accessibility documentation for the
RangeSlidercomponent (#1630) - Added accessibility documentation for the
Collapsiblecomponent (#1631) - Added accessibility documentation for the
DescriptionListcomponent (#1634) - Added accessibility documentation for the
Formcomponent (#1636) - Added accessibility documentation for the
ExceptionListcomponent (#1635) - Added accessibility documentation for the
KeyboardKeycomponent (#1640) - Added accessibility documentation for the
Tagcomponent (#1647) - Added accessibility documentation for the
Modalcomponent (#1648)
Development workflow
- Made the a11y test that runs in CI fail if it finds any issues (#1564)
- Updated Storybook to
v5.1.0-rc.4(#1616) - Fixed a visual regression testing issue with the Card component (#1618)
- Updated to sewing-kit v0.85.5 (#1633)
Dependency upgrades
- Upgraded TypeScript dependency to
3.5.1(#1650)
Code quality
v3.16.0
Enhancements
- Added support for dual values to
RangeSlidercomponent (#1436) - Updated type restrictions for
AnnotatedSectionto allow itstitleprop to acceptReact.ReactNodeinstead ofstring(#1431)
Bug fixes
- Fixed an issue where the JavaScript breakpoints incorrectly set the navigation bar collapsed breakpoint (#1475)
- Added a border to
Toastmessages to make them more visible in Windows high contrast mode (#1469) - Added
box-shadowto theBannerto make it more visible in Windows high contrast mode (#1481) - Added
box-shadowto theCardto make it more visible in Windows high contrast mode (#1524) - Fixed UI regressions in
Navigationcomponent hover and active states (#1551)
Development workflow
- Updated Storybook to
v5.1.0-alpha.39, improving component search-ability in the sidebar (#1488)
Dependency upgrades
v3.15.0
This release fixes an issue introduced in v3.14.0 that caused the esnext build not to succeed resulting in build errors for consumers (#1466)
Enhancements
- Enhanced
NavigationItem's color accessibility foractive,focus,hoverandSelectedstates (1304) - Added
alignprop toTextField(#1428) - Added
clearButtonprop toTextField(#1226)
Bug fixes
- Fixed
Checkboxfrom improperly toggling when disabled (#1467) - Fixed
Popoverfade-in flutter on iOS by switching Transition component for CSSTransition (#1400) - Improved the visibility of focus styles for the
Linkcomponent. (#1425)
Documentation
- Updated accessibility testing documentation (#1449)
- Added guidelines for tertiary actions in modals to
Modalcomponent documentation (#1336)
Development workflow
- Updated the a11y shitlist and re-enabled the pa11y job in CI. The job always passes for now, as a way for us to judge whether it is stable and can be made a required check. (#1456)
Code quality
- Simplified logic in Checkbox component (#1453)
v3.14.0
esnext build to fail, resulting in errors for consumers of this particular bundle (fixed in 3.15.0).
New components
- Added the
Sheetcomponent (#1250)
Enhancements
- Added translations for all supported locales (#1358)
- Improved the performance of
ResourceList(#1313) - Added
withinContentContainercontext toNavigation(#1393) - Added support for
Tooltipcontent to wrap nonbreaking strings #1395
Bug fixes
- Removed
windowcall onserverexecuted code #1427 - Fixed
onClickfrom firing three times when using the enter key on aResourceListitem (#1188) - Resolved console
[Intervention]errors for touch interactions onColorPicker(#1414) - Fixed page scrolling while interacting with the color slider (#1414)
- Applied
font-familytobuttonelements which were being overridden by User Agent Stylesheet (#1397) - Fixed
Checkboxbeing toggled when disabled (#1369) - Fixed
DropZone.FileUploadfrom incorrectly displaying action hint and title when the default is used and removed (#1233) - Fixed
ResourceList.Iteminteraction states from being incorrectly applied (#1312 - Fixed selected state for date picker in Windows high contrast mode (#1342)
- Fixed accessibility of skeleton components for Windows high contrast mode (#1341)
- Fixed
Loadingvisibility in Windows high contrast mode (#1389) - Fixed the position calculation of the
PositionedOverlaycomponent after scroll (#1382) - Fixed styling issue for
Paginationwhen used withTooltip(#1277) - Fixed certain children of a
TextContainerhaving no top margin (#1357) - Added border to
Tooltipin Windows high contrast mode (#1405) - Fixed
Navigation.Sectionrollup collapsing whenNavigation.ItemsubNavigationItemsexpand (#1417)
Documentation
- Updated
Linkaccessibility documentation for theexternalprop to reflect new behavior (#1347) - Added accessibility documentation for
VisuallyHidden(#1348) - Added accessibility documentation for
TextStyle(#1350) - Added accessibility guidance for
HeadingandSubheading(#1351) - Added accessibility documentation for
ListandStack(#1353) - Added accessibility guidance for
DisplayText(#1354) - Added guidance for updating component documentation and tophatting style guide changes (#1362)
- Added accessibility documentation and guidance for
ActionListandOptionList(#1365) - Added accessibility documentation for
CardandCalloutCard(#1366) - Added accessibility documentation for
Badge(#1364) - Added accessibility documentation for
Icon(#1404) - Added accessibility documentation for
Popover(#1408) - Fixed content example for
ContextualSaveBarguidelines (#1423)
Dependency upgrades
- Updated most
devDependencies(#1327) - Bumped
@shopify/react-utilitesto remove a transitive dependency oncore-js(#1343) - Updated App Bridge to version 1.3.0 (#1349)
- Updated
typescriptto 3.2.4 (#1388) - Updated
sewing-kitto 0.83.1 and babel-preset-shopify to ^18.1.0 (#1344)