Closed gravitystorm closed 11 months ago
Final two points aren't relevant - bootstrap uses a custom division function that works with libsass, effectively "reverse polyfilling" support from the new dart version back to the old version.
The deprecation warnings come from our own code, which uses /
in several places.
I thought we'd solved this by switching around our includes, but it still triggers in precompilation. Latest review of options:
/
(grep -rn '/[0-9]' app/assets/stylesheets/
)https://github.com/twbs/bootstrap-rubygem/pull/256
across the lineSee if we can refactor further, so that all the stylesheets are handled in one pass, e.g. including leaflet and iD via sass @import
instead of via sprockets stuff
See if we can persuade sassc-rails to become a wrapper for dartsass-sprockets
Figure out what alternatives there are for using bootstrap, e.g. not from a gem, to allow us to switch to dartsass-sprockets
Figure out whether to drop sprockets and move to whatever CSS option is the default approach in rails.
Option 3.1 has happened!
So now we need to do some forking of the gem, since I doubt it would be backported to existing releases. We'll need to start with a 5.1 fork that has the dependency removed, start using that with dartsass, and then do the same again for 5.2
https://github.com/openstreetmap/openstreetmap-website/pull/4261
See https://github.com/sass/sassc-rails/issues/174 and in particular my comment at https://github.com/sass/sassc-rails/issues/174#issuecomment-1226010642
So originally sass was a ruby project, then it became a C++ "libsass" which was available as sassc. Now the official implementation is in Dart.
This is a list of related ruby gems, there's a lot here:
sass
- the og implementation of sass, in rubysassc
- rubygem that uses libsass. Note that the repo is calledsassc-ruby
.sass-rails
- was originally based onsass
, now just a wrapper forsassc-rails
.sassc-rails
- what we use, depends onsassc
andsprockets-rails
sass-embedded
- a wrapper around the Dart version of sass. Note that the repo issass-embedded-host-ruby
sassc-embedded
- a shim to makesassc
work withsass-embedded
. Note that the repo issassc-embedded-shim-ruby
dartsass-ruby
- a wrapper aroundsass-embedded
, but which implementssassc
compatibilitydartsass-sprockets
- a wrapper arounddartsass-ruby
, but which implementssassc-rails
compatibilityThe problem is that the bootstrap gem depends directly on sassc-rails, which makes it impossible to use dartsass-sprockets since they reuse the same namespace when both are loaded at the same time.
Option 1
Pin
sassc
gem to an old version, from before April 2019 when the error message was implemented in libsass.Option 2
Use the
sassc-embedded
shim. This involves running a modified version of sassc that disables half the stuff, plus the sassc-embedded shim to make that stuff work via dart.Option 3
Use dartsass-sprockets.
Option 4
Rename our css files to scss. This means that sprockets can do the stylesheets in one pass, which saves libsass from trying to read the minified version that is triggering this error.
Followups