Skip to content
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

Polaris v9 #4910

Closed
45 of 46 tasks
alex-page opened this issue Jan 20, 2022 · 7 comments · Fixed by #4821
Closed
45 of 46 tasks

Polaris v9 #4910

alex-page opened this issue Jan 20, 2022 · 7 comments · Fixed by #4821
Assignees

Comments

@alex-page
Copy link
Member

alex-page commented Jan 20, 2022

Overview

  • Done criteria for v9 is removing sass functions and replacing with tokens. These are breaking changes that set us up for our goal of 100% token coverage.
  • Some sass functions have long tentacles and removal is tied with other work. Document those that won't be removed in v9 and instead get pushed out to v9.x or v10.
  • Removal of some sass mixins that are breaking changes and small enough in scope to be an easy win.

Timeline

Prepare for RC

Blockers

Task Breakdown

Communication strategy

Documentation page on polaris.shopify.com

Migration guide

Cleanup

/web

Deprecate public api

SCSS functions

Replace SCSS functions related to tokens with css custom properties. If a scss function can be replaced with a css custom property it should. Document any scss functions that cannot be removed right now in Follow Up Tasks below.

foundation/_accessibility.scss

foundation/_borders.scss

foundation/_colors.scss

foundation/_typography.scss

foundation/_utilities.scss

shared/_icons.scss

shared/_interaction-state.scss

shared/_layout.scss

shared/_links.scss

shared/_lists.scss

shared/_printing.scss

shared/_private-breakpoints.scss

shared/_skeleton.scss

shared/_printing.scss

@alex-page alex-page added the Bug Something is broken and not working as intended in the system. label Jan 20, 2022
@aveline aveline removed the Bug Something is broken and not working as intended in the system. label Jan 20, 2022
@BPScott
Copy link
Member

BPScott commented Jan 20, 2022

@function em - keep until layout project

The web folks have a ticket to investigate using dart-sass as node-sass has been deprecated for a while. Using dart-sass with polaris-react's public API spits out lots of deprecation warnings. I pushed for the removal of the rem/em/px functions as the vast majority of those deprecation warnings are due to the usage of those functions. I've been telling folks "lets wait till polaris v9 as that'll remove most of the deprecation warnings and thus make the investigation easier".

Would it be possible to reconsider this stance, and either get em() removed in v9, or adjust it so it doesn't spit out a warning every time it is used (which is lots of times because it is used in the breakpoint() function which is used by the various breakpoint mixins which are used extensively in web)?

@lgriffee lgriffee changed the title Release Polaris v9 Polaris v9 Jan 20, 2022
@aveline
Copy link
Contributor

aveline commented Jan 20, 2022

@BPScott removing em() isn't so straightforward and would really increase the scope of v9. But yes we can look at adjusting it so it doesn't spit out a warning every time it's used. Is it a matter of refactoring the existing em() function to use math.div()?

@BPScott
Copy link
Member

BPScott commented Jan 20, 2022

Is it a matter of refactoring the existing em() function to use math.div()?

Per #4725 math.div is a problem because it is present in dart-sass but not in node-sass.

@aveline
Copy link
Contributor

aveline commented Jan 20, 2022

@BPScott what approach would you suggest for quieting the em() down until we are able to remove it?

@BPScott
Copy link
Member

BPScott commented Jan 20, 2022

It's not really fixable in place unfortunately. We'd need to reduce usage of em(). Fortunately it seems that em() is only used for values you pass into breakpoint(). So if we refactor breakpoint() to avoid relying on em()'s general-purpose behaviour then we get closer

I had an idea for how that could be done in #4861 (comment)

Perhaps we could do something like claiming that breakpoint() now only accepts values/ adjustments in pixels (make it throw errors on other units) and that it shall internally convert that value into an em value by multiplying 0.0625 - the same as dividing it by 16, except you don't need to use the division sign that would trigger the deprecation warning (as 1em always equals 16px when used within a media query at the default zoom level).

@BPScott
Copy link
Member

BPScott commented Jan 24, 2022

#4937 removes the em function

@BPScott
Copy link
Member

BPScott commented Jan 27, 2022

As we'll be removing lots of the content within styles/_common.scss, it is likely that many component scss files no longer reference the mixins/functions that remain within that file. Once the trimming of the API is done, it might be worthwhile to go audit cases where component files do @import '../../styles/common';, and if no mixins/functions from that file are used then the import can be removed.

@alex-page alex-page mentioned this issue Jan 28, 2022
6 tasks
@aaronccasanova aaronccasanova self-assigned this Feb 10, 2022
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 a pull request may close this issue.

5 participants