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

Split Treehouse lifecycle out of RedwoodView #2418

Merged
merged 4 commits into from
Oct 31, 2024

Conversation

swankjesse
Copy link
Collaborator

#2392


  • CHANGELOG.md's "Unreleased" section has been updated, if applicable.

@swankjesse
Copy link
Collaborator Author

My BIG INSIGHT in this PR is that everything works better if I expose content state two ways:

  • First as child components. So TreehouseViews can show loading spinners and sad-tab icons inline if that’s their thing.
  • ALSO as state. So TreehouseViews can also display that stuff outside of the content if that’s their thing.

All of my previous attempts were clumsy because they treated these two cases as symmetric.

@@ -425,7 +425,7 @@ private class RootProtocolNode<W : Any>(
}

override fun detach() {
children.detach()
// Do nothing because 'children' is owned by the host's TreehouseView.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The Redwood protocol doesn't strictly have to be used by Treehouse, although that is certainly the overwhelmingly common usage. Maybe put a note on the class docs up above, or on close().

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, good point. I should have said RedwoodView here instead.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh even better. I thought it was something specific to treehouse.

@swankjesse swankjesse enabled auto-merge (squash) October 31, 2024 14:58
@swankjesse swankjesse merged commit 0140f64 into trunk Oct 31, 2024
11 checks passed
@swankjesse swankjesse deleted the jwilson.1029.redwood_dynamic branch October 31, 2024 15:46
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.

3 participants