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

Removed auto-prefixing for widely available features #3296

Merged
merged 10 commits into from
Jan 13, 2025
Merged

Conversation

Andarist
Copy link
Member

closes #2747

IMHO, this plugin is not really needed in 2025, but I haven't rechecked whether all the included rules are obsolete. Many are, we definitely shouldn't be prefixing flexbox

@Andarist Andarist requested a review from emmatown December 15, 2024 11:26
Copy link

changeset-bot bot commented Dec 15, 2024

🦋 Changeset detected

Latest commit: e8dbb53

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@emotion/styled Major
@emotion/cache Major
@emotion/react Major
@emotion/css Major
@emotion/primitives-core Major
@emotion/server Major
@emotion/native Major
@emotion/primitives Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

codesandbox-ci bot commented Dec 15, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Member

@emmatown emmatown left a comment

Choose a reason for hiding this comment

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

I basically agree with this (and probably agree with shipping it in the next major in a way that I don't really with #3294) with the caveat that to understand whether all of it is actually obselete, it'd be good to see something like: run the stylis prefixer over some specifically generated css to exercise all the properties that stylis prefixes, compare that with caniuse/mdn compat data/whatever and see what we get

@Andarist
Copy link
Member Author

Quick look on caniuse:

declaration browser support notes
color-adjust 19% deprecated
animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function) 97%
text-decoration 83% 97% with prefixes
filter 98%
clip-path 95%
backface-visibility 97%
column 97%
box-decoration-break 69% 98% with prefixes
mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite, 92.5% 98% with prefixes
background-clip 97%
columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width) 97%
appearance 96%
user-select 79% 97% with prefixes
transform, 98%
hyphens 94%
text-size-adjust 77% 92% with prefixes
transition 97%
cursor 80% no change with prefixes
background, background-image 97%
(margin|padding)-inline-(start|end) 97%
(min|max)?(width|height) 97%
(min|max)(inline-size|block-size) 96%
stretch, max-content, min-content, fill-available 97%
(m)ax-content, (m)in-content 97%
(f)ill-available, (f)it-content 97%
(s)tretch 98%
position: sticky 97%
writing-mode 98%
vertical-l(r) 97%
vertical-r(l) 97%
horizontal(-)tb 97%
:read-(only|write) 98%
:placeholder 97.7%

@Andarist
Copy link
Member Author

Andarist commented Jan 4, 2025

🏓 @emmatown

@emmatown
Copy link
Member

emmatown commented Jan 4, 2025

Sorry, I looked more into this before the holidays and got side-tracked, basically my thoughts are since the number of properties where prefixes are still relevant seems to be not nothing, I think we should probably have a smaller prefixer that includes what is currently prefixed but excluding everything that is Baseline "Widely Available" (I don't think the estimated browser support percentages to decide things is very useful). Over time, it would shrink, though the exact details of how we'd want to do that wrt to major versions, I'm not super sure about.

@Andarist
Copy link
Member Author

@emmatown I changed the PR and kept the prefixer. I cross-checked with caniuse, the resource u mentioned here and MDN. The end result is that we end up prefixing just a few things. Could you take a look at this and let me know what do you think?

Copy link
Member

@emmatown emmatown left a comment

Choose a reason for hiding this comment

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

These are mostly just my notes from going through the properties still here with some small actions, still thinking about it overall

WEBKIT +
replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') +
value
)
// cursor
case 6187:
Copy link
Member

Choose a reason for hiding this comment

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

I think the zoom and grab prefixing is unnecessary and image-set will be widely available later this year, also the image-set prefixing seems weird since it's not exclusive to the cursor property.

case 5844:
case 3191:
case 6645:
// box-decoration-break
case 3005:
// mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
Copy link
Member

Choose a reason for hiding this comment

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

widely available early 2026 by my math https://caniuse.com/css-masks

case 5844:
case 3191:
case 6645:
// box-decoration-break
Copy link
Member

Choose a reason for hiding this comment

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

Comment on lines 10 to 12
// color-adjust
case 5103:
return WEBKIT + 'print-' + value + value
Copy link
Member

Choose a reason for hiding this comment

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

Seems like an awkward one, color-adjust is obsolete, print-color-adjust is the real one though it's still prefixed in chromium

return WEBKIT + value + value
// appearance, user-select, transform, hyphens, text-size-adjust
case 5349:
// user-select, hyphens, text-size-adjust
Copy link
Member

@emmatown emmatown Jan 13, 2025

Choose a reason for hiding this comment

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

For all of these, we don't need the MS prefix since that's all IE/pre-Chromium Edge which are old enough to not matter for "Widely Available".

So none of these need moz/or ms prefixes

…ble so soon, just prefixing image-set for cursor is weird and cursor is such a small progressive enhancement thing anyway that if it doesn't work in older browsers, it's fine)
Copy link
Member

@emmatown emmatown left a comment

Choose a reason for hiding this comment

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

I think I'm happy with this (assuming updates to the changeset). While it's a bit small, it feels like it's just enough properties that it's worth keeping

@Andarist Andarist changed the title Drop prefixer Removed auto-prefixing for widely available features Jan 13, 2025
@Andarist Andarist merged commit 49108c8 into next Jan 13, 2025
8 checks passed
@Andarist Andarist deleted the drop-prefixer branch January 13, 2025 07:16
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.

2 participants