Polaris React v5.0.0 is a major release that introduces breaking changes, primarily due to removing integrated App Bridge support as consumers using App Bridge should use the @shopify/app-bridge-react package. We have created the Shopify/shopify-app-bridge repository for issues related to the new app bridge packages.
For instructions on updating from v4 to v5, read the migration guide.
Breaking changes
- Upgraded
reactandreact-dompeer-dependencies to 16.9.0 to enable the use ofReact.Profiler(#2462) - Removed
NavigationMessagePropsas theMessagecomponent no longer exists (#2502) - Removed
ResourceList.FilterControlcomponent. TheFilterControlcomponent is available under a private name for legacy Shopify applications, but it should not be relied upon and might be deleted at any point (#2047 #3116) - Removed
AppBridge,ResourcePickerandLoading,Modal,Page,ToastApp Bridge render delegation (#2046) - Dropped support for iOS 9 (#2195)
- Moved several of our build artifacts into a
distfolder (#2938):styles.csshas moved todist/styles.cssstyles.min.csshas been removed - importdist/styles.cssinstead. Styles are compacted by default so the performance hit is negligible.styles.scsshas been removed - importdist/styles.cssanddist/styles/_public-api.scssinstead
- Updated "esnext" build output to ship plain css files instead of scss source files. Apps built using
@shopify/sewing-kitwill need to update to at least version0.132.2. (#2938) - Moved styles from
global.scsstoAppProvider. This change only affects applications using theesnextbuild (applications importing@shopify/polaris/styles.cssaren’t affected), who no longer need to import the@shopify/polaris/esnext/global.scssfile. (#2392) - Reversed the precedence of the language dictionaries passed into the
AppProvider’si18nprop. When passing an array of dictionaries the first dictionary should be your prefered language, followed by any fallback languages. (#2572) - Removed
centeredLayoutprop inEmptyState. All layouts within the new design language context will be center aligned (#3111) - Updated types of
DatePickercomponent -month,yearweekStartsOnare now typed as plainnumber- functionality remains identical as the former types effectively ended up being aliases ofnumberanyway (#3121) - Removed
Yeartype export (used by the DatePicker's props). Replace its usage withnumber. (#3121) - Removed the
Monthenum export (used by the DatePicker's props). Replace its usage with a number from 0 to 11, representing the number of the month in question -Month.Januarybecomes0,Month.Decemberbecomes11etc. (#3121) - Removed the
TypeOfenum, andGeneralObject,DeepPartial,EffectCallback,DependencyListandComparatortype exports - these were for internal use, and were never documented for external use. (#3123)
Enhancements
- Added an activator prop to
Modalso that focus can be returned to it when theModalis closed (#2206)
Bug fixes
- Fixed case where
DatePickerdid not translate the month name in an aria label (#3121)
Dependency upgrades
- Updated browserlist to use
@shopify/browserslist-config(#3101)
Code quality
- Converted
Modalto a functional component (#2376) - Migrated to use
react-transition-groupinstead of the material-ui fork. (#3094) - Removed
withAppProviderhigher-order component. (#3098) - Removed several dependencies on the deprecated
@shopify/javascript-utilitieslibrary (#3102) - Removed dependency on
@shopify/useful-types - Removed dependency on
@shopify/javascript-utilities(#3108)