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

fix: improve performance of styling extractor #2586

Draft
wants to merge 1 commit into
base: release/11.3
Choose a base branch
from

Conversation

guillaumerochelle
Copy link
Contributor

@guillaumerochelle guillaumerochelle commented Dec 12, 2024

Proposed change

Switch to sass-embedded package to use Dart Sass CLI, instead of sass package.
From my first tests, it seems the time it takes to extract styling variables is divided by 10.

Related issues

@@ -219,7 +233,7 @@ export class CssVariableExtractor {
}

let parsedValue: string | undefined;
if (varValue instanceof SassString || varValue instanceof SassNumber || varValue instanceof SassBoolean) {
if (varValue instanceof SassString || varValue instanceof SassNumber) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To double check as well, was causing an issue with SassBoolean being undefined.

@kpanot kpanot linked an issue Dec 12, 2024 that may be closed by this pull request
@guillaumerochelle guillaumerochelle force-pushed the bugfix/slow-extract-styling branch from 76dbe22 to 4c245d7 Compare December 13, 2024 15:20
@@ -255,8 +255,10 @@
"replace-in-files-cli": "^2.2.0",
"rimraf": "^5.0.1",
"sass": "~1.79.0",
"sass-embedded": "~1.79.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it need to be in this package.json or the style's one would be enough?

@guillaumerochelle guillaumerochelle force-pushed the bugfix/slow-extract-styling branch from 4c245d7 to 4a92e89 Compare December 13, 2024 15:30
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.

[Bug]: cms-adapters:style extractor takes too much time
2 participants