Replace custom divide function with sass built-in math.div. #3641
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 sassmath.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 withnode-sass
to thesass
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 thertl-css
files. Both returned perfect results, and no errors were displayed during building.Changelog updated?
No.