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

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

SoCuul
Copy link

@SoCuul SoCuul commented Apr 27, 2023

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.

@Slackwise
Copy link

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

@jgthms
Copy link
Owner

jgthms commented May 9, 2023

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.

@SoCuul
Copy link
Author

SoCuul commented May 9, 2023

Is there an estimated release date for Bulma v2?

@dword-design
Copy link

Also looking forward to this!

@lctech-bill
Copy link

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

@Xaaalera
Copy link

+1

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.

None yet

6 participants