Mike Angell
cbea19b59f
Switch to aliasing methods
2019-08-31 20:32:07 +10:00
Mike Angell
0521d78b30
Initial concept
2019-08-30 14:29:07 +10:00
Samuel Doiron
34083c96d5
Merge pull request #1122 from Shopify/render-tag
...
Add new `{% render %}` tag
2019-08-29 16:49:56 -04:00
Samuel
9672ed5285
Add a new {% render %} tag
...
Example:
```
// the_count.liquid
{{ number }}! Ah ah ah.
// my_template.liquid
{% for number in range (1..3) %}
{% render "the_count", number: number %}
{% endfor %}
Output:
1! Ah ah ah.
2! Ah ah ah.
3! Ah ah ah.
```
The `render` tag is a more strict version of the `include` tag. It is
designed to isolate itself from the parent rendering context both by
creating a new scope (which does not inherit the parent scope) and by
only inheriting "static" registers.
Static registers are those that do not hold mutable state which could
affect rendering. This again helps `render`ed templates remain entirely
separate from their calling context.
Unlike `include`, `render` does not permit specifying the target
template using a variable, only a string literal. For example, this
means that `{% render my_dynamic_template %}` is invalid syntax. This
will make it possible to statically analyze the dependencies between
templates without making Turing angry.
Note that the `static_environment` of a rendered template is inherited, unlike
the scope and regular environment. This environment is immutable from within the
template.
An alternate syntax, which mimics the `{% include ... for %}` tag is
currently in design discussion.
2019-08-29 16:32:05 -04:00
Justin Li
f3112fc038
Merge pull request #1136 from ashmaroli/travis-selected-branches
...
Build only pushes to certain branches on Travis CI
2019-08-29 13:47:59 -04:00
Samuel
d338ccb9a6
Add isolated subcontexts
...
An isolated subcontext inherits the environment, filters,
and static registers of its supercontext, but with a fresh
(isolated) scope.
This will pave the way for adding the `render` tag, which renders
templates in such a subcontext.
2019-08-29 10:27:15 -04:00
Ashwin Maroli
b3097f143c
Build only pushes to certain branches on Travis CI
2019-08-28 21:28:49 +05:30
Mike Angell
7b309dc75d
Merge pull request #1135 from Shopify/fix-failing-rubocop
...
Resolve failing rubocop issues
2019-08-29 01:11:25 +10:00
Mike Angell
8f68cffdf1
Resolve failing rubocop issues
2019-08-29 00:45:38 +10:00
Mike Angell
dd27d0fd1d
Merge pull request #1133 from Shopify/liquid-tag-fixes
...
Bugfix for new Liquid tag
2019-08-29 00:36:13 +10:00
Mike Angell
7a26e6b3d8
Merge pull request #1131 from Shopify/bump-ruby-2-4
...
Rubocop upgrade, Ruby 2.4 minimum and TruffleRuby
2019-08-29 00:33:42 +10:00
Mike Angell
cf4e77ab0c
Merge branch 'master' into bump-ruby-2-4
2019-08-29 00:24:45 +10:00
Mike Angell
7bae55dd39
Bugfix for new Liquid tag
2019-08-28 23:39:19 +10:00
Tobias Lütke
0ce8aef229
Merge pull request #1103 from ashmaroli/ci-profile-memory
...
Add a CI job to profile memory usage of commit
2019-08-27 15:11:55 -04:00
Tobias Lütke
6eab595fae
Merge pull request #1086 from Shopify/liquid-tag
...
Add {% liquid %} and {% echo %} tags
2019-08-27 15:10:20 -04:00
Mike Angell
b16b109a80
Bump Minimum version to 2.4 and bump Rubocop
2019-08-28 00:31:44 +10:00
Justin Li
831355dfbd
Merge pull request #1117 from ashmaroli/reduce-allocations-template-lookup-class
...
Reduce allocations while registering Liquid tags
2019-08-07 16:37:39 -04:00
Ashwin Maroli
00702d8e63
Use Object.const_get directly
2019-08-07 11:44:53 +05:30
Justin Li
197c058208
Merge pull request #1099 from ashmaroli/stash-types-private-constant
...
Use a private constant to stash token-types
2019-08-06 17:56:56 -04:00
Justin Li
98dfe198e1
Merge pull request #1115 from ashmaroli/reduce-allocations-from-truncate-filters
...
Reduce string allocations from truncate filters
2019-08-06 17:48:43 -04:00
Ashwin Maroli
c2c1497ca8
Reduce allocations while registering Liquid tags
2019-07-22 20:42:37 +05:30
Ashwin Maroli
d19967a79d
Reduce string allocations from truncate filters
2019-07-22 17:35:45 +05:30
Florian Weingarten
248c54a386
Merge pull request #1091 from Shopify/rendering-with-less-garbage
...
Rendering with less garbage
2019-07-19 15:53:22 +01:00
Ashwin Maroli
2c42447659
Rename constant to SINGLE_TOKEN_EXPRESSION_TYPES
2019-05-17 23:30:24 +05:30
Ashwin Maroli
ab698191b9
Add a CI job to profile memory usage of commit
2019-05-17 22:47:05 +05:30
Ashwin Maroli
9ef6f9b642
Freeze mutable object assigned to constant
2019-04-29 23:50:49 +05:30
Ashwin Maroli
4684478e94
Use a private constant to stash token-types
2019-04-29 23:45:45 +05:30
Florian Weingarten
b3b63a683f
Merge pull request #1097 from ashmaroli/stackprof-no-jruby
...
Don't attempt to install stackprof gem on JRuby
2019-04-24 09:11:44 -04:00
Ashwin Maroli
1c577c5b62
Don't attempt to install stackprof gem on JRuby
2019-04-24 11:31:20 +05:30
David Cornu
755d2821f3
Merge pull request #1094 from Shopify/for-tag/invalid-limit-offset
...
Make sure the for tag's limit and offset are integers
2019-04-23 17:20:54 -04:00
David Cornu
495b3d312f
Merge pull request #1095 from Shopify/travis/remove-rainbow-gem
...
Stop installing the rainbow gem on Travis
2019-04-23 17:20:38 -04:00
Florian Weingarten
9640e77805
render_to_output_buffer
2019-04-23 17:06:29 -04:00
David Cornu
453f6348c2
Stop installing the rainbow gem on Travis
2019-04-23 16:55:37 -04:00
David Cornu
70ed1fc86d
Make sure the limit and offset values are integers
2019-04-23 16:44:37 -04:00
Florian Weingarten
2a1ca3152d
liquid without the garbage
2019-04-22 16:34:31 -04:00
Florian Weingarten
c2ef247be5
Merge pull request #1092 from Shopify/rake-memory-profiler-task
...
rake memory_profile:run
2019-04-22 16:33:32 -04:00
Florian Weingarten
1518d3f6f9
Merge pull request #1093 from Shopify/bytesize-not-length
...
use bytesize, not length
2019-04-18 18:39:21 +01:00
Florian Weingarten
c67b77709d
rake memory_profile:run
2019-04-17 19:09:26 +01:00
Florian Weingarten
c89ce9c2ed
use bytesize, not length
2019-04-17 18:55:13 +01:00
Justin Li
7dc488a73b
Simplifications from review
2019-04-09 15:19:47 -04:00
Justin Li
e6ed804ca5
Fix line number tracking after a non-empty blank token
2019-04-08 18:43:09 -04:00
Justin Li
951abb67ee
Remove {% local %} tag
2019-04-08 18:34:39 -04:00
Justin Li
8d1cd41453
Add {% liquid %}, {% echo %}, and {% local %} tags
2019-04-01 20:08:38 -04:00
Richard Monette
b0629f17f7
Merge pull request #1073 from Shopify/defer-alloc-hash
...
defer hash allocation until needed for unparsed_args
2019-03-20 13:34:48 -04:00
Richard Monette
274f078806
defer hash allocation in parse_filter_expressions
...
add exploration of GC object allocation
remove performance test
can actually remove one more if branch
use named locals to improve readability
2019-03-20 13:20:31 -04:00
Richard Monette
d7171aa084
Merge pull request #1077 from Shopify/update-cops-for-trailing-comma
...
update Rubocop for trailing comma styles
2019-03-19 16:02:26 -04:00
Richard Monette
06c4789dc5
update Rubocop for trailing comma styles
2019-03-19 11:05:05 -04:00
Justin Li
f2f467bdbc
v4.0.3
v4.0.3
2019-03-12 12:43:48 -04:00
Justin Li
ff99d92c18
Merge pull request #1072 from Shopify/fix-interrupts
...
Fix interrupts through includes
2019-03-12 12:26:12 -04:00
Justin Li
39fecd06db
Fix interrupts through includes
2019-03-12 12:18:22 -04:00