fix(postcss-preset-env): client side polyfills #3051

Merged
konrad merged 1 commits from dpschen/frontend:fix-postcss-preset-env-client-side-polyfills into main 2023-02-15 15:40:02 +00:00
Member
No description provided.
dpschen added the
kind/bug
area/internal-code
labels 2023-02-02 17:01:04 +00:00
konrad was assigned by dpschen 2023-02-02 17:01:04 +00:00
dpschen reviewed 2023-02-02 17:05:54 +00:00
vite.config.ts Outdated
@ -69,0 +71,4 @@
// get a better browser support:
// https://github.com/csstools/postcss-plugins/tree/main/plugin-packs/postcss-preset-env#plugins-that-need-client-library
// see also './src/polyfills.ts'
enableClientSidePolyfills: true,
Author
Member

Now that I enabled the former default again, I'm unsure if I would need to disable the other plugins again as well.

Now that I enabled the former default again, I'm unsure if I would need to disable [the other plugins](https://kolaente.dev/vikunja/frontend/src/commit/489014944a1544846875910d7d5e17e3d71b7e2d/vite.config.ts#L69-L77) again as well.
Author
Member

Maybe it's also enough to do the opposite: force enable the focus-visible-pseudo-class plugin like this:

features: {
    'focus-within-pseudo-class': true,
},

AFAIK 'focus-visible-pseudo-class' is the only feature of those plugins that require a client side polyfill that we use.

When I read the documentation of that plugin I get a bit confused though if we even need that src/polyfills.ts file or if enabling that plugin should be enought for the client side polyfill to be included. See that sentence:

PostCSS Focus Within works in all major browsers, including Safari 6+ and Internet Explorer 9+ without any additional polyfills.

Source: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-focus-within#browser

Really confusing that documentation!

Maybe it's also enough to do the opposite: force enable the focus-visible-pseudo-class plugin like this: ```js features: { 'focus-within-pseudo-class': true, }, ``` AFAIK 'focus-visible-pseudo-class' is the only feature of those plugins that require a client side polyfill that we use. When I read [the documentation of that plugin](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-focus-within) I get a bit confused though if we even need that `src/polyfills.ts` file or if enabling that plugin should be enought for the client side polyfill to be included. See that sentence: > PostCSS Focus Within works in all major browsers, including Safari 6+ and Internet Explorer 9+ without any additional polyfills. _Source: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-focus-within#browser_ Really confusing that documentation!

If it's possible to enable the polyfill only for that specific feature I think that's a good idea. Or is the rest tree-shaked?

See that sentence:

That sounds like it does not need a polyfill at all? (When targeting newer browsers than these)

If it's possible to enable the polyfill only for that specific feature I think that's a good idea. Or is the rest tree-shaked? > See that sentence: That sounds like it does not need a polyfill at all? (When targeting newer browsers than these)
Author
Member

Or is the rest tree-shaked?

I'm unsure.

It's also very time-consuming to test this since I would need to pick a browser version in browserslist that doesn't support those features natively.

Should I try the variant where I only enable features?

> Or is the rest tree-shaked? I'm unsure. It's also very time-consuming to test this since I would need to pick a browser version in browserslist that doesn't support those features natively. Should I try the variant where I only enable features?

Should I try the variant where I only enable features?

If that's easier, please do.

> Should I try the variant where I only enable features? If that's easier, please do.
Author
Member

Done. Please re-review

Done. Please re-review
dpschen marked this conversation as resolved
Member

Hi dpschen!

Thank you for creating a PR!

I've deployed the changes of this PR on a preview environment under this URL: https://3051-fix-postcss-preset-env-client-si--vikunja-frontend-preview.netlify.app

You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/.

Have a nice day!

Beep boop, I'm a bot.

Hi dpschen! Thank you for creating a PR! I've deployed the changes of this PR on a preview environment under this URL: https://3051-fix-postcss-preset-env-client-si--vikunja-frontend-preview.netlify.app You can use this url to view the changes live and test them out. You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/. Have a nice day! > Beep boop, I'm a bot.
dpschen force-pushed fix-postcss-preset-env-client-side-polyfills from 7364b790ca to 29e306841c 2023-02-15 15:28:31 +00:00 Compare
dpschen requested review from konrad 2023-02-15 15:29:16 +00:00
konrad merged commit d07ad495e2 into main 2023-02-15 15:40:02 +00:00
konrad deleted branch fix-postcss-preset-env-client-side-polyfills 2023-02-15 15:40:02 +00:00
This repo is archived. You cannot comment on pull requests.
No description provided.