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.6
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
package.json Outdated Show resolved Hide resolved
@guillaumerochelle guillaumerochelle force-pushed the bugfix/slow-extract-styling branch from 4c245d7 to 4a92e89 Compare December 13, 2024 15:30
@guillaumerochelle
Copy link
Contributor Author

Waiting for issue resolution sass/embedded-host-node#358

@guillaumerochelle guillaumerochelle force-pushed the bugfix/slow-extract-styling branch 6 times, most recently from ca91370 to 8861ed2 Compare January 31, 2025 17:17
@guillaumerochelle guillaumerochelle changed the base branch from release/11.3 to release/11.6 January 31, 2025 17:18
Copy link

nx-cloud bot commented Jan 31, 2025

View your CI Pipeline Execution ↗ for commit c24ca1e.

Command Status Duration Result
nx run-many --target=test-e2e ❌ Failed 1m 54s View ↗
nx run-many --target=test-int ✅ Succeeded 57m 55s View ↗
nx run-many --target=build --projects=eslint-pl... ✅ Succeeded 32s View ↗
nx run-many --target=publish --nx-bail --userco... ✅ Succeeded 37s View ↗
nx run-many --target=build ✅ Succeeded 16m 33s View ↗
nx affected --target=lint --base=remotes/origin... ✅ Succeeded 15m 13s View ↗
nx affected --target=test --cacheDirectory=D:\a... ✅ Succeeded 9m View ↗
nx affected --target=test --cacheDirectory=/hom... ✅ Succeeded 7m 22s View ↗
Additional runs (3) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2025-01-31 19:17:20 UTC

Copy link

codecov bot commented Jan 31, 2025

Codecov Report

Attention: Patch coverage is 27.77778% with 52 lines in your changes missing coverage. Please review.

Project coverage is 65.94%. Comparing base (2dfc7b8) to head (c24ca1e).

Files with missing lines Patch % Lines
.../style-extractor/helpers/css-variable.extractor.ts 26.31% 39 Missing and 3 partials ⚠️
...ges/@o3r/styling/builders/style-extractor/index.ts 23.07% 10 Missing ⚠️
Additional details and impacted files

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@guillaumerochelle guillaumerochelle force-pushed the bugfix/slow-extract-styling branch from 8861ed2 to c24ca1e Compare January 31, 2025 17:45
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