Sass blog post: Embedded Dart Sass breaking changes coming

Not exactly sure I fully understand what they’re about to do, but am passing along this Sass blog post FYI:

Edit: I now see that the repo for Embedded Dart Sass has been archived, with this note in the README:

This is no longer the repository for Embedded Dart Sass. The embedded compiler has been merged into the primary Dart Sass repository, and further releases will be included as part of Dart Sass itself. The embedded compiler can be accessed by running sass --embedded .

Further edit: Of course, this means adding this to your PATH in either dev or production, as was the case with the previous packaging of Embedded Dart Sass. Based on my very preliminary tests on my home system, everything works fine in Hugo with this binary placed there.

Edit, 2023-05-23: I have now written a brief post summarizing all of this from, as I put it therein, a “very Hugo-centric” viewpoint:

Edit, 2023-05-24: I learned the hard way that the current Dart Sass binary (1.62.1) doesn’t yet support Embedded Dart Sass fully (e.g., it doesn’t “watch” files properly for when you make edits to your .scss files), so keep using the current/archived Embedded Dart Sass binary until there’s a newer Dart Sass release that does provide this support. (This is despite the fact that the Sass team has already changed the Dart Sass README to say that commands such as sass --embedded and sass --embedded --version will work; they don’t with the current Dart Sass binary — which makes sense, given that 1.62.1 was released weeks before the Sass team made this change.)

1 Like

For early testing, I built from source per:
https://github.com/sass/dart-sass#from-source

Then created a bash script named “dart-sass-embedded” in /usr/local/sbin:

#!/usr/bin/env bash
dart ~/code/dart-sass/bin/sass.dart --embedded "$@"

The performance is abysmal, but I’m sure that will improve.

N.B. For anyone stumbling across this post, don’t do this.

1 Like

Have anyone seen any timeline as to when this is going to happen? I was asked about the proposed changes to the protocol (which is fine for me, just some not so much work on my side).

Just FYI, I filed an issue with that repo on the fact that they’d updated the README about this before having a release that actually worked that way. Although I’m not sure the response I got will provide any answer to your question, perhaps it, and some of their more recent commits since then, do (sort of) suggest it won’t be long before they make the change:

1.63.0 is now released.

Edit: Already up to 1.63.2 a few hours later. :person_shrugging:

(And sass --embedded still doesn’t work the way they said it would, at least not with Hugo. Guess we’re stuck on the 1.62.1 version of Embedded Dart Sass for a while.)

No, they have changed the protocol in a breaking way, so it also requires me to find time to do the upgrade.

1 Like

Yes, have been following your and @jmooring’s comments in the related GitHub issue. Sorry!

(I did try a workaround by using just sass -w, but found that using it in parallel with Hugo gradually leaves multiple, very memory-hungry sass processes running — it doesn’t respond to the ^c if run that way — so that was a dead end.)