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

Add SGML#fragment for marking selective rendering blocks #842

Merged
merged 7 commits into from
Feb 4, 2025

Conversation

willcosgrove
Copy link
Contributor

@willcosgrove willcosgrove commented Feb 3, 2025

  • Implement SGML#fragment method
  • Support fragments inside of a cached block

@willcosgrove willcosgrove changed the title Initial run at explicit selective rendering idea from #841 Add SGML#fragment for marking selective rendering blocks Feb 3, 2025
@willcosgrove willcosgrove force-pushed the explicit-selective-rendering branch from baae289 to 6548252 Compare February 3, 2025 21:51
@willcosgrove willcosgrove force-pushed the explicit-selective-rendering branch from 6548252 to bc9d346 Compare February 3, 2025 22:34
attr_reader :fragments, :fragment_depth, :view_context

def target_fragments(fragments)
@fragments = fragments.to_h { |it| [it, true].freeze }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let’s just use a set here unless there’s a big performance impact.

Comment on lines 180 to 184
def fragment(name)
@_context.begin_target(name)
yield
@_context.end_target(name)
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should return nil.

@willcosgrove willcosgrove marked this pull request as ready for review February 4, 2025 22:58
@willcosgrove willcosgrove merged commit abd53a6 into main Feb 4, 2025
11 checks passed
@willcosgrove willcosgrove deleted the explicit-selective-rendering branch February 4, 2025 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants