* Updates to support Rails 5, Rack 3 and Sinatra 2 (beta).
- Bump upper boundary of version for Rack dependency from 2.0 to 3 (exclusive).
- Version bump sinatra for CI testing to >= 2.0.0.beta2.
- Also replaces use of String#hash in middleman-core/features/asset_host.feature
to ensure sufficiently random variables are returned.
Closesmiddleman/middleman#1983.
* Testing revert of the version requirements...
To confirm my changes don't cause a regression for any of:
- Rails < 5
- Sinatra < 2
- Rack < 2
* Revert "Testing revert of the version requirements..."
This reverts commit 5cf4c2a07c0814eefa573358b1bc9b0eeb62f9c1.
* Updates for mappings change in tilt 2
* drop RedcarpetTemplate::Redcarpet2 which was removed in tilt 2
* require Tilt 2.0 or higher
* Make use of tilt 2's extensions_for method instead
There is no current reason to remove support for 4.2
This now makes for a backwards compatible change whereas before this would
have called for a new major version of middleman-core
* Determine the type of ignore pattern once per pattern.
Performing this work when checking when each file was ignored accounted
for around 4.5 of the 6 seconds that processing ignored files was taking
on a site with ~14,000 files and a small number of ignore patterns.
After this change, processing ignored files takes less than 1.5 seconds.
* Cache the normalized paths on Resource and SourceFile.
Normalizing the paths is expensive, so avoid doing it multiple
times. `Util::normalize_path` is marked as memoized, but this
is not effective as:
1. `memoize` doesn't appear to work with module functions.
2. Checking whether we have a memoized value is as expensive as
normalizing the path.
This further drops the time it takes to process ignored files on a site
with ~14,000 files from ~1.5 seconds to ~0.6 seconds.
Both `Array#reject` and `Array#include?` have linear time
complexity. This results in quadratic time complexity when
`Array#include?` is called within `Array#reject`'s block. Using
`Array`'s difference operator gives the same result in linear time.
In a site with ~14,000 files, this drops the time taken by some calls to
`SourceWatcher::poll_once!` from ~15 seconds each to just a few
milliseconds.
This allows manually changing the filename so that fiel header changes
can be reflected on the CDN. E.g. if you turn on crossOrigin serving
(CORS) the asset hash doesn't change, but the CDN cache needs to be
broken in order to pickup the new header.
Contract said that optional param priority can be only a number.
But the code also handle the boolean as a value to be compatibile
with old versions
Change contract to accept both Num and Bool
* Add regression test for infinite loop issue in Util::step_through_extensions (#1889)
* Prevent infinite loop when encountering files where base filename is a possible templating engine