Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upUse rows for child slots #525
Conversation
natefaubion
added some commits
Apr 24, 2018
This comment has been minimized.
This comment has been minimized.
|
Looked at examples and it's great |
natefaubion
added some commits
Apr 25, 2018
This comment has been minimized.
This comment has been minimized.
|
I wonder if it's worth baking |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Also, |
This comment has been minimized.
This comment has been minimized.
|
If we can find a good solution to the lifecycle situation, we can just have the one constructor. That would be ideal. |
This comment has been minimized.
This comment has been minimized.
|
If nothing else, we could change the API so it's like #517 - it wasn't what you meant with the proposal for it, but doing would reduce the lifecycle handling aspects to one function at least. |
This comment has been minimized.
This comment has been minimized.
|
I think for now I'm going to remove the distinction and just have |
This comment has been minimized.
This comment has been minimized.
|
I think most of the example diffs are due to windows line endings |
natefaubion
added some commits
Apr 26, 2018
natefaubion
changed the title
WIP: Use rows for child slots
Use rows for child slots
Apr 26, 2018
This comment has been minimized.
This comment has been minimized.
|
I think this is ready for review. |
This comment has been minimized.
This comment has been minimized.
|
One thing that's neat about the rows approach is you can export a default slot constructor from your component module. From the display :: forall p f m r. Ord p => p -> Input -> H.ComponentHTML f (display :: Slot p | r) m
display slot i = HH.slot (SProxy :: SProxy "display") slot component i absurdWhich can be used in the render :: State -> H.ComponentHTML Query ChildSlots m
render state =
HH.div_
[ HH.ul_
[ Display.display 1 state
, Display.display 2 (state * 2)
, Display.display 3 (state * 3)
, Display.display 4 (state * 10)
, Display.display 5 (state * state)
]
... |
This comment has been minimized.
This comment has been minimized.
|
Bikeshed opportunity: order of type arguments. |
This comment has been minimized.
This comment has been minimized.
paulyoung
commented
May 11, 2018
|
This is amazing |
This comment has been minimized.
This comment has been minimized.
|
(re-)rendering child components always output "Duplicate slot address" warning. cond inverted? |
This comment has been minimized.
This comment has been minimized.
Yes, you're right. Thanks! |
This comment has been minimized.
This comment has been minimized.
paulyoung
commented
May 19, 2018
|
Is this likely to land any time soon? |
This comment has been minimized.
This comment has been minimized.
|
After 0.12 - I'll make a release with the minimal necessary updates for 0.12, and then shortly after a release with things like this and the reworked subscriptions. |
natefaubion commentedApr 24, 2018
•
edited
Fixes #439
This is still a WIP but is usable and ready for testing/review of the approach. This also fixes the issue where you can't rebind the output handler once the component is mounted. It should just work like normal handlers do.
I think we should remove the
Component/Parentdistinction for HTML and DSL now. The only difference now will be that leaf components/html just have()as their slot type. We can also provideabsurdSlot :: forall a b. ComponentSlot () a -> b