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
Add PageDrop to provide Liquid templates with data #7992
Conversation
Waste isn't necessarily bad, particularly when the method in question works and the way it works is the least surprising way for it to work.
Why is this bad? Why would memoizing it be better? How does a long running Jekyll instance with this data memoized affect the user experience? For the last question, I'm concerned mostly with what happens if the data underneath changes.
Again, on the surface, this doesn't necessarily seem like a bad idea. Why is resolving all content methods bad? |
@mattr- I think the best way to answer this is by adding a couple of tests involving a fixture site with lots of standalone pages. But, it needs to come in through the
Valid concern and a good one at that. I'll add a Cucumber test to check if there's a problem there |
How is this the best way? Just explain in a comment what you're actually doing with these changes and the motivation behind making them.
How is a test going to help here? |
The primary intention (and motivation) with this is to reduce memory usage in a site with numerous standalone pages. |
Perfect! This is exactly the background information I was looking for. 😄 Thanks! +1 from me. |
Co-Authored-By: Frank Taillandier <frank.taillandier@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for cohesiveness. What are the official plugins possibly impacted by this change?
This is a backwards-compatible change. However, should there be an effect, it would be in |
@jekyllbot: merge +minor |
Background
Currently
Jekyll::Page#to_liquid
is an unmemoized method that returns the Hash representation of a givenJekyll::Page
instance. The current approach is wasteful because:Proposed Solution
Liquid::Drop
subclass like other Core classes. (Memoizing the method might complicate it).Page
subclasses, alias existing implementation as aprivate
method which will be called if the subclass doesn't already override the:to_liquid
method.:to_liquid
definition to wrap theprivate
method:liquid_drop
: