-
Notifications
You must be signed in to change notification settings - Fork 788
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
SassC Support #148
SassC Support #148
Conversation
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @schneems (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
( ping @rafaelfranca ) |
context = input[:environment].context_class.new(input) | ||
|
||
options = engine_options(input, context) | ||
engine = Autoload::SassC::Engine.new(input[:data], options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not the engine have a cache option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, there is currently no caching supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it does have caching, but there’s currently no option to turn it on or off.
Thank you so much for working on this. I asked some questions in the implementation. |
filename: input[:filename], | ||
syntax: self.class.syntax, | ||
load_paths: input[:environment].paths, | ||
importer: @importer_class, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the importer is nil
should not we use a default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we specify nil
as the importer, it will use the standard LibSass
file importer.
We can add the custom importer (with globbed imports and stuff) in sass-rails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. Just to make sure we have a default importer and it can be used without sass-rails
def initialize(options = {}, &block) | ||
# SassC engine does not currently support caching | ||
# @cache_version = options[:cache_version] | ||
# @cache_key = "#{self.class.name}:#{VERSION}:#{Autoload::SassC::VERSION}:#{@cache_version}".freeze |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cache_key
is needed for sprockets own caching even if there is no specific caching in the processor. This way if the processor lib upgrades the sprockets cache is invalidated. So we need @cache_key
but we don't need @cache_version
only its value in the end of the cache key.
@rafaelfranca I think I addressed all of your comments. Did I miss anything? |
@malida @bolandrm @Andreis13 great work on this 👏 👏 👏 |
👍 |
Rebased, squashed some commits and merged. Thank you! 01fa5a6 |
🤘❤️ |
This is a continuation of PR #80.
I have done the following:
SasscImporter
. It makes more sense to create this class in sass-rails, because the ruby sass importer class is created there as well. So we may be able to share some of the logic.shared_sass_tests.rb
) so that they can be used for both ruby sass and sassc