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

liquidjs is out-of-date #1334

Closed
binyamin opened this issue Jul 28, 2020 · 10 comments
Closed

liquidjs is out-of-date #1334

binyamin opened this issue Jul 28, 2020 · 10 comments
Labels
bug: dependency A problem in one of Eleventy’s dependencies

Comments

@binyamin
Copy link
Member

binyamin commented Jul 28, 2020

I'm on 11ty 0.11.0, and the version of liquidjs has a bug (harttle/liquidjs#227) which has been fixed in v9.12.0. 11ty is still using v6.4.3. Please update it.

I tested liquid with and without eleventy. The bug is only present when using 11ty.

@muffinresearch
Copy link

FWIW, as a workaround you can add the more recent liquidjs version as a dep and set your own liquidjs instance as detailed here. https://www.11ty.dev/docs/languages/liquid/#optional-set-your-own-library-instance

@samuelpath
Copy link
Contributor

Same issue as #862 ?

@binyamin
Copy link
Member Author

binyamin commented Aug 7, 2020

@samuelpath I might be biased, but I think my issue describes the root problem more clearly. Should @barcia close their issue?

@binyamin binyamin added bug: dependency A problem in one of Eleventy’s dependencies and removed needs-triage labels Aug 12, 2020
@MaybeThisIsRu
Copy link

MaybeThisIsRu commented Aug 20, 2020

FWIW, as a workaround you can add the more recent liquidjs version as a dep and set your own liquidjs instance as detailed here. https://www.11ty.dev/docs/languages/liquid/#optional-set-your-own-library-instance

Does this break Eleventy in that it doesn't include templateContent or content with the collection items or page data any more?

I'll create a repo to check and report back, as I believe this is in fact happening.

Edit: Hmm, it doesn't.

@binyamin
Copy link
Member Author

binyamin commented Sep 6, 2020

Fixed in a37a5c6. Will be released in v1.0.0.

@sschuldenzucker
Copy link

Polite request to bump one more minor version to liquidjs-9.17.0 to include my patch that makes it much more feasible to use "strict" variables. (tell liquid to report an error for undefined variables)

This can be nice for people to catch errors during web dev. Particularly convenient when converting templates from other generators (like Jekyll), where variables may be named differently.

@binyamin
Copy link
Member Author

@sschuldenzucker can you make a PR?

@pdehaan
Copy link
Contributor

pdehaan commented Jan 22, 2021

LiquidJS is already updated to 9.x in master branch:

"liquidjs": "^9.16.1",

But is still on the older version in v0.11.x branch:

"liquidjs": "^6.4.3",

I don't imagine that 0.11.x will get updated to a newer version of LiquidJS, considering it's probably a very breaking change and there were a lot of plumbing changes needed (see #1058).

I'm not even sure if it's possible to update your existing 0.11 with liquidjs@9 using https://www.11ty.dev/docs/languages/liquid/#optional-set-your-own-library-instance docs. I know the 11ty docs are out of date w/ the new LiquidJS v9 API, but even if you changed that, I'm pretty sure there was something broken last time I tried to monkey patch the latest liquid into 11ty.

@Ryuno-Ki
Copy link
Contributor

I think, Zach reported that there will be no Liquid v9 in the 0.11.x branch somewhere.
For the same reason you listed here.

@sschuldenzucker Could you open a new issue to highlight the minor update on master branch?
I feel it could get lost otherwise.

@sschuldenzucker
Copy link

I'm not even sure if it's possible to update your existing 0.11 with liquidjs@9 using https://www.11ty.dev/docs/languages/liquid/#optional-set-your-own-library-instance docs. I know the 11ty docs are out of date w/ the new LiquidJS v9 API, but even if you changed that, I'm pretty sure there was something broken last time I tried to monkey patch the latest liquid into 11ty.

NB, I've done this. Using my limited javascript skills, it looks like this:

const liquidJs = require("liquidjs").Liquid
[...]
  let liquid_options = { // my options
    // extname: ".html",
    dynamicPartials: false,
    root: ["_includes"],
    strictFilters: true,
    strictVariables: true,
    lenientIf: true
  };
  eleventyConfig.setLibrary("liquid", new liquidJs(liquid_options))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: dependency A problem in one of Eleventy’s dependencies
Projects
None yet
Development

No branches or pull requests

7 participants