Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade 2x performant LiquidJS v9 #1058

Merged
merged 4 commits into from
Sep 4, 2020
Merged

Conversation

harttle
Copy link
Contributor

@harttle harttle commented Mar 29, 2020

There're substantial performance improvements in v9 and many bugfixes from v6 to v9. There're some API changes and some of them can be indicated in this PR:

  • inside custom tag implementation, engine.renderer.renderTemplates() can be used only in generator tags as you can see in addPairedShortcode(). The difference is subtle here but generator tags provides a major performance boost and provide code reuse between sync/async.
  • evalValue is now changed to async and another evalValueSync() is added for sync calls.
  • some methods (see the followingevalValue() in parseArguments()) are nolonger static.

A good thing I find is that for people using Liquid via setEngineLib() will not be affected.

Another thing is, the patch is automatically formatted by your git hooks, is it supposed to be this way or should I disable those hooks and re-submit? Thank you for you time!

@zachleat zachleat added this to the Eleventy v1.0.0 milestone Apr 1, 2020
@zachleat zachleat added on-hold breaking-change This will have to be included with a major version as it breaks backwards compatibility. labels Apr 1, 2020
@zachleat
Copy link
Member

zachleat commented Apr 1, 2020

Beautiful, thank you!

Are you saying this isn’t a breaking change for any of the template language syntax?

@zachleat
Copy link
Member

zachleat commented Apr 1, 2020

Fixes #469

@harttle
Copy link
Contributor Author

harttle commented Apr 1, 2020

Are you saying this isn’t a breaking change for any of the template language syntax?

For the template language syntax part. There should be no breaking changes except for some undocumented features (I mean some fault tolerance provided by LiquidJS but not by Shopify/liquid or Jekyll like #212). Additionally, the filters should be more robust after all these bug fixes.

For the Liquid API part, it's breaking. Many methods are changed to async and some are removed or replaced.

@aciccarello
Copy link

Updating Liquid would also update strftime used by the date filter. I was confused why the strftime docs didn't match what I was seeing.
harttle/liquidjs#77

@harttle
Copy link
Contributor Author

harttle commented Apr 19, 2020

@aciccarello Thank you to point it out. I've updated the doc for more specific description of strftime. Basically it should be conformant to Ruby's core DateTime#strftime. If there's still anything unexpected, feel free to open an issue on harttle/liquidjs.

@zachleat zachleat merged commit bb6ef86 into 11ty:master Sep 4, 2020
@zachleat
Copy link
Member

zachleat commented Sep 4, 2020

Shipping this! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change This will have to be included with a major version as it breaks backwards compatibility.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants