LibSass deprecated in October 2020
CarterPape opened this issue · comments
The Sass implementation on which this gem is based was deprecated October 2020. Again.
Although there is not yet any deprecation warning that prints to announce this deprecation, I figured it might be good to get ahead of the warning and put an issue in about this.
I've forked this repo and will dabble with potential solutions, but I am not a regular contributor and don't program for a living, so it might be ugly.
Looks like Dart Sass is the new Sass implementation, no clue how easy it would be to use it instead.
Figuring out why @use
wasn't working lead me here.
I was looking around for potential solutions and approches for upgrading sass.
Seems like the dependency we have currently is jekyll/jekyll-sass-converter -> sass/sassc-ruby -> sass/libsass.
The interoperability between sassc-ruby ( Ruby ) & libsass ( C ) is achieved by ffi/ffi. FFI supports native C types along with structs, enums etc. We need something similar for interoperability between Ruby & Dart. I tried searching for libraries that support this but was unsuccessful.
I was looking around for potential solutions and approches for upgrading sass.
Seems like the dependency we have currently is jekyll/jekyll-sass-converter -> sass/sassc-ruby -> sass/libsass.The interoperability between sassc-ruby ( Ruby ) & libsass ( C ) is achieved by ffi/ffi. FFI supports native C types along with structs, enums etc. We need something similar for interoperability between Ruby & Dart. I tried searching for libraries that support this but was unsuccessful.
Apparently Dart Sass is also distributed as a pure Javascript NPM package, which might be another option.
Apparently Dart Sass is also distributed as a pure Javascript NPM package, which might be another option.
This looks most promising to me. It is compiled from the Dart Sass implementation, which is the "reference implementation of Sass". I have an easier time wrapping my head around an NPM dependency than I do a standalone Dart executable.
There are sass/embedded-protocol and sass/dart-sass-embedded which can be used to create language bindings for sass/dart-sass by launching a separate compiler process and communicating via stdio. I created sass-embedded as a host implementation for Ruby.
Update: The support for sass-embedded has been release with jekyll-sass-converter 2.2.0. Instruction is available here: https://github.com/jekyll/jekyll-sass-converter#sass-embedded
Note: This won't work out of box on GitHub Pages as it still runs Jekyll 3.x, you will have to use a custom action to build your pages with Jekyll 4.x.
Is there any chance that above fix getting merged? This repo haven't had much activity in the last 12+ months.
It looks like both sass/embedded-protocol and sass/dart-sass-embedded are stable enough to start using. Is that a valid assumption? If so, I'm happy to coordinate getting a PR merged and a release done to address the libsass deprecation.
There are no stable realeases for them yet:
https://github.com/sass/embedded-protocol/releases
https://github.com/sass/dart-sass-embedded/releases
It might make sense to create a PR for it now, and do some early testing. But block the merge until a stable release is published and the PR was tested with it.
edit: just saw that's exactly what ntkme already said above.
@vikashd @emcoding @imustafin Thanks for trying things out. Now #124 has been merged into this repository, you should update your projects to use this project instead of my fork.
This has been merged for a while now, so is there a plan to make a new release anytime soon?
I received an error using the CSS vanilla-framework that Ubuntu uses; I assume it is because of libsass beind deprecated.
my _global_functions.scss is using @use 'sass:math';
and the deprecated LibSass doesn't make use of the use
statement according to a StackOverflow article from late 2021.
https://stackoverflow.com/questions/61326061/does-jekyll-support-use-sass-statement
Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/main.scss':
hydenjekyllorg-jekyll-serve-1 | Error: Invalid CSS after "... $value: math": expected expression (e.g. 1px, bold), was ".div($value, $numbe" on line 96:19 of _scss/libs/vanilla-framework/_global_functions.scss from line 7:1 of _scss/libs/vanilla-framework/_settings.scss from line 1:1 of _scss/libs/vanilla-framework/_vanilla.scss from line 3:1 of _scss/styles.scss from line 1:1 of main.scss >> $value: math.div($value, $number); ------------------^
The issue might be because there's still an open issue for GitHub pages gem which is using a deprecated version of jekyll-sass-converter (1.5.2): github/pages-gem#813