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

Support new SASS processors #271

Merged
merged 2 commits into from
Jan 11, 2024
Merged

Support new SASS processors #271

merged 2 commits into from
Jan 11, 2024

Conversation

matteeyah
Copy link
Contributor

@matteeyah matteeyah commented Jan 10, 2024

Summary

The gem currently only supports current-gem SASS processors - dartsass-sprockets and sassc-rails. The PR adds support for dartsass-rails and cssbundling-rails.

Closes #247

@@ -7,7 +7,15 @@
begin
require 'sassc-rails'
rescue LoadError
raise LoadError.new("bootstrap-rubygem requires a Sass engine. Please add dartsass-sprockets or sassc-rails to your dependencies.")
begin
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate the way these rescues nest, but I can't think of a better way for chaining requires like this.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#272 suggestion

@manuelmeurer
Copy link
Contributor

I don't think checking for these gems in the engine is necessary/appropriate at all.
For example, it should also work with dartsass-sprockets - another gem we would need to check for. And there might be more in the future.

Instead, I'd propose to remove these checks completely and let the user decide how to do their bundling. 🤷

@matteeyah
Copy link
Contributor Author

@manuelmeurer I agree. Although I didn't want to make major changes to avoid a potentially lengthy discussion - my priority was to unblock using this gem with the new SASS processors. We can follow up discussing removing the requires altogether after this is merged.

@manuelmeurer
Copy link
Contributor

Ok, let's wait for a maintainer to chime in! 😄
I'm happy to create a PR from my fork if removing the requires is acceptable.

@glebm
Copy link
Member

glebm commented Jan 11, 2024

Removing the requires would be good but we'd need to make sure it doesn't break backwards compatibility too badly.

@glebm glebm merged commit 51396a3 into twbs:main Jan 11, 2024
26 checks passed
@manuelmeurer
Copy link
Contributor

I don't think backwards compatibility would be an issue here, since all these requires do is, well, requiring the gems. 😄
But maybe a minor version bump would be in order.
Let me know if you want me to create a PR for this.

@glebm
Copy link
Member

glebm commented Jan 11, 2024

@manuelmeurer Yes please. Let's also have a few people test the PR.

One thing that might go wrong is the require order -- I don't know if any of these preprocessors must be required before bootstrap.

@Peredery
Copy link

@glebm @manuelmeurer Hi, there seems to be something else that needs to be fixed. Please look at this ticket: #277

@Peredery
Copy link

@glebm @manuelmeurer Hi, there seems to be something else that needs to be fixed. Please look at this ticket: #277

I didn't notice it at first, because macos has by default: JavaScriptCore and it is used, but docker doesn't have it and the error is immediately noticeable there

@januszm
Copy link

januszm commented Feb 11, 2024

I'll backport this to branch 4.6-stable unless someone is already working on it

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.

Bootstrap without sprockets
5 participants