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

Possible to use this gem with dartsass-rails? #1247

Open
nimmolo opened this issue Apr 27, 2024 · 4 comments
Open

Possible to use this gem with dartsass-rails? #1247

nimmolo opened this issue Apr 27, 2024 · 4 comments

Comments

@nimmolo
Copy link

nimmolo commented Apr 27, 2024

Switching our Rails 7 app from sassc to dartsass-sprockets works with bootstrap-rails.

But if we try to switch to dartsass-rails, assets:precompile fails.

If we keep gem sprockets-rails and sprockets:railtie:

LoadError: cannot load such file -- sass (LoadError)

or if we don't load sprockets, of course there's no task assets:precompile:

Don't know how to build task 'assets:precompile' (See the list of available tasks with `rake --tasks`)

I've tried debugging this according to this issue on dartsass-rails, but even with the file app/assets/builds/.keep in place, assets:precompile is not a defined task.

Reading through the code of this gem, it seems that sprockets-rails is not a dependency. Is there anyone who has gotten this to work with dartsass-rails?

@mhenrixon
Copy link

Try dartsass-sprockets instead. I use that quite successfully as it uses sass-embedded under the hood.

@nimmolo
Copy link
Author

nimmolo commented Aug 10, 2024

Thanks @mhenrixon - dartsass-sprockets is what we're using now. Are you able to get it to compile changes to your SASS?

Unfortunately for us, dartsass-sprockets has started ignoring dev changes in any SASS files that are included by @import. It does not compile the changes unless we force it by changing some variable in top level SASS files. I don't know if our issue is with sass-embedded, dartsass-sprockets... or if it's expected behavior, because the older version of Bootstrap included with this gem now throws SASS deprecation warnings.

That's why we were looking to try dartsass-rails. In any case I believe that we'll update to BS 4 and 5 pretty soon, and then we'll switch to the appropriate gem for those versions, or maybe include the SCSS manually. But in the meantime it's making front end changes much more complicated.

@mhenrixon
Copy link

That's why we were looking to try dartsass-rails. In any case I believe that we'll update to BS 4 and 5 pretty soon, and then we'll switch to the appropriate gem for those versions, or maybe include the SCSS manually. But in the meantime it's making front end changes much more complicated.

@nimmolo, I have already upgraded one project to BS 5.3, but the other project is a beast of 300,000 LoC and has 60% test coverage.

esbuild/node-sass still have issues with picking up on changes that I haven't experienced with, say, tailwindcss, vite, and bun.

@nimmolo
Copy link
Author

nimmolo commented Aug 11, 2024

@mhenrixon Good to know about node-sass not picking up changes either. Something tells me the deprecation warnings from BS 3 are stoping compilation and i just have to knuckle down and upgrade.

I agree with you about how daunting that can be. My main project is a 271K LoC beastie that i've been trying to get to BS4 for years, but keep realizing there are deeper things to fix!

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

No branches or pull requests

2 participants