Where can I learn more about taking advantage of Liquid 2.0?

Where can I learn more about taking advantage of Liquid 2.0?
And specifically, what do we need to test for when we turn it on for our live sites?

Thanks,
Shannon

Hi @shannonlynd,

My understanding is that there is little difference between the two, other than a performance boost when using Liquid 2.0 (and of course the benefit that it’s bundled with Nice 2.0, which is better)

The one case where there may be a difference is when you’re passing data between scopes. I think @Adam.Wilson described it well in a previous discussion on the topic:

In most general cases Liquid 1.0 will work the same as 2.0, but it’s quite different in that 1.0 kinda processed ‘upscope’ while 2.0 goes ‘downscope’ (well that’s how I think of it anyway).
In 1.0 we could pass Liquid variables ‘up’ from a page content area into the head of a template for example. Whereas 2.0 works more like BC did, where variables are passed ‘down’ from template to page - which is more practical I think, but there were cool advantages of it being the other way too.
There are surely many other technical differences in the implementation, but that’s the most prominent difference I think in terms of developing with it.

Also there is the possibility for recursion:

Because 2.0 goes ‘downscope’, putting {{this}} on the page level causes a recursion (using it in the template level is fine though).
So I’m guessing {{this}} will be off limits for use on pages/items, unless they can put some kind of block on the recursion or something???

I would love to hear from the treepl devs @Eugene or @vlad.z if there are any other differences/benefits we should be mindful of.

2 Likes

Hi @Alex_B_Centrifuge @shannonlynd
I’m working on two articles.
The first one describes the difference between liquid 1.0 and 2.0 and the aspects of implementation that should be tested and/or changed.
The second one is on the difference between the logic with Advanced payment flow enabled/disabled.

Also, there will be small guides that will help you apply required changes to the implementation in order to transit smoothly from old logic (when flags are turned off) to the new one (when flags are turned on).

1 Like

@vlad.z Great. I’m glad to see this. I think it will be a great help for everybody.

Advanced Payment Flow article:
https://docs.treepl.co/extras/migrating-to-advanced-payment-flow

Liquid 1.0 to 2.0 article:
https://docs.treepl.co/extras/migrating-from-liquid-version-1-to-2

1 Like