Primer React v36 Release Candidate #3685
joshblack
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We're excited to announce the next major release of Primer React! 🥳 Starting in v36, you'll see changes to
@primer/reactthat make it even easier to build consistent, accessible experiences that feel right at home at GitHub.v36 will first be available through a number of Release Candidates. These early releases will be previews of the full release in order for teams to try out v36 and give the team feedback before our final release. To try out the latest release candidate, head over to Getting started. If you have any feedback or questions about this release, we'd love to hear from you in a comment below!
Getting started
To try out the latest Release Candidate for v36 of
@primer/react, run the following command usingnpm:After updating to the latest version, go through the Breaking changes section below to make the necessary changes for your project.
New components ✨
The following components have been moved from
@primer/react/draftsto@primer/react:TreeViewNavListSegmentedControlSplitPageLayoutBreaking changes⚠️
The v36 release of
@primer/reactintroduces several breaking changes to components and changes to the package itself. To understand how to migrate between v35 and v36 of@primer/react, review the sections below to understand how your project may be impacted by these changes.Components
The following list of components have breaking changes to their API or availability in
@primer/react. For a list of deprecated components that have been removed, visit the Removed components section below.AvatarTokenButtonCheckboxFilterListFilterSearchFormControlPageLayoutRadioTextareaTextInputWithTokensUnderlineNavAvatarToken
The
sizeprop forAvatarTokenhas been updated in v36 to only accept"large"and"xlarge".Button
The API for the
Buttoncomponent has been updated to match the specification for this component and align with other implementations like in Primer View Components.The
leadingIconprop has been renamed toleadingVisualThe
trailingIconprop has been renamed totrailingVisualThe
Button.Countercomponent has been removed, use thecountprop insteadThe
outlinevariant has been removed, instead usevariant="invisible"Checkbox
The
validationStatusprop has been updated and no longer supports the'warning'value. Instead, only'error'and'success'are supported.FilterList
The
FilterListcomponent has been deprecated in v36 in favor of theActionListcomponent. To continue using this component, update your imports forFilterListto import from thedeprecatedentrypoint.FilterSearch
The
FilterSearchcomponent has been deprecated in v36. A new filter component is currently in progress but is not yet available. Until a new component is ready, use a combination ofButton,TextInput, andActionListto reproduce this component. To continue using this component, update your imports forFilterSearchto import from thedeprecatedentrypoint.FormControl
The
variantprop for theFormControl.Validationcomponent has been updated to no longer support the'warning'value. Instead, only'error'and'success'are supported.PageLayout
The
positionprop has been removed fromPageLayout.Panein order to address an accessibility issue when ordering elements on a page with CSS. Instead of relying onpositionto order the different sections ofPageLyout, use source order.Radio
The
validationStatusprop has been updated and no longer supports the'warning'value. Instead, only'error'and'success'are supported.Textarea
The
validationStatusprop has been updated and no longer supports the'warning'value. Instead, only'error'and'success'are supported.TextInputWithTokens
The
sizeprop has been updated to no longer accept theextralargevalue. Usexlargeinstead.UnderlineNav
The implementation for
UnderlineNavhas been updated in v36. Certainpropsfor UnderlineNav have been removed and theUnderlineNav.Linkcomponent has been replaced byUnderlineNav.Item.actionsalignfullUnderlineNav.Itemcomponentselectedaria-currentpropTo continue using the implementation for
UnderlineNavfromv35, import the component from@primer/react/deprecated.Removed components
The following deprecated components have been removed from
@primer/react/deprecatedand are no longer be available.BorderBox<BorderBox>→<Box borderWidth='1px' borderStyle='solid' borderColor='border.primary' borderRadius={2}>ChoiceFieldsetCheckboxGrouporRadioGroupcomponentItemCheckboxGrouporRadioGroupcomponentChoiceInputFieldFormControlcomponentFlexBoxcomponent,<Flex>→<Box display="flex">GridBoxcomponent,<Grid>→<Box display="grid">PositionBoxcomponent,<Position>→<Box>AbsoluteBoxcomponent,<Absolute>→<Box position="absolute">FixedBoxcomponent,<Fixed>→<Box position="fixed">RelativeBoxcomponent,<Relative>→<Box position="relative">StickyBoxcomponent,<Sticky>→<Box position="sticky">DropdownActionMenucomponentFormGroupFormControlcomponentInputFieldFormControlcomponentLabelLabelcomponent from the@primer/reactentry pointSelectMenuActionMenucomponentActionListActionListcomponent from the@primer/reactentry pointActionMenuActionMenucomponent from the@primer/reactentry pointDropdownButtonActionMenucomponentDropdownMenuActionMenucomponentButtonButtoncomponent from the@primer/reactentry pointButtonDangerButtoncomponent withvariant="danger"ButtonOutlineButtoncomponent withvariant="outline"ButtonPrimaryButtoncomponent withvariant="primary"ButtonInvisibleButtoncomponent withvariant="invisible"ButtonTableListActionMenucomponentButtonCloseIconButtoncomponent,<IconButton icon={XIcon} aria-label="Close" />Package 📦
Changes to peer dependencies 🏗️
The following peer dependencies have been updated, or added, to require a new minimum version in v36 of
@primer/react:react^17.0.0 || ^18.0.0^18.0.0react-dom^17.0.0 || ^18.0.0^18.0.0styled-components4.x || 5.x5.x@types/styled-components5.xThese dependencies will need to be updated or installed in your project if you are not using the corresponding version range for v36. To see if you're using the correct versions, look in your project's
package.jsonfile and see if the versions match the table above.draftshas been moved toexperimentalThe
draftsentrypoint has been deprecated in v35 and removed in v36. It has been replaced by theexperimentalentrypoint to better reflect the component lifecycle process for Primer.Beta Was this translation helpful? Give feedback.
All reactions