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

xilem_web: Allow DomFragment instead of DomView as app_logic #482

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

Philipp-M
Copy link
Contributor

@Philipp-M Philipp-M commented Aug 2, 2024

Should fix #461. This allows a ViewSequence (called DomFragment) of DomViews as root component.

The counter example is updated to show this new behavior.

@Philipp-M Philipp-M marked this pull request as ready for review August 5, 2024 11:41

pub(crate) struct AppMessage {
pub id_path: Rc<[ViewId]>,
pub body: DynMessage,
}

/// The type responsible for running your app.
pub struct App<T, V: DomView<T>, F: FnMut(&mut T) -> V>(Rc<RefCell<AppInner<T, V, F>>>);
pub struct App<State, Fragment: DomFragment<State>, InitFragment>(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure about the name InitFragment for the app_logic, I'm open for other suggestions, it's also related to this

@Philipp-M
Copy link
Contributor Author

This coincidentally also reduces a little bit of wasm bloat btw. :)

Copy link
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

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

Optimistic approval for Xilem web

@Philipp-M Philipp-M added this pull request to the merge queue Aug 5, 2024
Merged via the queue into linebender:main with commit bb13f1a Aug 5, 2024
16 checks passed
@Philipp-M Philipp-M deleted the xilem_web-root-dom-fragment branch August 5, 2024 13:09
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.

xilem_web: Is it possible for a update function to return two dom nodes without a parent contianer?
2 participants