Skip to content

Conversation

@AndrewMusgrave
Copy link
Member

@AndrewMusgrave AndrewMusgrave commented Oct 13, 2022

WHY are these changes introduced?

Scrolling and interacting with pages using index table may be slugging on (newish versions?) of safari.

Screenies

Before After
Timeline Screen Shot 2022-10-13 at 11 51 05 AM Screen Shot 2022-10-13 at 11 57 29 AM
Layers Screen Shot 2022-10-13 at 10 42 45 AM Screen Shot 2022-10-13 at 10 49 27 AM
Layer count Screen Shot 2022-10-13 at 10 43 46 AM Screen Shot 2022-10-13 at 10 48 54 AM

WHAT is this pull request doing?

I'm removing the filter property that's causing a new layer to be create for each row. Painting each layer is taking a considerable amount of time. But why not use the GPU? Sure, we could. But taking advantage of the GPU would cause a significant bump in memory usage. I tested out will-change: filter and noticed a resting memory usage of ~1gb occasionally going higher (or lower).

Screen Shot 2022-10-13 at 10 44 26 AM

Why are we running into the issue?

box-shadow seems to have performance issue with scrolling. I haven't located a recent thread but found many older posts on slack overflow of similar issues and webkit bug reports.

But aren't we using drop-shadow not box shadow? Yes! However, upon looking at the spec it seems the values are interpreted as box-shadow with an additional length property.

Notes

There's still a few drop-shadows in the index table component. Since we're using collapsing borders for the table they're needed.

How to 🎩

Use the snapshot in web!

🎩 checklist

@github-actions
Copy link
Contributor

github-actions bot commented Oct 13, 2022

size-limit report 📦

Path Size
polaris-react-cjs 209.11 KB (0%)
polaris-react-esm 135.59 KB (0%)
polaris-react-esnext 190.95 KB (-0.01% 🔽)
polaris-react-css 41.51 KB (-0.02% 🔽)

@AndrewMusgrave
Copy link
Member Author

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @AndrewMusgrave! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/[email protected]
yarn add @shopify/[email protected]

@AndrewMusgrave
Copy link
Member Author

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @AndrewMusgrave! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/[email protected]
yarn add @shopify/[email protected]

@AndrewMusgrave
Copy link
Member Author

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @AndrewMusgrave! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/[email protected]
yarn add @shopify/[email protected]
yarn add @shopify/[email protected]

@AndrewMusgrave AndrewMusgrave marked this pull request as ready for review October 13, 2022 17:20
Copy link
Contributor

@aveline aveline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for digging into this and finding a fix 🌟

Copy link
Member

@aaronccasanova aaronccasanova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome visuals!

Copy link

@sethomas sethomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎩ed and seems to work well!

@AndrewMusgrave AndrewMusgrave merged commit 89fea23 into main Oct 17, 2022
@AndrewMusgrave AndrewMusgrave deleted the am-fix-safari-scrolling-issue branch October 17, 2022 14:23
@github-actions github-actions bot mentioned this pull request Oct 17, 2022
laurkim pushed a commit that referenced this pull request Oct 18, 2022
### WHY are these changes introduced?

Scrolling and interacting with pages using index table may be slugging
on (newish versions?) of safari.

### Screenies

||Before|After|
|-|-|-|
|Timeline|<img width="356" alt="Screen Shot 2022-10-13 at 11 51 05 AM"
src="https://user-images.githubusercontent.com/24610840/195645166-7835c563-f756-46eb-a16e-6784b998defb.png">|<img
width="427" alt="Screen Shot 2022-10-13 at 11 57 29 AM"
src="https://user-images.githubusercontent.com/24610840/195646407-cff19381-90ea-4ac8-a5d8-499e861ea247.png">|
|Layers|<img width="693" alt="Screen Shot 2022-10-13 at 10 42 45 AM"
src="https://user-images.githubusercontent.com/24610840/195645603-0fa69e9f-f2d2-465b-8bfc-165b926f636c.png">|<img
width="322" alt="Screen Shot 2022-10-13 at 10 49 27 AM"
src="https://user-images.githubusercontent.com/24610840/195645994-4c81a595-5db1-4ed7-acc6-87a1ff967b38.png">|
|Layer count|<img width="149" alt="Screen Shot 2022-10-13 at 10 43 46
AM"
src="https://user-images.githubusercontent.com/24610840/195645673-85f481b3-31c7-4c0b-92db-612c35d99cbe.png">|<img
width="324" alt="Screen Shot 2022-10-13 at 10 48 54 AM"
src="https://user-images.githubusercontent.com/24610840/195645856-8494841f-f4fb-4b36-a094-67cb41ef04bf.png">|


### WHAT is this pull request doing?

I'm removing the `filter` property that's causing a new layer to be
create for each row. Painting each layer is taking a considerable amount
of time. But why not use the GPU? Sure, we could. But taking advantage
of the GPU would cause a significant bump in memory usage. I tested out
`will-change: filter` and noticed a resting memory usage of ~1gb
occasionally going higher (or lower).

<img width="336" alt="Screen Shot 2022-10-13 at 10 44 26 AM"
src="https://user-images.githubusercontent.com/24610840/195647680-cf3b9594-86be-4ea0-9cae-fc58e8199abf.png">

#### Why are we running into the issue?

`box-shadow` seems to have performance issue with scrolling. I haven't
located a recent thread but found many older posts on slack overflow of
similar issues and [webkit bug
reports](https://bugs.webkit.org/show_bug.cgi?id=22102).

But aren't we using drop-shadow not box shadow? Yes! However, upon
looking at the
[spec](https://drafts.fxtf.org/filter-effects/#funcdef-filter-drop-shadow)
it seems the values are interpreted as box-shadow with an additional
length property.

### Notes

There's still a few drop-shadows in the index table component. Since
we're using collapsing borders for the table they're needed.

### How to 🎩

Use the snapshot in web!

### 🎩 checklist

- [ ] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [ ] 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
laurkim pushed a commit that referenced this pull request Oct 26, 2022
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/[email protected]

### Minor Changes

- [#7342](#7342)
[`dc2990acf`](dc2990a)
Thanks [@lgriffee](https://github.com/lgriffee)! - Rename
`replace-sass-length` migration to `replace-spacing-lengths`
    Add `gap` properties to `replace-sass-space` migration


- [#7310](#7310)
[`8fb215836`](8fb2158)
Thanks [@gwyneplaine](https://github.com/gwyneplaine)! - Add sass
z-index migration


- [#7335](#7335)
[`699b70713`](699b707)
Thanks [@aaronccasanova](https://github.com/aaronccasanova)! - Add
migration to `replace-typography-declarations`


- [#7375](#7375)
[`8194e174a`](8194e17)
Thanks [@samrose3](https://github.com/samrose3)! - Add Sass color
function migration


- [#7387](#7387)
[`a0fa96ed4`](a0fa96e)
Thanks [@lgriffee](https://github.com/lgriffee)! - Added
`replace-border-declarations` migration

### Patch Changes

- [#7487](#7487)
[`60191f353`](60191f3)
Thanks [@lgriffee](https://github.com/lgriffee)! - Update numeric
operator detection to check all node types


- [#7412](#7412)
[`6d82e8965`](6d82e89)
Thanks [@samrose3](https://github.com/samrose3)! - Enhance Sass spacing
migration to catch Sass interpolations


- [#7423](#7423)
[`0591db26a`](0591db2)
Thanks [@aaronccasanova](https://github.com/aaronccasanova)! - Update
`replace-typography-declarations` comment strategy


- [#7459](#7459)
[`933a9d71b`](933a9d7)
Thanks [@lgriffee](https://github.com/lgriffee)! - Add missing values to
borderRadius length map

## @shopify/[email protected]

### Minor Changes

- [#7429](#7429)
[`e87330f5b`](e87330f)
Thanks [@aveline](https://github.com/aveline)! - Update `AlphaStack` to
be polymorphic, add list reset styles and allow spacing to change based
on breakpoint


- [#7450](#7450)
[`74237ebc5`](74237eb)
Thanks [@laurkim](https://github.com/laurkim)! - Added support for
`minHeight` and `minWidth` on `Box`


- [#7432](#7432)
[`85c022033`](85c0220)
Thanks [@laurkim](https://github.com/laurkim)! - Added support for
`overflowX`, `overflowY`, and `width` props to `Box`


- [#7491](#7491)
[`a9eff60e1`](a9eff60)
Thanks [@laurkim](https://github.com/laurkim)! - Added support for
`section` element types to `Box`


- [#7389](#7389)
[`4f184c658`](4f184c6)
Thanks [@aveline](https://github.com/aveline)! - Added `breakWord` prop
to `Text`


- [#7430](#7430)
[`87981ac01`](87981ac)
Thanks [@aveline](https://github.com/aveline)! - Added `legend` as
supported element for `Text` component


- [#7438](#7438)
[`4b4411930`](4b44119)
Thanks [@aveline](https://github.com/aveline)! - Simplify `AlphaCard` by
removing `hasBorderRadius` prop and `shadow` prop

### Patch Changes

- [#7405](#7405)
[`ea2615881`](ea26158)
Thanks [@laurkim](https://github.com/laurkim)! - Fixed how optional `id`
prop rendered in `Text`


- [#7434](#7434)
[`62288755a`](6228875)
Thanks [@laurkim](https://github.com/laurkim)! - Fixed reference to
`width` custom property in `Box`


- [#7396](#7396)
[`3be27bae8`](3be27ba)
Thanks [@laurkim](https://github.com/laurkim)! - Updated alias and scale
types in `Box` with type tests to check they exist in our token groups.
    Updated `get-props` script to parse utility types with unions.


- [#7435](#7435)
[`4097d539b`](4097d53)
Thanks [@kyledurand](https://github.com/kyledurand)! - Cleaned up styles
on Box


- [#7410](#7410)
[`13546e344`](13546e3)
Thanks [@kyledurand](https://github.com/kyledurand)! - Apply default
value to Columns


- [#7483](#7483)
[`7a78e07bf`](7a78e07)
Thanks [@laurkim](https://github.com/laurkim)! - Fixed missing
`children` prop in `Columns` prop type


- [#7492](#7492)
[`612e02786`](612e027)
Thanks [@henryyi](https://github.com/henryyi)! - Only apply scroll-lock
with scrollbar when body is scrollable


- [#7481](#7481)
[`4f5f6cf50`](4f5f6cf)
Thanks [@kyledurand](https://github.com/kyledurand)! - Fixed horizontal
scroll bug in Scrollable


- [#7471](#7471)
[`2f16b2310`](2f16b23)
Thanks [@kyledurand](https://github.com/kyledurand)! - Added viewport
addon to storybook and matched values to our breakpoints


- [#7433](#7433)
[`90487fd70`](90487fd)
Thanks [@kellymiller-shop](https://github.com/kellymiller-shop)! - fixed
heading offset on IndexTable


- [#7453](#7453)
[`3191d13c0`](3191d13)
Thanks [@AndrewMusgrave](https://github.com/AndrewMusgrave)! - Fixed
IndexTable not rendering bulk actions on resize


- [#7395](#7395)
[`89fea23f7`](89fea23)
Thanks [@AndrewMusgrave](https://github.com/AndrewMusgrave)! - Fixed
scrolling performance for IndexTable on safari


- [#7442](#7442)
[`77057d5b6`](77057d5)
Thanks [@kyledurand](https://github.com/kyledurand)! - Fix SkeletonPage
actions layout

## @shopify/[email protected]

### Patch Changes

- Updated dependencies
\[[`dc2990acf`](dc2990a),
[`8fb215836`](8fb2158),
[`60191f353`](60191f3),
[`6d82e8965`](6d82e89),
[`0591db26a`](0591db2),
[`699b70713`](699b707),
[`8194e174a`](8194e17),
[`933a9d71b`](933a9d7),
[`a0fa96ed4`](a0fa96e)]:
    -   @shopify/[email protected]

## [email protected]

### Minor Changes

- [#7396](#7396)
[`3be27bae8`](3be27ba)
Thanks [@laurkim](https://github.com/laurkim)! - Updated alias and scale
types in `Box` with type tests to check they exist in our token groups.
    Updated `get-props` script to parse utility types with unions.


- [#7393](#7393)
[`cd4577a3f`](cd4577a)
Thanks [@martenbjork](https://github.com/martenbjork)! - Update markdown
file structure to not require folders for each markdown page. Now you
can simply create a markdown.md file and it will be rendered as a page.


- [#7418](#7418)
[`c5cfe9026`](c5cfe90)
Thanks [@kyledurand](https://github.com/kyledurand)! - Support beta
status components


- [#7449](#7449)
[`31437dfb2`](31437df)
Thanks [@jjgali](https://github.com/jjgali)! - Removed duplicate image
on error messages page.


- [#7491](#7491)
[`a9eff60e1`](a9eff60)
Thanks [@laurkim](https://github.com/laurkim)! - Added support for
`section` element types to `Box`


- [#7441](#7441)
[`0d446cb46`](0d446cb)
Thanks [@jjgali](https://github.com/jjgali)! - Remove section on
compositions vs patterns.


- [#7420](#7420)
[`d462e2e5d`](d462e2e)
Thanks [@jjgali](https://github.com/jjgali)! - Clarify rules for
formatting dates and times.

### Patch Changes

- [#7398](#7398)
[`c21ea83d4`](c21ea83)
Thanks [@tracytees](https://github.com/tracytees)! - - Updated the
"Getting started" and "Polaris 101" pages
- Removed /design, /develop, /shared-resources,
/patterns-components-and-tokens


- [#7426](#7426)
[`442d51ddf`](442d51d)
Thanks [@gwyneplaine](https://github.com/gwyneplaine)! - Fix nav bug


- [#7452](#7452)
[`8a05e840f`](8a05e84)
Thanks [@gui-santos](https://github.com/gui-santos)! - fix visual bug in
token page's navigation where text was breaking into two lines


- [#7469](#7469)
[`a8d80cfd5`](a8d80cf)
Thanks [@chazdean](https://github.com/chazdean)! - Updated `AlphaStack`
component docs


- [#7483](#7483)
[`7a78e07bf`](7a78e07)
Thanks [@laurkim](https://github.com/laurkim)! - Fixed missing
`children` prop in `Columns` prop type


- [#7436](#7436)
[`95a8ac0d2`](95a8ac0)
Thanks [@laurkim](https://github.com/laurkim)! - Fix references to `Box`
margin props in alpha layout examples


- [#7444](#7444)
[`e0d6b00ba`](e0d6b00)
Thanks [@kyledurand](https://github.com/kyledurand)! - Fix tile image
and increase example widths on alpha components


- [#7427](#7427)
[`25e70a8d9`](25e70a8)
Thanks [@gwyneplaine](https://github.com/gwyneplaine)! - Declare sandbox
nav in a more idiomatic fashion


- [#7482](#7482)
[`0ec6961aa`](0ec6961)
Thanks [@alex-page](https://github.com/alex-page)! - Bump GitHub action
versions and add p-map for gen-og-images CI failure

- Updated dependencies
\[[`ea2615881`](ea26158),
[`62288755a`](6228875),
[`3be27bae8`](3be27ba),
[`4097d539b`](4097d53),
[`e87330f5b`](e87330f),
[`74237ebc5`](74237eb),
[`85c022033`](85c0220),
[`13546e344`](13546e3),
[`7a78e07bf`](7a78e07),
[`a9eff60e1`](a9eff60),
[`4f184c658`](4f184c6),
[`612e02786`](612e027),
[`4f5f6cf50`](4f5f6cf),
[`87981ac01`](87981ac),
[`2f16b2310`](2f16b23),
[`90487fd70`](90487fd),
[`3191d13c0`](3191d13),
[`89fea23f7`](89fea23),
[`77057d5b6`](77057d5),
[`4b4411930`](4b44119)]:
    -   @shopify/[email protected]

## [email protected]

### Patch Changes

- Updated dependencies
\[[`ea2615881`](ea26158),
[`62288755a`](6228875),
[`3be27bae8`](3be27ba),
[`4097d539b`](4097d53),
[`e87330f5b`](e87330f),
[`74237ebc5`](74237eb),
[`85c022033`](85c0220),
[`13546e344`](13546e3),
[`7a78e07bf`](7a78e07),
[`a9eff60e1`](a9eff60),
[`4f184c658`](4f184c6),
[`612e02786`](612e027),
[`4f5f6cf50`](4f5f6cf),
[`87981ac01`](87981ac),
[`2f16b2310`](2f16b23),
[`90487fd70`](90487fd),
[`3191d13c0`](3191d13),
[`89fea23f7`](89fea23),
[`77057d5b6`](77057d5),
[`4b4411930`](4b44119)]:
    -   @shopify/[email protected]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants