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 configuration to treat content as a slot #2108

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Sep 29, 2024

  1. Add configuration to treat content as a slot

    Like discussed many times before, this finally adds content as a slot to
    ViewComponent so that we can begin separating the block provided when
    rendering from content for performance and ergonomic reasons.
    
    This adds two new methods:
    
    * `content_is_a_slot!` - This makes the component _and its descendants_
      treat `content` as a slot, and the block provided to render calls _is
      always executed_.
    * `do_not_use_content_as_a_slot!` - This keeps the existing behavior
      where `content` is lazily evaluated and is used to return content.
    
    There's likely more implications from this change that need to be walked
    through (like how slots are used, and easily setting content) before
    this can be merged.
    BlakeWilliams committed Sep 29, 2024
    Configuration menu
    Copy the full SHA
    5abc33b View commit details
    Browse the repository at this point in the history