Repository navigation
chore: Update Sass Library - #55304
Conversation
|
Link to Calypso live: https://container-nifty-dewdney.calypso.live/ |
|
This PR modifies the release build for editing-toolkit To test your changes on WordPress.com, run To deploy your changes after merging, see the documentation: PCYsg-mMA-p2 |
35e3fb7 to
c8abdee
Compare
4597f7c to
d8d71d1
Compare
d8d71d1 to
7961103
Compare
|
Currently getting a lot of |
|
When building this branch locally with
The |
|
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
Ahhh, I must have accidentally removed it when I rebased. |
Changes proposed in this Pull Request
sassto 1.37.5 andsass-loaderto 12.1.0.sass-migrator divisionacross the codebase@useinstead of@importThis PR is motivated by #54793. Specifically, the new wp monorepo update also updates the version of sass. The new version of sass includes a deprecation warning for the division operator (
/). More info on that here. This deprecation warning prints thousands of times during the build process and I even got a segfault running the build which miiiight be related. It also fills the TeamCity build log until it reaches the log limit, so we can't see any actual problems with the build, just the dep warning. As a result, we can't really merge that update without resolving this deprecation warning.Thankfully, sass has a migrator tool which lets us auto-fix this problem.
However, that raises a different problem, which is that all
@usedirectives must be the very first thing in the file. The new division operator is imported via@use:I discovered the culprit, which is our
prelude(additionalData) which is added to every sass file in the project. It basically means that animportstatement is inserted as first thing in every file instead of theusestatement. Thankfully, this can be migrated to the new format like so:The
as *defines the namespace for the import. Without it, you'd have to start referencing variables with the namespace prefixed. While that sounds like a good idea to implement in the long run, we have hundreds of references to these variables which assume they are defined globally. As such, we need to continue defining them globally with the*namespace.Finally, I also needed to set the
quietDepsflag in our sass options. This flag disables deprecation warnings when processing imported/3rd-party stylesheets. This is important, as we can't fix those deprecation warnings ourselves, and it adds so much noise to the build log that TeamCity can't display the entire logfile.Testing instructions