Skip to content

Conversation

@23tux
Copy link

@23tux 23tux commented Oct 29, 2025

What are you trying to accomplish?

  • When a component renders a partial, it's block is evaluated in the context of the __vc_original_view_context
  • Because of this, inside of the block you don't have access to the component's instance

What approach did you choose and why?

I used a separate #capture for the partials block, so that it get's appended into a new OutputBuffer. This output is then caputured by the __vc_original_view_context

Anything you want to highlight for special attention from reviewers?

I'm not sure about performance here, as creating a separate OutputBuffer by using #capture is an overhead.

@markokajzer
Copy link

i can confirm this closes #2443 🎉

@Spone Spone requested a review from camertron November 11, 2025 20:36
@doits
Copy link

doits commented Nov 18, 2025

👍 This probably also makes methods and variables defined attr_accessor et al available inside the block. I was just about to create an issue about this then found #2443 and this PR, glad there's a solution waiting to be merged :-)

@camertron
Copy link
Contributor

Awesome, thanks for this @23tux ❤️ I believe main's tests are passing now, could you rebase and see if we can get a clean CI run on this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants