-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate space
custom properties from v11 to v12
#10585
Conversation
594b55e
to
78b0b49
Compare
675d60f
to
678aee3
Compare
/snapit |
🫰✨ Thanks @laurkim! Your snapshots have been published to npm. Test the snapshots by updating your yarn add @shopify/polaris-migrator@0.0.0-snapshot-release-20230920210702 yarn add @shopify/polaris@0.0.0-snapshot-release-20230920210702 yarn add @shopify/polaris-tokens@0.0.0-snapshot-release-20230920210702 yarn add @shopify/stylelint-polaris@0.0.0-snapshot-release-20230920210702 |
space
custom properties from v11 to v12
🫰✨ Thanks @laurkim! Your snapshots have been published to npm. Test the snapshots by updating your yarn add @shopify/polaris-migrator@0.0.0-snapshot-release-20230921213347 yarn add @shopify/polaris@0.0.0-snapshot-release-20230921213347 yarn add @shopify/polaris-tokens@0.0.0-snapshot-release-20230921213347 yarn add @shopify/stylelint-polaris@0.0.0-snapshot-release-20230921213347 |
/snapit |
🫰✨ Thanks @laurkim! Your snapshots have been published to npm. Test the snapshots by updating your yarn add @shopify/polaris-migrator@0.0.0-snapshot-release-20230922182129 yarn add @shopify/polaris@0.0.0-snapshot-release-20230922182129 yarn add @shopify/polaris-tokens@0.0.0-snapshot-release-20230922182129 yarn add @shopify/stylelint-polaris@0.0.0-snapshot-release-20230922182129 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked over the all the manual migrations and they LGTM! 💯🚢✨🎉 Also quickly checked over the automatic ones and they also look good.
05ba974
to
58ce977
Compare
/snapit |
🫰✨ Thanks @laurkim! Your snapshots have been published to npm. Test the snapshots by updating your yarn add @shopify/polaris-migrator@0.0.0-snapshot-release-20230925125256 yarn add @shopify/polaris@0.0.0-snapshot-release-20230925125256 yarn add @shopify/polaris-tokens@0.0.0-snapshot-release-20230925125256 yarn add @shopify/stylelint-polaris@0.0.0-snapshot-release-20230925125256 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @shopify/polaris@11.21.0 ### Minor Changes - [#10585](#10585) [`45fc3a01f`](45fc3a0) Thanks [@laurkim](https://github.com/laurkim)! - Migrated `space` custom properties from `v11` to `v12` ### Patch Changes - Updated dependencies \[[`45fc3a01f`](45fc3a0)]: - @shopify/polaris-tokens@7.12.0 ## @shopify/polaris-tokens@7.12.0 ### Minor Changes - [#10585](#10585) [`45fc3a01f`](45fc3a0) Thanks [@laurkim](https://github.com/laurkim)! - Migrated `space` custom properties from `v11` to `v12` ## @shopify/stylelint-polaris@14.1.0 ### Minor Changes - [#10585](#10585) [`45fc3a01f`](45fc3a0) Thanks [@laurkim](https://github.com/laurkim)! - Migrated `space` custom properties from `v11` to `v12` ### Patch Changes - Updated dependencies \[[`45fc3a01f`](45fc3a0)]: - @shopify/polaris-tokens@7.12.0 ## @shopify/polaris-migrator@0.22.7 ### Patch Changes - Updated dependencies \[[`45fc3a01f`](45fc3a0)]: - @shopify/polaris-tokens@7.12.0 - @shopify/stylelint-polaris@14.1.0 ## polaris.shopify.com@0.58.0 ### Minor Changes - [#10585](#10585) [`45fc3a01f`](45fc3a0) Thanks [@laurkim](https://github.com/laurkim)! - Migrated `space` custom properties from `v11` to `v12` ### Patch Changes - Updated dependencies \[[`45fc3a01f`](45fc3a0)]: - @shopify/polaris@11.21.0 - @shopify/polaris-tokens@7.12.0 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
### WHY are these changes introduced? Forgot to add a changeset when I merged [this](#10585) into `next`.
### WHY are these changes introduced? Resolves Shopify#10535. Migrates `space` custom properties from `v11` to `v12`. This PR includes both automated and manual migrations. ### WHAT is this pull request doing? To migrate `space` custom properties, the flow was to: - Handle automatic migrations ```sh # Space migration npx @shopify/polaris-migrator@0.0.0-snapshot-release-20230918165951 \ v12-styles-replace-custom-property-space \ 'src/**/*.scss' # Stash files with "polaris-migrator:" comments git stash push $(grep -r -l "polaris-migrator:" $(git ls-files -m)) # Stage all migrated files git add . # Format staged files only git diff --staged --name-only | xargs npx prettier --write # Commit automated migrations git commit -m "Migrate space custom properties from v11 to v12" ``` - Handle manual migrations ```sh # Bring back the files with "polaris-migrator:" comments git stash pop ``` - Search for "polaris-migrator:" comments and handle manual migrations - Search for and handle manual migrations (e.g. <Box padding="1_5_experimental">) <br> ```sh # Stage all manually migrated files git add . # Format staged files only git diff --staged --name-only | xargs npx prettier --write # Commit manual migrations git commit -m "Manually migrate space custom properties from v11 to v12" ``` - Check for errors after all custom property migrations are finished ```sh # Run stylelint against polaris-react npx stylelint 'polaris-react/src/**/*.scss' ``` ### How to 🎩 #### Post-migration validation After migrating use the following RegExp to check for any additional instances of `space` custom properties across all file types: <details> <summary>Check RegExp for hardcoded <code>space</code> custom properties across all file types</summary> ``` (?:--p-space-05|--p-space-1|--p-space-1_5-experimental|--p-space-2|--p-space-3|--p-space-4|--p-space-5|--p-space-6|--p-space-8|--p-space-10|--p-space-12|--p-space-16|--p-space-20|--p-space-24|--p-space-28|--p-space-32)(?![\w-]) ``` </details> <details> <summary>Check RegExp for outdated <code><Tooltip padding="..." /></code> props</summary> ``` <Tooltip[^>\w](?:[^>]|\n)*?padding ``` </details> <details> <summary>Check RegExp for outdated <code><HorizontalGrid gap="..." /></code> props</summary> ``` <HorizontalGrid[^>\w](?:[^>]|\n)*?gap ``` </details> <details> <summary>Check RegExp for outdated <code><Box padding="..." /></code> props</summary> ``` <Box[^>\w](?:[^>]|\n)*?padding ``` </details> <details> <summary>Check RegExp for outdated <code><Box paddingBlockStart="..." /></code> props</summary> ``` <Box[^>\w](?:[^>]|\n)*?paddingBlockStart ``` </details> <details> <summary>Check RegExp for outdated <code><Box paddingBlockEnd="..." /></code> props</summary> ``` <Box[^>\w](?:[^>]|\n)*?paddingBlockEnd ``` </details> <details> <summary>Check RegExp for outdated <code><Box paddingInlineStart="..." /></code> props</summary> ``` <Box[^>\w](?:[^>]|\n)*?paddingInlineStart ``` </details> <details> <summary>Check RegExp for outdated <code><Box paddingInlineEnd="..." /></code> props</summary> ``` <Box[^>\w](?:[^>]|\n)*?paddingInlineEnd ``` </details> <details> <summary>Check RegExp for outdated <code><Box insetBlockStart="..." /></code> props</summary> ``` <Box[^>\w](?:[^>]|\n)*?insetBlockStart ``` </details> <details> <summary>Check RegExp for outdated <code><Box insetBlockEnd="..." /></code> props</summary> ``` <Box[^>\w](?:[^>]|\n)*?insetBlockEnd ``` </details> <details> <summary>Check RegExp for outdated <code><Box insetInlineStart="..." /></code> props</summary> ``` <Box[^>\w](?:[^>]|\n)*?insetInlineStart ``` </details> <details> <summary>Check RegExp for outdated <code><Box insetInlineEnd="..." /></code> props</summary> ``` <Box[^>\w](?:[^>]|\n)*?insetInlineEnd ``` </details> <details> <summary>Check RegExp for outdated <code><VerticalStack gap="..." /></code> props</summary> ``` <VerticalStack[^>\w](?:[^>]|\n)*?gap ``` </details> <details> <summary>Check RegExp for outdated <code><HorizontalStack gap="..." /></code> props</summary> ``` <HorizontalStack[^>\w](?:[^>]|\n)*?gap ``` </details> <details> <summary>Check RegExp for outdated <code><Choice bleed="..." /></code> props</summary> ``` <Choice[^>\w](?:[^>]|\n)*?bleed ``` </details> <details> <summary>Check RegExp for outdated <code><Choice bleedBlockStart="..." /></code> props</summary> ``` <Choice[^>\w](?:[^>]|\n)*?bleedBlockStart ``` </details> <details> <summary>Check RegExp for outdated <code><Choice bleedBlockEnd="..." /></code> props</summary> ``` <Choice[^>\w](?:[^>]|\n)*?bleedBlockEnd ``` </details> <details> <summary>Check RegExp for outdated <code><Choice bleedInlineStart="..." /></code> props</summary> ``` <Choice[^>\w](?:[^>]|\n)*?bleedInlineStart ``` </details> <details> <summary>Check RegExp for outdated <code><Choice bleedInlineEnd="..." /></code> props</summary> ``` <Choice[^>\w](?:[^>]|\n)*?bleedInlineEnd ``` </details> <details> <summary>Check RegExp for outdated <code><RadioButton bleed="..." /></code> props</summary> ``` <RadioButton[^>\w](?:[^>]|\n)*?bleed ``` </details> <details> <summary>Check RegExp for outdated <code><RadioButton bleedBlockStart="..." /></code> props</summary> ``` <RadioButton[^>\w](?:[^>]|\n)*?bleedBlockStart ``` </details> <details> <summary>Check RegExp for outdated <code><RadioButton bleedBlockEnd="..." /></code> props</summary> ``` <RadioButton[^>\w](?:[^>]|\n)*?bleedBlockEnd ``` </details> <details> <summary>Check RegExp for outdated <code><RadioButton bleedInlineStart="..." /></code> props</summary> ``` <RadioButton[^>\w](?:[^>]|\n)*?bleedInlineStart ``` </details> <details> <summary>Check RegExp for outdated <code><RadioButton bleedInlineEnd="..." /></code> props</summary> ``` <RadioButton[^>\w](?:[^>]|\n)*?bleedInlineEnd ``` </details> <details> <summary>Check RegExp for outdated <code><Checkbox bleed="..." /></code> props</summary> ``` <Checkbox[^>\w](?:[^>]|\n)*?bleed ``` </details> <details> <summary>Check RegExp for outdated <code><Checkbox bleedBlockStart="..." /></code> props</summary> ``` <Checkbox[^>\w](?:[^>]|\n)*?bleedBlockStart ``` </details> <details> <summary>Check RegExp for outdated <code><Checkbox bleedBlockEnd="..." /></code> props</summary> ``` <Checkbox[^>\w](?:[^>]|\n)*?bleedBlockEnd ``` </details> <details> <summary>Check RegExp for outdated <code><Checkbox bleedInlineStart="..." /></code> props</summary> ``` <Checkbox[^>\w](?:[^>]|\n)*?bleedInlineStart ``` </details> <details> <summary>Check RegExp for outdated <code><Checkbox bleedInlineEnd="..." /></code> props</summary> ``` <Checkbox[^>\w](?:[^>]|\n)*?bleedInlineEnd ``` </details> <details> <summary>Check RegExp for outdated <code><Stack gap="..." /></code> props</summary> ``` <Stack[^>\w](?:[^>]|\n)*?gap ``` </details> <details> <summary>Check RegExp for outdated <code><Grid gap="..." /></code> props</summary> ``` <Grid[^>\w](?:[^>]|\n)*?gap ``` </details> <details> <summary>Check RegExp for outdated <code><Grid gapX="..." /></code> props</summary> ``` <Grid[^>\w](?:[^>]|\n)*?gapX ``` </details> <details> <summary>Check RegExp for outdated <code><Grid gapY="..." /></code> props</summary> ``` <Grid[^>\w](?:[^>]|\n)*?gapY ``` </details> <details> <summary>Check RegExp for outdated <code><Card padding="..." /></code> props</summary> ``` <Card[^>\w](?:[^>]|\n)*?padding ``` </details> <details> <summary>Check RegExp for outdated <code><Bleed marginInline="..." /></code> props</summary> ``` <Bleed[^>\w](?:[^>]|\n)*?marginInline ``` </details> <details> <summary>Check RegExp for outdated <code><Bleed marginBlock="..." /></code> props</summary> ``` <Bleed[^>\w](?:[^>]|\n)*?marginBlock ``` </details> <details> <summary>Check RegExp for outdated <code><Bleed marginBlockStart="..." /></code> props</summary> ``` <Bleed[^>\w](?:[^>]|\n)*?marginBlockStart ``` </details> <details> <summary>Check RegExp for outdated <code><Bleed marginBlockEnd="..." /></code> props</summary> ``` <Bleed[^>\w](?:[^>]|\n)*?marginBlockEnd ``` </details> <details> <summary>Check RegExp for outdated <code><Bleed marginInlineStart="..." /></code> props</summary> ``` <Bleed[^>\w](?:[^>]|\n)*?marginInlineStart ``` </details> <details> <summary>Check RegExp for outdated <code><Bleed marginInlineEnd="..." /></code> props</summary> ``` <Bleed[^>\w](?:[^>]|\n)*?marginInlineEnd ``` </details> #### Replacement maps | Deprecated CSS Custom Property | Replacement Value | | ---------------- | ----------------- | | `--p-space-05` | `--p-space-050` | | `--p-space-1` | `--p-space-100` | | `--p-space-1_5-experimental` | `--p-space-150` | | `--p-space-2` | `--p-space-200` | | `--p-space-3` | `--p-space-300` | | `--p-space-4` | `--p-space-400` | | `--p-space-5` | `--p-space-500` | | `--p-space-6` | `--p-space-600` | | `--p-space-8` | `--p-space-800` | | `--p-space-10` | `--p-space-1000` | | `--p-space-12` | `--p-space-1200` | | `--p-space-16` | `--p-space-1600` | | `--p-space-20` | `--p-space-2000` | | `--p-space-24` | `--p-space-2400` | | `--p-space-28` | `--p-space-2800` | | `--p-space-32` | `--p-space-3200` | 🖥 [Local development instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development) 🗒 [General tophatting guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md) 📄 [Changelog guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog) ### 🎩 checklist - [x] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [x] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [ ] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [ ] Updated the component's `README.md` with documentation changes - [ ] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
WHY are these changes introduced?
Resolves #10535.
Migrates
space
custom properties fromv11
tov12
.This PR includes both automated and manual migrations.
WHAT is this pull request doing?
To migrate
space
custom properties, the flow was to:Handle automatic migrations
Handle manual migrations
# Bring back the files with "polaris-migrator:" comments git stash pop
Check for errors after all custom property migrations are finished
How to 🎩
Post-migration validation
After migrating use the following RegExp to check for any additional instances of
space
custom properties across all file types:Check RegExp for hardcoded
space
custom properties across all file typesCheck RegExp for outdated
<Tooltip padding="..." />
propsCheck RegExp for outdated
<HorizontalGrid gap="..." />
propsCheck RegExp for outdated
<Box padding="..." />
propsCheck RegExp for outdated
<Box paddingBlockStart="..." />
propsCheck RegExp for outdated
<Box paddingBlockEnd="..." />
propsCheck RegExp for outdated
<Box paddingInlineStart="..." />
propsCheck RegExp for outdated
<Box paddingInlineEnd="..." />
propsCheck RegExp for outdated
<Box insetBlockStart="..." />
propsCheck RegExp for outdated
<Box insetBlockEnd="..." />
propsCheck RegExp for outdated
<Box insetInlineStart="..." />
propsCheck RegExp for outdated
<Box insetInlineEnd="..." />
propsCheck RegExp for outdated
<VerticalStack gap="..." />
propsCheck RegExp for outdated
<HorizontalStack gap="..." />
propsCheck RegExp for outdated
<Choice bleed="..." />
propsCheck RegExp for outdated
<Choice bleedBlockStart="..." />
propsCheck RegExp for outdated
<Choice bleedBlockEnd="..." />
propsCheck RegExp for outdated
<Choice bleedInlineStart="..." />
propsCheck RegExp for outdated
<Choice bleedInlineEnd="..." />
propsCheck RegExp for outdated
<RadioButton bleed="..." />
propsCheck RegExp for outdated
<RadioButton bleedBlockStart="..." />
propsCheck RegExp for outdated
<RadioButton bleedBlockEnd="..." />
propsCheck RegExp for outdated
<RadioButton bleedInlineStart="..." />
propsCheck RegExp for outdated
<RadioButton bleedInlineEnd="..." />
propsCheck RegExp for outdated
<Checkbox bleed="..." />
propsCheck RegExp for outdated
<Checkbox bleedBlockStart="..." />
propsCheck RegExp for outdated
<Checkbox bleedBlockEnd="..." />
propsCheck RegExp for outdated
<Checkbox bleedInlineStart="..." />
propsCheck RegExp for outdated
<Checkbox bleedInlineEnd="..." />
propsCheck RegExp for outdated
<Stack gap="..." />
propsCheck RegExp for outdated
<Grid gap="..." />
propsCheck RegExp for outdated
<Grid gapX="..." />
propsCheck RegExp for outdated
<Grid gapY="..." />
propsCheck RegExp for outdated
<Card padding="..." />
propsCheck RegExp for outdated
<Bleed marginInline="..." />
propsCheck RegExp for outdated
<Bleed marginBlock="..." />
propsCheck RegExp for outdated
<Bleed marginBlockStart="..." />
propsCheck RegExp for outdated
<Bleed marginBlockEnd="..." />
propsCheck RegExp for outdated
<Bleed marginInlineStart="..." />
propsCheck RegExp for outdated
<Bleed marginInlineEnd="..." />
propsReplacement maps
--p-space-05
--p-space-050
--p-space-1
--p-space-100
--p-space-1_5-experimental
--p-space-150
--p-space-2
--p-space-200
--p-space-3
--p-space-300
--p-space-4
--p-space-400
--p-space-5
--p-space-500
--p-space-6
--p-space-600
--p-space-8
--p-space-800
--p-space-10
--p-space-1000
--p-space-12
--p-space-1200
--p-space-16
--p-space-1600
--p-space-20
--p-space-2000
--p-space-24
--p-space-2400
--p-space-28
--p-space-2800
--p-space-32
--p-space-3200
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
🎩 checklist
README.md
with documentation changes