| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
When no dependencies are present to be digested there is no reason to build an array just to turn around and turn it back into a string.
The dependencies array is not mutated in this method so we can use the same empty array across all invocations.
Total allocated: 791402 bytes (7294 objects)
Total allocated: 777442 bytes (7132 objects)
(791402 - 777442) / 791402.0 # => 1.76 % speed improvement
|
|
|
|
|
| |
* Concurrent::Map usage was removed from this file in 3239ed48d28f3c0baf4445e6c279107e892b7cab
* Monitor usage was removed in f233598d2da773c2024cbe62a199ddc70d9fd7a1
|
|
|
|
| |
Follows #32612
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
```
$ ruby -v
ruby 2.6.0dev (2018-04-04 trunk 63085) [x86_64-linux]
$ bundle exec rake test:template
...
/rails/actionview/lib/action_view/digestor.rb:76: warning: passing splat keyword arguments as a single Hash to `find_all'
```
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
implementation
and defaults to `Digest::MD5`.
Replaced calls to `::Digest::MD5.hexdigest` with calls to `ActiveSupport::Digest.hexdigest`.
|
|
|
|
| |
This basically reverts c4d1a4efeec6f0b5b58222993aa0bec85a19b6a8
|
| |
|
| |
|
| |
|
|
|
|
| |
names and simplify error logging to a single line when not
|
| |
|
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
| |
|
|
|
|
| |
- `partial` option is not used anymore, this was removed in https://github.com/rails/rails/pull/23724
|
|
|
|
| |
non-default (html) template
|
|
|
|
| |
paths correctly
|
|
|
|
| |
format other than the first default
|
|
|
|
|
| |
Leftover from an earlier commit, chose to fix because I was
just down in this file.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Per request digest caches were added before we had hooks into
different units of work that Rails performs.
As such the most reliable way to prevent stale cache digests
was with a middleware. The middleware prevented staleness in
Action Controller requests.
However, the executor is superior because it should also prevent
staleness when running just Active Job jobs or broadcasting
through Action Cable's server.
|
|
|
|
|
| |
we know that all child templates will be considered as "partials", so
the only one that needs detection by name is the root node
|
|
|
|
|
|
| |
Only the root node has injected dependencies, so we don't need to care
about them at lower levels. This change pushes the injected
dependencies up to where the user passed them in.
|
|
|
|
|
|
|
|
|
| |
this is for backwards compatibility. We should remove this after
5-0-stable is created because digest calculation should be amortized.
Caching digests of subtrees will speed up digests for other trees that
share the same children. However, this will also increase memory, and
after the app warms up, then those subtrees will never be reused which
means that memory is wasted.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* master: (27 commits)
move digest cache on to the DetailsKey object
remove object `hash` cache
[ci skip] fix suggested change-replace 'an' with 'the in Rails engine guide'
Missing documentation about hash algorithm option for MessageVerifier [ci skip]
set `skip_listen` option to dummy appplication
Fix the language in engines guide
Add accidentally removed `#` [ci skip]
fields_for_style needs to test for AC::Parameters
Fix indentation for code block in changelog
Remove accidentally duplicated change log title [ci skip]
partially revert 69009f4473637a44ade26d954ef5ddea6ff903f2
Remove needless `case_insensitive_comparison` in mysql2 adapter
modify to `error` also abort when specify fail fast option
Implement ActionController::Parameters#inspect
remove unused method
Remove unused Journey code
Add Action Cable CHANGELOG in release notes [ci skip]
Show proper error message when a non-relation object is passed to AR::Relation#or
Fix semantics of test names for finish option in batches_test
Fix typo
...
Conflicts:
actionview/lib/action_view/digestor.rb
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This moves digest calculation cache on to the details key object.
Before, the digest cache was a class level ivar, and one of the keys was
the hash value of the details key object:
https://github.com/rails/rails/blob/13c4cc3b5aea02716b7459c0da641438077f5236/actionview/lib/action_view/digestor.rb#L28
An object's hash value is not unique, so it's possible for this cache
key to produce colliding keys with no resolution. This commit move
cache on to the details key object itself, so we know that the digests
are always unique per details key object.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
this commit removes unused code and changes the monitor to a mutex.
Since the digest doesn't recurse on itself anymore, we can just use a
mutex
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
also remove the EMPTY node since we won't need it
|
|/
|
|
| |
also add an EMPTY sentinel node
|
|
|
|
|
|
|
| |
this lets us leverage Ruby's kwarg handling (exceptions for missing
params, etc) ASAP which allows us to skip active support method calls
and make sure the exception stack is closer to where the user called the
methods.
|
|
|
|
|
| |
we can use kwargs in this case to avoid values_at and except calls on
the options hash
|
|
|
|
| |
Wasn't removed in 57ac777.
|
| |
|
| |
|
|
|
|
| |
then we can stop scattering nil checks (e.g. `try`) through the class.
|
| |
|
|
|
|
|
|
|
| |
The thread_safe gem is being deprecated and all its code has been merged
into the concurrent-ruby gem. The new class, Concurrent::Map, is exactly
the same as its predecessor except for fixes to two bugs discovered
during the merge.
|
| |
|
|
|
|
|
|
| |
Avoid computing the same fragment digest many times when looping over templates.
The cache is cleared on every request so template changes are still picked up.
|
|\
| |
| |
| |
| | |
Conflicts:
guides/source/configuring.md
|
| |
| |
| |
| | |
LookupContext is class name
|