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

SassC Support #148

Closed
wants to merge 12 commits into from
Closed

SassC Support #148

wants to merge 12 commits into from

Conversation

bolandrm
Copy link
Contributor

@bolandrm bolandrm commented Oct 2, 2015

This is a continuation of PR #80.

I have done the following:

  • Removed the 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.
  • Pulled out the sass tests into modules (shared_sass_tests.rb) so that they can be used for both ruby sass and sassc
  • Refactored the SasscProcessor slightly.

@rails-bot
Copy link

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.

@bolandrm
Copy link
Contributor Author

bolandrm commented Oct 2, 2015

( ping @rafaelfranca )

@jeremy jeremy mentioned this pull request Oct 2, 2015
context = input[:environment].context_class.new(input)

options = engine_options(input, context)
engine = Autoload::SassC::Engine.new(input[:data], options)
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link

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.

@rafaelfranca
Copy link
Member

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,
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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
Copy link
Member

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.

@bolandrm
Copy link
Contributor Author

bolandrm commented Oct 3, 2015

@rafaelfranca I think I addressed all of your comments. Did I miss anything?

@guilleiguaran
Copy link
Member

@malida @bolandrm @Andreis13 great work on this 👏 👏 👏

@edward
Copy link

edward commented Oct 4, 2015

👍

rafaelfranca added a commit that referenced this pull request Oct 5, 2015
@rafaelfranca
Copy link
Member

Rebased, squashed some commits and merged. Thank you! 01fa5a6

@jeremy
Copy link
Member

jeremy commented Oct 5, 2015

🤘❤️

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.

9 participants