1. 01 1月, 2020 1 次提交
  2. 20 12月, 2019 1 次提交
    • E
      Don't require "action_view/base" in action pack: · 88ee52f9
      Edouard CHIN 提交于
      - ### Problem
      
        ActionPack requires "action_view/base" at boot time, this
        causes a variety of issue that I described in detail in #38024.
      
        There is no real reason to require av/base in the
        ActionDispatch::Debugexceptions class.
      
        ### Solution
      
        Like any other components (such as ActiveRecord, ActiveJob...),
        ActionView::Base shouldn't be loaded at boot time.
      
        Here are the two main changes needed for this:
      
        1) Actionview has a special initializer that needs to run
           before the app is fully booted (adding a executor needs to be done
           before application is done booting)
        https://github.com/rails/rails/blob/63ec70e700e321b22e9baf2ad2d45cd3f4febc79/actionview/lib/action_view/railtie.rb#L81-L84
      
           That initializer used a lazy load hooks but we can't do that anymore
           because Action::Base view won't be triggered during booting process.
           When it will get triggered, (presumably on the first request),
           it's too late to add an executor.
      
        ------------------------------------------------
      
        2) Compare to other components, ActionView doesn't use `Base` for
           configuration flag. A lot of flags ares instead set on modules
           (FormHelper, FormTagHelper).
           The problem is that those module depends on AV::Base to be
           loaded, as otherwise configuration set by the user aren't applied.
           (Since the lazy load hooks hasn't been triggered)
           https://github.com/rails/rails/blob/63ec70e700e321b22e9baf2ad2d45cd3f4febc79/actionview/lib/action_view/railtie.rb#L66-L69
      
           We shouldn't wait for AB::Base to be loaded in order to set these
           configuration. However, we need to do it inside an
           `after_initialize` block in order to let application
           set it to the value they want.
      
        Closes #28538
      
        Co-authored-by: betesh <iybetesh@gmail.com>"
      88ee52f9
  3. 20 6月, 2019 1 次提交
    • G
      Autoload SyntaxErrorInTemplate · 99e52ae7
      Guilherme Mansur 提交于
      When a SyntaxError is detected in a template we raise this exception. On
      a first request to the server the exception we get a NameError since the
      exception is not required from `active_view/template/error.rb` yet.
      However later on it gets required and a second request will succeed.
      On the first request we see the rails "Something Wen Wrong" page and not
      the expected syntax error in template error page with the webconsole and
      stacktrace. By autoloading the constant we fix this issue.
      Co-authored-by: NGannon McGibbon <gannon.mcgibbon@gmail.com>
      99e52ae7
  4. 13 4月, 2019 1 次提交
    • J
      De-dup Templates, introduce UnboundTemplate · 1fc735e5
      John Hawthorn 提交于
      Previously it's possible to have multiple copies of the "same" Template.
      For example, if index.html.erb is found both the :en and :fr locale, it
      will return a different Template object for each. The same can happen
      with formats, variants, and handlers.
      
      This commit de-duplicates templates, there will now only be one template
      per file/virtual_path/locals tuple.
      
      We need to consider virtual_path because both `render "index"`, and
      `render "index.html"` can both find the same file but will have
      different virtual_paths. IMO this is rare and should be
      deprecated/removed, but it exists now so we need to consider it in order
      to cache correctly.
      
      This commit introduces a new UnboundTemplate class, which represents a
      template with unknown locals. Template objects can be built from it by
      using `#with_locals`. Currently, this is just a convenience around
      caching templates, but I hope it's a helpful concept that could have
      more utility in the future.
      1fc735e5
  5. 05 4月, 2019 1 次提交
  6. 02 4月, 2019 1 次提交
  7. 07 2月, 2019 1 次提交
  8. 02 2月, 2019 1 次提交
  9. 31 12月, 2018 1 次提交
  10. 31 12月, 2017 1 次提交
  11. 31 10月, 2017 1 次提交
  12. 21 10月, 2017 1 次提交
  13. 24 7月, 2017 1 次提交
  14. 02 7月, 2017 1 次提交
  15. 01 7月, 2017 2 次提交
  16. 23 5月, 2017 1 次提交
  17. 31 12月, 2016 1 次提交
  18. 07 8月, 2016 1 次提交
  19. 01 1月, 2016 1 次提交
  20. 31 12月, 2014 1 次提交
  21. 17 6月, 2014 2 次提交
  22. 16 6月, 2014 1 次提交
  23. 01 2月, 2014 2 次提交
  24. 06 1月, 2014 1 次提交
  25. 02 1月, 2014 1 次提交
  26. 03 12月, 2013 1 次提交
  27. 25 8月, 2013 5 次提交
  28. 20 6月, 2013 3 次提交
  29. 01 1月, 2013 1 次提交
  30. 01 1月, 2012 1 次提交
  31. 23 2月, 2011 1 次提交