Skip to content

build-sass: Use new Shared Resources API#9954

Merged
aduth merged 4 commits intomainfrom
aduth-build-sass-shared-resources
Jan 23, 2024
Merged

build-sass: Use new Shared Resources API#9954
aduth merged 4 commits intomainfrom
aduth-build-sass-shared-resources

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Jan 22, 2024

🛠 Summary of changes

Enhances the @18f/identity-build-sass Sass compilation tool to use the new Shared Resources API added to Sass in a recent version. This feature is well-suited for our use-case, where we compile many different stylesheets, and each stylesheet shares a number of common resources (USWDS, etc.).

Performance:

Average of yarn build:css on a set of 10 runs:

Before: 8.75s
After: 6.71s 2.98s after 3fe4d75
Diff: -2.04s (-23.3%) -5.77s (-65.9%) after 3fe4d75

📜 Testing Plan

Verify that yarn build:css successfully outputs to app/assets/build

changelog: Internal, Build Tools, Improve performance of stylesheet build tool
@aduth
Copy link
Contributor Author

aduth commented Jan 22, 2024

I can't recall if I had specifically dug into the performance characteristics of the synchronous vs. asynchronous compilers, but a brief test with initAsyncCompiler shows that it performs quite well, about 3.5s on average. I might look into seeing if it's easy enough to swap to that.

@aduth
Copy link
Contributor Author

aduth commented Jan 22, 2024

Switched to async compiler in 3fe4d75 and updated performance result in original comment.

@aduth aduth merged commit 94f5003 into main Jan 23, 2024
@aduth aduth deleted the aduth-build-sass-shared-resources branch January 23, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants