Skip to content
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

Optionally use sassc #151

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Optionally use sassc #151

wants to merge 1 commit into from

Conversation

perlpunk
Copy link

@perlpunk perlpunk commented Jun 18, 2024

Summary

This PR will use sassc if MOJO_PLUGIN_ASSETPACK_SASSC is set.

Motivation

ruby's sass is officially abandoned, and it has problems with some css files, for example the latest bootstrap css, so it would be good to have the option to use sassc. Or even other sass implementations.

References

@kraih
Copy link
Member

kraih commented Jun 19, 2024

Rebase on main.

ruby's sass is officially abandoned, and it has problems with some css files,
for example the latest bootstrap css, so it would be good to have the option
to use sassc. Or even other sass implementations.

This PR will use sassc if `MOJO_PLUGIN_ASSETPACK_SASSC` is set.
@perlpunk
Copy link
Author

Rebased.
This PR actually includes the --trace from #150 . So I can rebase again when that is merged

@kraih
Copy link
Member

kraih commented Jun 20, 2024

Without tests i don't think this has much of a chance i'm afraid.

@kraih kraih requested review from a team, marcusramberg, kraih, jhthorsen and jberger June 20, 2024 11:26
@nicomen
Copy link
Collaborator

nicomen commented Jun 20, 2024

I'm not sure if using a very specific envv-ar with just a boolean value bolted on the existing Sass module is ideal. I'm guessing sassc also needs a different install approach than using ruby gems?

Would it make sense to add Mojolicious::Plugin::AssetPack::Pipe::SassC or ::RubySassC module instead (subclassing should be possible)? Adding tests for a separate pipe might be more straight-forward too.

Another approach would be to be able to set the whole cmd to call with an envvar eg: MOJO_PLUGIN_ASSETPACK_SASS_CMD="sassc -s --strace", but the _install_sass method would still be wrong.

The --strace part could probably be added independently just depending on whether the general DEBUG flag is set.

@perlpunk perlpunk marked this pull request as draft June 20, 2024 13:46
@perlpunk
Copy link
Author

I'm not sure if using a very specific envv-ar with just a boolean value bolted on the existing Sass module is ideal. I'm guessing sassc also needs a different install approach than using ruby gems?

We're installing rubygem-sass as an openSUSE package anyway, so I don't know when _install_sass would actally be called.

Would it make sense to add Mojolicious::Plugin::AssetPack::Pipe::SassC or ::RubySassC module instead (subclassing should be possible)? Adding tests for a separate pipe might be more straight-forward too.

Another approach would be to be able to set the whole cmd to call with an envvar eg: MOJO_PLUGIN_ASSETPACK_SASS_CMD="sassc -s --strace", but the _install_sass method would still be wrong.

Yeah, since there's also the recommendation to use dart-sass the command line might be different for that as well. So an approach to support various implementations would be good.
But the command must still put together the parameters like include_paths correctly. That would work if every sass implementation uses -I.

The --strace part could probably be added independently just depending on whether the general DEBUG flag is set.

IMHO adding --trace always won't hurt, as it only really outputs something when there is an error. Without it the error message is pretty useless.
But that can maybe be discussed in #150

@Martchus
Copy link
Contributor

Making the whole command overrideable sounds simple enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants