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
Replace sassc with sass-embedded #2551
base: main
Are you sure you want to change the base?
Conversation
👍 |
97ea908
to
5ea6567
Compare
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
acc2818
to
a67b806
Compare
@tdreyno This PR is ready for review. Please let me know if you have any feedbacks or questions. |
Not sure what's the issue with failed macos ruby 3.1 CI test. The issue does not seem to be related to this change. Also, all tests worked fine for me on linux ruby 3.1 locally. |
5.x is probably abandoned. Commented on not breaking config api compat. Might be best to re-target at 4.x/main |
Note, this PR relies on |
In general, I'm in favor of dropping support of end-of-life ruby versions, as they become burden of adopt new features. The compatibility policy of Ruby 2.5 was never supported in any stable versions of sass-embedded. The very last version supporting ruby 2.6 was 1.58.3, which is missing lots of features and bug fixes. Specifically, there are also a few features added recently to make this middleman PR smaller. An alternative is to still install I'm not recommending this option, because it's a lot of extra work supporting end-of-life software. |
I would recommend having two renderers. They get enabled if the gem they depend on is present (there's other examples of this in the code where adding a templating engine not in the default gem spec will enable support). If the require throws (missing gem), the renderer will not enable. The concept of "end of life" doesn't make a lot of sense for pieces of tooling like Middleman. Folks have 15 year old blogs running just fine and they shouldn't need to worry about upgrading ruby. Old code should continue to just work. We can update the new project template to include sass-embedded for new projects and users who want to and can switch can add it to their gem file. We can also bump the minor version as a way to treat this as a new feature and encourage upgrades |
The
sassc
gem (libsass) has been deprecated in Oct 2020.sass-embedded
is a new ruby api implementation that uses the official dart-sass compiler internally.This PR replaces sassc with new sass-embedded, so that users can use up to date dart-sass based implementation with latest features such as
@use
.Because this PR is targeting 5.x, I decided to make some breaking change in terms of how config works. Now it is just a top level hash
config[:sass]
, which user can set any config key that sass-embedded supports. For example: