farm icon indicating copy to clipboard operation
farm copied to clipboard

[Feature] Use `grass` as the replacement of `dart-sass` in rust plugin `sass`

Open llc1123 opened this issue 2 years ago • 3 comments

What problem does this feature solve?

There is a pure rust implementation of sass which could be a drop-in replacement of dart-sass. And it is much faster.

As we are introducing rust plugins in farm, I think it could be better and more elegant getting rid of dart-sass-embedded.

What does the proposed API look like?

Just keep it the same as the current sass plugin.

llc1123 avatar Apr 27 '23 11:04 llc1123

As I know, sass-embedded is more stable that grass, grass misses many features. And the performance is the same.

We will try grass later, contributions are also welcome, thanks!

wre232114 avatar Apr 27 '23 12:04 wre232114

As I know, sass-embedded is more stable that grass

Yes, sass-embedded is more stable.

grass misses many features

No, grass is currently having almost every feature of dart-sass. Only several edge cases are not covered, which already meets most use cases.

And the performance is the same.

I didn't do the benchmark, but according to the README of the project, grass is ~2x faster than dart-sass.

On another side, just like farm, frontend toolchain projects based on rust need more collaboration to make them widely adopted.

llc1123 avatar Apr 27 '23 12:04 llc1123

We tried grass last year, and it fails for many projects that we try to migrate, so we switch to dart-sass-embedded, and we also do the benchmark too, the result is close. We will try grass next month, hope that it becomes more reliable!

And yes, we are really glad to make everything in Rust!

wre232114 avatar Apr 27 '23 13:04 wre232114