Skip to content

Upgrade to Liquid v4 #4362

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

Merged
merged 15 commits into from
Jan 27, 2017
Merged

Upgrade to Liquid v4 #4362

merged 15 commits into from
Jan 27, 2017

Conversation

parkr
Copy link
Member

@parkr parkr commented Jan 16, 2016

RC1 for now.

@fw42 @dylanahsmith, know what's going on here? .parse isn't working like before.

Error:
TestTags#test_: highlight tag in unsafe mode should recognize the hl_linenos option and its value. :
NoMethodError: undefined method `line_number' for {}:Hash
    /Users/parkr/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/liquid-4.0.0.rc1/lib/liquid/tag.rb:21:in `initialize'
    /Users/parkr/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/liquid-4.0.0.rc1/lib/liquid/block.rb:4:in `initialize'
    /Users/parkr/jekyll/jekyll/lib/jekyll/tags/highlight.rb:14:in `initialize'
    /Users/parkr/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/liquid-4.0.0.rc1/lib/liquid/tag.rb:9:in `new'
    /Users/parkr/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/liquid-4.0.0.rc1/lib/liquid/tag.rb:9:in `parse'
    test/test_tags.rb:46:in `highlight_block_with_opts'
    test/test_tags.rb:92:in `block (2 levels) in <class:TestTags>'
    /Users/parkr/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/shoulda-context-1.2.1/lib/shoulda/context/context.rb:413:in `instance_exec'
    /Users/parkr/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/shoulda-context-1.2.1/lib/shoulda/context/context.rb:413:in `block in create_test_from_should_hash'

@parkr parkr added this to the 3.2 milestone Jan 16, 2016
@dylanahsmith
Copy link

Jekyll::Tags::HighlightBlock.parse('highlight', options_string, ["test", "{% endhighlight %}", "\n"], {})
passes in a list of tokens into a Tag, but we now use a tokenizer which also keeps track of the current line number during parsing.

This could be worked around by using Liquid::Tokenizer.new("test{% endhighlight %}\n"), but the tests would still be brittle to internal liquid changes, so it is recommended to parse a complete template using Liquid::Template rather than constructing individual tags with mocked out data.

@envygeeks
Copy link
Contributor

Would this affect normal everyday plugins @dylanahsmith ?

@parkr
Copy link
Member Author

parkr commented Jan 16, 2016

it is recommended to parse a complete template using Liquid::Template rather than constructing individual tags with mocked out data.

👍

Would this affect normal everyday plugins

This looks like it's only in our tests where this is going to be an issue. Most plugins don't use this Tag.parse method directly, I think only our tests do that.

@parkr
Copy link
Member Author

parkr commented Mar 23, 2016

@dylanahsmith Our tests depend on having access to the instance created. I gave it a shot with Liquid::Template.parse but gave up after about 30 minutes of looking through the Liquid code.

It looks like v4 works (CI works fine for me locally). Would you consider releasing a new version soon and we can upgrade?

@parkr
Copy link
Member Author

parkr commented Aug 30, 2016

@dylanahsmith @fw42 @pushrax Hi! Would it be possible to reconsider a 4.0 release? Especially keen to get the whitespace change out to our users. Thanks!

@fw42
Copy link
Contributor

fw42 commented Aug 30, 2016

I'm ok with releasing a new version of Liquid. As far as I know, there isn't any pending non-backwards compatible changes that we want to get in before a new release. @pushrax @dylanahsmith, thoughts?

@dylanahsmith
Copy link

version ⬆️ 👍

@pushrax
Copy link

pushrax commented Sep 1, 2016

Also 🆗 from me

@DirtyF
Copy link
Member

DirtyF commented Sep 13, 2016

@fw42
Copy link
Contributor

fw42 commented Sep 13, 2016

Yea I just released 4.0rc versions of both Liquid and Liquid-C. @parkr, can you see if everything works on your end? If so, I can release a real non-rc release.

@parkr
Copy link
Member Author

parkr commented Sep 16, 2016

Interesting –– all of our where_exp tests fail.

@parkr
Copy link
Member Author

parkr commented Oct 19, 2016

Looks like things are working here. I'd be interested in getting this into a v3.4, though I have concerns about what incompatibilities for plugin authors.

@Crunch09
Copy link
Member

@parkr I think the only public API thing we changed was to add Jekyll::Drop::SiteDrop#key?. Do you know of any liquid-related plugins so we could check them out before?

Also if you think we're ok, we could give @fw42 a go to release 4.0 non-rc 🎆

@parkr
Copy link
Member Author

parkr commented Nov 29, 2016

@fw42 If this CI passes, then feel free to release v4.0 of Liquid. ❤️

@pathawks pathawks mentioned this pull request Dec 22, 2016
@DirtyF DirtyF mentioned this pull request Jan 10, 2017
@JamesDrummond
Copy link

When will this PR be merged? Patiently waiting for liquid 4.0 features ;) . Also I was trying to find where you list when the next release and ship date is planned for.

@parkr
Copy link
Member Author

parkr commented Jan 10, 2017

I think we'll try to ship a 3.4 this week, with a 3.5 a bit after that.

@parkr
Copy link
Member Author

parkr commented Jan 16, 2017

Fixes #5772.

@parkr parkr modified the milestones: 3.4, 3.5 Jan 16, 2017
@keslert
Copy link

keslert commented Jan 24, 2017

Any update on this? Waiting not quite as patiently as @JamesDrummond ;).

@Crunch09
Copy link
Member

@keslert It is planned to be released in jekyll 3.5. Jekyll 3.4 should be out this week, so it probably will be merged in afterwards.

@parkr
Copy link
Member Author

parkr commented Jan 27, 2017

@jekyllbot: merge +minor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.