1. 09 3月, 2019 1 次提交
  2. 01 3月, 2019 1 次提交
    • X
      Removes unnecessary dot in regexp · 42ca13a9
      Xavier Noria 提交于
      A string S matches ([.]|\b)html if an only if matches \bhtml:
      
        * If S matches [.]html, then it matches \bhtml.
      
        * If S matches \bhtml, then it matches \bhtml.
      
      Reciprocally:
      
        * If S matches \bhtml, then it matches ([.]|\b)html.
      
      The character class can be removed, and since we are on it we remove the
      group too so that it is clear to a reader of the code that there is no
      grouping going on.
      
      References #35166.
      42ca13a9
  3. 27 2月, 2019 5 次提交
  4. 26 2月, 2019 14 次提交
  5. 23 2月, 2019 3 次提交
    • A
      Add a finalizer to inline templates · 52eafbd7
      Aaron Patterson 提交于
      This commit adds a finalizer just to inline templates.  We can't cache
      compilation of inline templates because it's possible that people could
      have render calls that look like this:
      
      ```ruby
      loop do
        render inline: "#{rand}"
      end
      ```
      
      and we would cache every one of these different inline templates.  That
      would cause a memory leak.  OTOH, we don't need finalizers on regular
      templates because we can cache, control, and detect changes to the
      template source.
      
      Fixes: #35372
      52eafbd7
    • A
      Ensure that rendered templates always have a format · 62cb3ee3
      Aaron Patterson 提交于
      This removes one call to `lookup_context` and also eliminates a
      conditional in `_render_template`.
      62cb3ee3
    • A
      Pass lookup context to the layout handlers · 1cf38789
      Aaron Patterson 提交于
      I want to start reducing the calls to `lookup_context`.  That method
      caches the lookup context in an ivar, but I would like to cache the
      lookup context on the stack.  That way we aren't coupled to the behavior
      of the `lookup_context` method.
      1cf38789
  6. 21 2月, 2019 1 次提交
  7. 20 2月, 2019 5 次提交
    • C
      Deprecate ActionView::PathSet as argument to ActionView::Base.new · 998ed7eb
      Cliff Pruitt 提交于
      Currently, `ActionView::Base.new` will raise a `NotImplementedError` when given an instance of `ActionView::PathSet` on initialization. This commit prevents the raised error in favor of a deprecation warning.
      998ed7eb
    • A
      Deprecate LookupContext#rendered_format · 1c747525
      Aaron Patterson 提交于
      We no longer depend on `rendered_format` side effects, so we can remove
      this method now. 🎉
      1c747525
    • A
      Fix up style · 3f84a814
      Aaron Patterson 提交于
      3f84a814
    • A
      Return rendered template information instead of just strings · 1bc0a59d
      Aaron Patterson 提交于
      This commit introduces "rendered template" and "rendered collection"
      objects.  The template renderers can now return a more complex object
      than just strings.  This allows the framework to get more information
      about the templates that were rendered.  In this commit we use the
      rendered template object to set the "rendered_format" on the lookup
      context in the controller rather than all the way in the template renderer.
      That means we don't need to check the "rendered_format" every time we
      render a template, we just do it once after all templates have been
      rendered.
      1bc0a59d
    • A
      rename push / pop function · 3077cdf9
      Aaron Patterson 提交于
      3077cdf9
  8. 18 2月, 2019 1 次提交
  9. 16 2月, 2019 3 次提交
    • Y
      Show deprecated message instead of raise exception in `compiled_method_container` method · 7878027c
      yuuji.yaginuma 提交于
      Since #35036, the subclasses of `ActionView::Base` requires
      the `compiled_method_container`.
      This is incompatible. For example, `web-console` use view class that
      subclass of `ActionView::Base`, and does not work it now cause of this.
      
      Actually, since it seems that it is only `ActionView::Base` that
      `compiled_method_container` is necessary, modified the condition that
      emits a warning.
      7878027c
    • A
      Pass the template format to the digestor · 1581cab9
      Aaron Patterson 提交于
      This commit passes the template format to the digestor in order to come
      up with a key.  Before this commit, the digestor would depend on the
      side effect of the template renderer setting the rendered_format on the
      lookup context.  I would like to remove that mutation, so I've changed
      this to pass the template format in to the digestor.
      
      I've introduced a new instance variable that will be alive during a
      template render.  When the template is being rendered, it pushes the
      current template on to a stack, setting `@current_template` to the
      template currently being rendered.  When the cache helper asks the
      digestor for a key, it uses the format of the template currently on the
      stack.
      1581cab9
    • Y
      Allow to pass options to `csp_meta_tag` · 96937335
      yuuji.yaginuma 提交于
      Currently `csp_meta_tag` generates `name` attribute only.
      However, in libraries like `Material-UI` and `JSS`, expect that the meta tag
      that contains the nonce with `property` attribute.
      
      https://material-ui.com/css-in-js/advanced/#how-does-one-implement-csp
      https://github.com/cssinjs/jss/blob/master/docs/csp.md
      
      This patch allows `csp_meta_tag` to specify arbitrary options and
      allows `nonce` to be passed to those libraries.
      96937335
  10. 14 2月, 2019 3 次提交
  11. 12 2月, 2019 1 次提交
    • A
      Turn lookup context in to a stack, push and pop if formats change · 2b6d2d20
      Aaron Patterson 提交于
      This commit keeps a stack of lookup contexts on the ActionView::Base
      instance.  If a format is passed to render, we instantiate a new lookup
      context and push it on the stack, that way any child calls to "render"
      will use the same format information as the parent.  This also isolates
      "sibling" calls to render (multiple calls to render in the same
      template).
      
      Fixes #35222 #34138
      2b6d2d20
  12. 09 2月, 2019 2 次提交