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

PERF: Extensive constant propagation #5299

Closed
4 tasks done
LifeIsStrange opened this issue Oct 14, 2021 · 1 comment
Closed
4 tasks done

PERF: Extensive constant propagation #5299

LifeIsStrange opened this issue Oct 14, 2021 · 1 comment

Comments

@LifeIsStrange
Copy link

LifeIsStrange commented Oct 14, 2021

Clear and concise description of the problem

Constant folding (propagation) is a popular optimization https://en.m.wikipedia.org/wiki/Constant_folding

Many things can be constant folded at compile time, an important one are CSS calc() expressions

Suggested solution

This is solved by https://github.com/postcss/postcss-calc
However most people are not even aware of the existence of this library.
As such it would be a nice optimization if vite leveraged internally this lib in order to perform css Calc constant folding for free to users.

Note that esbuild might support this one day
evanw/esbuild#1607

Alternative

What other things can be constant folded at compile time?

Also this is desired for production but is it also desired for dev?

Additional context

No response

Validations

@sodatea
Copy link
Member

sodatea commented Oct 15, 2021

Now that esbuild is going to support this feature, we should leave it to esbuild, for separation of concerns.

@sodatea sodatea closed this as completed Oct 15, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants