Marc-André Cournoyer
0de722968c
Introduce the AST Optimizer
...
... that can only optimize one thing: combine `| append: 'a' | append: 'b'` into a single `| append_all: ['a', 'b']` filter call.
This avoids all the intermediate allocations caused by several `append`.
Also introduce a new filter `append_all: [*items]`.
2020-10-07 13:47:42 -04:00
Peter Zhu
5199a34d9b
Merge pull request #1304 from Shopify/pz-raw-bug
...
Fix duplication of text in raw tags
2020-10-05 10:59:15 -04:00
Peter Zhu
4c2ab6f878
Fix bug in raw tags
2020-10-05 10:47:28 -04:00
Dylan Thacker-Smith
a818dd9d19
Fix test with missing extension ( #1302 )
2020-09-30 13:44:28 -04:00
Dylan Thacker-Smith
013802c877
Move some unit tests without internal coupling to integration tests
...
since I would like to continue supporting these tests in liquid-c
in the foreseeable future.
2020-09-25 11:24:39 -04:00
Dylan Thacker-Smith
3dcad3b3cd
Move test/integration/parse_tree_visitor_test.rb to test/unit
...
The ParseTreeVisitor exposes the liquid internals that won't be
kept compatible with liquid-c, so move it out of the integration
tests directory so that we can easily ignore it when testing liquid-c
2020-09-25 11:24:39 -04:00
Dylan Thacker-Smith
db065315ba
Allow creating symbols that are garbage collected in a test
2020-09-25 11:24:39 -04:00
Dylan Thacker-Smith
ca4b9b43af
Port liquid-c bug compatible whitespace trimming ( #1291 )
2020-09-16 16:07:36 -04:00
Dylan Thacker-Smith
77084930e9
Bring back silencing of errors in blank nodes for backwards compatibility ( #1292 )
2020-09-15 10:35:18 -04:00
Dylan Thacker-Smith
ae9dbe0ca7
Fix render length resource limit so it doesn't multiply nested output
2020-09-03 11:13:04 -04:00
Dylan Thacker-Smith
3b486425b0
Handle BlockBody#blank? at parse time ( #1287 )
2020-09-03 11:07:13 -04:00
Dylan Thacker-Smith
0740e8b431
Remove unused quirk allowing liquid tags to close a block it is nested in ( #1284 )
2020-09-03 06:51:56 -04:00
Dylan Thacker-Smith
5532df880f
Handle disabled tags errors like other liquid errors ( #1275 )
2020-08-18 11:39:54 -04:00
Dylan Thacker-Smith
2b11efc3ae
Fix performance regression from introduction of Template#disable_tags ( #1274 )
2020-08-18 11:25:51 -04:00
Thierry Joyal
03be7f1ee3
[StaticRegisters] Add test coverage
2020-07-28 10:23:51 -04:00
Dylan Thacker-Smith
065ccbc4aa
Remove support for taint checking
2020-07-23 16:22:46 -04:00
Feken Baboyan
8541c6be35
make Template override static registers only when the register key is not defined
2020-05-28 09:08:03 -04:00
Thierry Joyal
bd1f7f9492
[StaticRegisters] Remove assertion for delete to not remove static content
2020-05-22 13:42:44 -04:00
Thierry Joyal
40d75dd283
Update test/unit/static_registers_unit_test.rb
...
Co-authored-by: Dylan Thacker-Smith <dylan.smith@shopify.com >
2020-05-22 12:15:52 -04:00
Thierry Joyal
f5011365f1
[StaticRegisters] Remove registers attr_reader
2020-05-22 10:51:07 -04:00
Thierry Joyal
b9979088ec
[StaticRegisters] Fetch raise on missing
...
Co-authored-by: Dylan Thacker-Smith <dylan.smith@shopify.com >
2020-05-22 09:35:47 -04:00
Dylan Thacker-Smith
81149344a5
Fix ParseTreeVisitorTest for ruby-head
2020-03-31 10:53:46 -04:00
Dylan Thacker-Smith
e9b649b345
Fix Liquid::Template inheritance ( #1227 )
...
self.class.default_resource_limits would return `nil` in a subclass, since
the attribute isn't set on subclasses.
2020-01-21 15:09:22 -05:00
Justin Li
dbaef5e79b
Merge pull request #1180 from Shopify/test-all-filters
...
Test all filters against random data to detect exceptions
2020-01-13 15:52:44 -05:00
Dylan Thacker-Smith
f7ad602bfc
Fix liquid tag nested in outer block
2020-01-09 19:13:13 -05:00
Dylan Thacker-Smith
67eca3f58d
Upgrade rubocop and style guide for ruby 2.7 compatibility
2020-01-09 13:15:34 -05:00
Thierry Joyal
0847bf560f
Merge pull request #1218 from Shopify/strainer/remove-safe-navigation
...
Remove handling of a nil context in the Strainer class
2020-01-07 11:54:49 -05:00
Dylan Thacker-Smith
8074565c3e
Merge pull request #1216 from Shopify/unsupported-taint-mode
...
Remove support for taint_mode on ruby versions that don't support it
2020-01-07 10:12:36 -05:00
Thierry Joyal
c0ffee3ff9
[Strainer] Remove safe navigation
2020-01-06 18:34:13 +00:00
Thierry Joyal
c0ffeeef26
[Strainer] Separate factory from template
2020-01-06 17:45:25 +00:00
Dylan Thacker-Smith
40c68c9c83
Remove support for taint_mode on ruby versions that don't support it
2019-12-19 11:12:51 -05:00
Martin Morissette
d8f31046a9
Introduce template factory
2019-12-17 21:45:08 -05:00
Mike Angell
57c9cf64eb
Allow render to handle with and for correctly ( #1193 )
...
* Allow render to handle with and for correctly
* code improvements
2019-10-23 04:12:46 +10:00
Alessandro Diogo Brückheimer
e83b1e4159
Add ForceEqualSignAlignment to .rubocop.yml ( #1190 )
...
* Add ForceEqualSignAlignment to .rubocop.yml
* Revert ForceEqualSignAlignment cop
* Update method alignment
* Undo addition of whitespace to improve readability
* Fix missing alignment
2019-10-21 21:18:48 +10:00
Mike Angell
3784020a8d
[New Feature] Add forloop inside render tag when using for syntax ( #1191 )
...
* Add forloop to render for syntax
* Remove forloop guard
2019-10-17 23:06:13 +10:00
uchoudh
1223444738
Fix flaky tests ( #1186 )
2019-10-12 02:52:07 +11:00
Mike Angell
2bfeed2b00
Resolve InputIterator dropping context ( #1184 )
...
* Resolve InputIterator dropping context
* Prefer attr_reader
2019-10-09 08:00:16 +11:00
Mike Angell
04b800d768
Add support for as in Render and Include tags ( #1181 )
...
* Add support for alias
* Remove duplicate code
* Default to template name
* Improve variable matching
* Extract render_partial
* remove method
2019-10-09 07:59:52 +11:00
Mike Angell
f1d62978ef
Allow default function to handle false as value ( #1144 )
...
* Allow default function to handle false as value
* Change to named parameter
* Remove redundant freeze
* add brackets to make intention clearer
* Use named param format from liquid
* Update syntax
* document default filter
2019-10-09 04:03:33 +11:00
uchoudh
ffadc64f28
Merge pull request #1172 from Shopify/add-liquid-profiling-attr
...
Add liquid profile attributes
2019-10-08 10:49:54 -04:00
Mike Angell
5302f40342
Rubocop fixes ( #1182 )
2019-10-07 17:06:47 +11:00
Mike Angell
b0f8c2c03e
Remove error logging
2019-10-05 01:13:35 +10:00
Mike Angell
37e40673ff
Filter test
2019-10-04 17:00:54 +10:00
uchoudh
fefee4c675
Add liquid profile attributes
...
Attribute testing
Add partial name support
2019-10-03 10:12:39 -04:00
Mike Angell
0db9c56f34
Disable rendering of tag based on register ( #1162 )
...
* Disable rendering of tag based on register
* Improvements to disable tag
* Resolve disbale tag tests
* Test disable_tags register
* disabled_tags is now always avaiable
* Allow multiple tags to be disabled at once
* Move disabled check to block_body
* Code improvements
* Remove redundant nil check
* Improve disabled tag error output
* Improve disable tag API
* Code improvements
* Switch disabled? to not mutate output
* Fix array handling shortcut in disable_tags
2019-09-26 00:18:30 +10:00
Mike Angell
b667bcb48b
Shopify stye guide fixes ( #1160 )
2019-09-20 02:08:11 +10:00
Mike Angell
ef13343591
Changes static registers to not be frozen ( #1163 )
...
* Changes static registers to not be frozen
* Add frozen test to static registers
2019-09-20 00:24:48 +10:00
Mike Angell
adb40c41b7
Enable frozen_string_literal
2019-09-18 13:40:07 +10:00
Mike Angell
d8403af515
Reimplementation of Static Registers ( #1157 )
2019-09-18 13:25:55 +10:00
Mike Angell
0d26f05bb8
Enabled frozen string literals ( #1154 )
...
* Enabled frozen string literals
* Update rubocop config
* Prefer string interpolation in simple cases
Co-Authored-By: Dylan Thacker-Smith <dylan.smith@shopify.com >
2019-09-18 13:19:45 +10:00