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

Don't require ActionView::Base when rake tasks get loaded: #455

Merged

Conversation

Edouard-chin
Copy link
Member

@Edouard-chin Edouard-chin commented Jan 3, 2020

Don't require ActionView::Base when rake tasks get loaded:

  • Problem

    When running any rake command, Sprockets Rails will autoload
    ActionView::Base way too early. This creates a broader issue
    which I described in detail in Create Finisher initializer to warn for components used too early: rails#38024

    Solution

    This require statement was the last attempt to fix a old issue
    in 2014. TL;DR on the issue is that assets_prefix would
    get ignored when precompiling assets.

    A lot has change since 2014 in sprockets-rails and after digging
    I can confirm that requiring AV::Base is no longer needed.
    We don't need it to run assets related rake tasks.
    This is thanks thanks of the decoupling between
    Sprockets::Rails::Context and Sprockets::Rails::Helper
    in 32a58f54

cc/ @rafaelfranca

@Edouard-chin Edouard-chin force-pushed the ec-action-view-noneed-toload branch 2 times, most recently from 1b26227 to 7e53408 Compare January 3, 2020 20:41
- ### Problem

  When running any rake command, Sprockets Rails will autoload
  `ActionView::Base` way too early. This creates a broader issue
  which I described in detail in rails/rails#38024

  ### Solution

  This `require` statement was the last attempt to fix a old [issue](rails/rails#9461)
  in 2014. TL;DR on the issue is that assets_prefix would
  get ignored when precompiling assets.

  A lot has change since 2014 in sprockets-rails and after digging
  I can confirm that requiring AV::Base is no longer needed.
  We don't need it to run assets related rake tasks.
  This is thanks thanks of the decoupling between
  `Sprockets::Rails::Context` and `Sprockets::Rails::Helper`
  in rails@32a58f54
@Edouard-chin
Copy link
Member Author

Build is red but it doesn't seem related

@rafaelfranca rafaelfranca merged commit c269f5e into rails:master Jan 3, 2020
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.

2 participants