Closed (fixed)
Project:
Pinto: Native Components
Version:
1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Mar 2024 at 07:31 UTC
Updated:
4 Nov 2024 at 10:14 UTC
Jump to comment: Most recent
Comments
Comment #2
larowlanI wonder if we could add a property attribute e.g #[Theme\Variable] and put that on constructor Params and have the theme hook variables inferred
Between the constructor, a factory method, the theme definition and the build method, there's a lot of boilerplate around the variable names
I also wonder if the method that does the build could auto fill # keys from properties with attributes so if you don't need any logic these get passed through to the render array automatically
I can spin up a new issue (or two) for both those ideas if this isn't the best place for it
Comment #3
dpiThis sounds like an interesting idea.
New issue, though. This one isn’t quite it.
Comment #4
dpiComment #5
dpiThis bug was fixed with a workaround as a part of #3482094: Implement Slots. Definitions are now serialised to a string, so objects no longer enter Drupals' container.
A new factory unserialises definitions on request in a factory.
Comment #7
dpiTest coverage added in !11 — https://git.drupalcode.org/project/pinto/-/merge_requests/11