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

Move to Dart Sass #255

Closed
SebouChu opened this issue Mar 6, 2023 · 8 comments · Fixed by #256
Closed

Move to Dart Sass #255

SebouChu opened this issue Mar 6, 2023 · 8 comments · Fixed by #256

Comments

@SebouChu
Copy link
Contributor

SebouChu commented Mar 6, 2023

Hi!

Giving the fact that SassC is deprecated and that the sassc-rails gem seems dead for more than 3 years, I think the Bootstrap gem should move to Dart Sass.

The Rails organization has a wrapper, being the dartsass-rails gem but it's not compatible with Sprockets.

As an alternative, the TableCheck organization made a Sprockets-compatible wrapper, beautifully named dartsass-sprockets.

What do you think?

@glebm
Copy link
Member

glebm commented Mar 6, 2023

I don't use Rails much anymore but it sounds like migrating to dartsass-sprockets would make sense.
I'm guessing that in the post-Sprockets Rails JavaScript world this gem simply isn't needed, as one can use the npm bootstrap package directly.

@SebouChu
Copy link
Contributor Author

SebouChu commented Mar 6, 2023

Yeah, I was thinking pretty much the same thing 👍

If no one is available on your team and if you're okay with this, I can try to fork and make the change there!

@jcoyne
Copy link

jcoyne commented Mar 21, 2023

How about not specifying a sass dependency at all and leaving it up to the user to select the one that is appropriate for them?

@gravitystorm
Copy link

I just want to chime in here with my experience.

I'm a maintainer over at OpenStreetMap and the dependency on sassc-rails is blocking us from upgrading to bootstrap 5.2 . We are running into an issue where libsass can no longer parse it's own compressed output, with syntax that is used in bootstrap 5.2+, and that's causing problems while precompiling all our assets. More details on the exact syntax issue in this comment

Since libsass is dead, and the parsing problem is unlikely to be fixed there, I want to switch to dartsass-sprockets. But we can't since it's an either/or with sassc-rails vs dartsass-sprockets. And this gem has a hard runtime dependency on sassc-rails.

I'd be in favour of either proposed solution - either switching the dependency to dartsass-sprockets (as per #256), or figuring out how to drop the hardcoded sass engine dependency entirely (as per above comment). Either way, having a bootstrap-rubygem is still very useful for us, just not one that depends on a legacy unmaintained gem! 😄

@SebouChu
Copy link
Contributor Author

SebouChu commented Aug 16, 2023

Not having a hardcoded Sass dependency would be better I guess, but I don't really know how to write this in a smart and clean way :(

@SebouChu
Copy link
Contributor Author

require 'dartsass-sprockets'

Something clean to write here maybe if we want to declare Sass as a soft dependency and let the user pick between the two gems (other than removing the gem from the current dependencies)

@SebouChu
Copy link
Contributor Author

SebouChu commented Aug 16, 2023

Maybe something like this?

begin
  require 'dartsass-sprockets'
rescue LoadError
  require 'sassc-rails'
rescue LoadError
  raise LoadError.new("bootstrap-rubygem requires a Sass engine. Please add dartsass-sprockets or sassc-rails to your dependencies.")
end

@glebm
Copy link
Member

glebm commented Aug 17, 2023

@SebouChu Yeah something along these lines would be ideal

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 a pull request may close this issue.

4 participants