bulma icon indicating copy to clipboard operation
bulma copied to clipboard

Replace custom divide function with sass built-in math.div.

Open SoCuul opened this issue 1 year ago • 6 comments

This is an improvement.

Proposed solution

Currently, bulma uses a custom implemented divide function in multiple functions. The main downside of using this custom division function, is that it uses multiple loops that severely slow down build speeds on the final app.

This has been reported previously at #3604, and was been investigated in a separate thread.

This pull request replaces the custom divide function logic with the built-in sass math.div function. This change results in 20x quicker build times with nuxt + vite.

Tradeoffs

Because node-sass has not been updated, there is no support for the math.div function. To work around this issue, I've replaced all references with node-sass to the sass npm package. The functionality is nearly identical, and there should be no modification necessary to any workflows.

Testing Done

I have built both the main css files along with the rtl-css files. Both returned perfect results, and no errors were displayed during building.

Changelog updated?

No.

SoCuul avatar Apr 27 '23 08:04 SoCuul

Hi @jgthms, is bulma abandoned or is it possible to get this PR reviewed and merged in? Thanks.

Slackwise avatar May 08 '23 20:05 Slackwise

So the custom divide was introduced to add compatibility with dart sass, which has another way to make divisions but requires changing the whole codebase.

Bulma v1 which I’m still working on will still be compatible with node sass, but with v2 it will only be dart sass which means using the built in divide again.

jgthms avatar May 09 '23 09:05 jgthms

Is there an estimated release date for Bulma v2?

SoCuul avatar May 09 '23 10:05 SoCuul

Also looking forward to this!

dword-design avatar May 29 '23 01:05 dword-design

Could this PR will be merged? Nuxt3 with sass/scss is currently facing slow build times and I'm looking for a solution.

Slow nuxt startup when importing sass file

lctech-bill avatar Jul 24 '23 03:07 lctech-bill

+1

Xaaalera avatar Sep 13 '23 13:09 Xaaalera