Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
5f6e8ed
detach destructures now
WorldSEnder Dec 29, 2021
b302a88
add failing keyed-list issue
WorldSEnder Jan 4, 2022
994a6db
crude port to the new bundle infrastructure
WorldSEnder Jan 5, 2022
38fb925
port over the infrastructure
WorldSEnder Jan 5, 2022
355e328
mass rename: apply -> reconcile
WorldSEnder Jan 5, 2022
35d7c2e
get rid of move_before in favor of shift
WorldSEnder Jan 5, 2022
d9bd30a
generate id directly when creating a new scope
WorldSEnder Jan 5, 2022
c843a2b
bundle for text nodes
WorldSEnder Jan 5, 2022
f576c36
work on naming: ancestor -> bundle
WorldSEnder Jan 5, 2022
751fed2
slightly optimize list reconciler, add doccomments
WorldSEnder Jan 6, 2022
749c078
address review
WorldSEnder Jan 12, 2022
cac9066
Merge remote-tracking branch 'upstream/master' into dom-bundle
WorldSEnder Jan 12, 2022
c357045
add internal documentation
WorldSEnder Jan 15, 2022
a95bf13
address review comments
WorldSEnder Jan 15, 2022
3563f39
move even more stuff into dom_bundle to scope exports
WorldSEnder Jan 15, 2022
c1a0b49
move replace into Reconcilable
WorldSEnder Jan 15, 2022
0ae4063
Merge remote-tracking branch 'upstream/master' into dom-bundle
WorldSEnder Jan 15, 2022
25a760c
move lifecycle and scope back into html as per review
WorldSEnder Jan 19, 2022
8704881
move back Value and InputFields into html
WorldSEnder Jan 19, 2022
02800d3
actually only type-check format args in production
WorldSEnder Jan 19, 2022
f28ebfe
fix documentation link
WorldSEnder Jan 19, 2022
a2a6b92
move btag_impl up into containing module
WorldSEnder Jan 19, 2022
1b446a6
shift comps immediately
WorldSEnder Jan 20, 2022
5339f49
Merge remote-tracking branch 'upstream/master' into dom-bundle
WorldSEnder Jan 21, 2022
e96bcec
use list-bundle in tag-bundle
WorldSEnder Jan 22, 2022
3dbc932
fix cargo make tests
WorldSEnder Jan 22, 2022
9ee4561
improve 05_swap benchmark
WorldSEnder Jan 26, 2022
b0a16e0
Merge remote-tracking branch 'upstream/master' into dom-bundle
WorldSEnder Jan 26, 2022
eca11f4
Merge remote-tracking branch 'upstream/master' into dom-bundle
WorldSEnder Jan 27, 2022
06e736b
Merge remote-tracking branch 'upstream/master' into dom-bundle
WorldSEnder Jan 28, 2022
c713027
fix a blunder where I swapped operands
WorldSEnder Jan 29, 2022
5010f34
Merge remote-tracking branch 'upstream/master' into dom-bundle
WorldSEnder Feb 20, 2022
02c7dd6
Merge remote-tracking branch 'upstream/master' into dom-bundle
WorldSEnder Feb 20, 2022
c1a7ba9
Merge branch 'master' into dom-bundle
WorldSEnder Mar 5, 2022
0678829
Merge remote-tracking branch 'upstream/master' into dom-bundle
WorldSEnder Mar 5, 2022
bea0708
fix naming of BNode variants
WorldSEnder Mar 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ dependencies = ["test"]
[tasks.test]
private = true
command = "cargo"
args = ["test", "--all-targets", "--workspace", "--exclude", "website-test"]
args = ["test", "--all-targets"]
Copy link
Member Author

Choose a reason for hiding this comment

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

This change should fix #2403 . As I understand it, tasks are inherited and run for all workspace members anyway, unless overwritten.


[tasks.doc-test-flow]
private = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
//! This module contains the `App` struct, which is used to bootstrap
Copy link
Member

Choose a reason for hiding this comment

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

How is this module related to dom_bundle?

Copy link
Member Author

Choose a reason for hiding this comment

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

dom_bundle contains state to keep when mounting to the DOM. I think it's just natural that the AppHandle is here, since it contains the state for a whole app - concretely the parent scope.

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine with keeping it here. If we support any platform other than web, then it'll have to but that's for the future.

//! a component in an isolated scope.
//! [AppHandle] contains the state Yew keeps to bootstrap a component in an isolated scope.

use std::ops::Deref;

use crate::html::{BaseComponent, NodeRef, Scope, Scoped};
use std::rc::Rc;
use super::{ComponentRenderState, Scoped};
use crate::html::{BaseComponent, Scope};
use crate::NodeRef;
use std::{ops::Deref, rc::Rc};
use web_sys::Element;

/// An instance of an application.
#[derive(Debug)]
pub struct AppHandle<COMP: BaseComponent> {
/// `Scope` holder
pub(crate) scope: Scope<COMP>,
scope: Scope<COMP>,
}

impl<COMP> AppHandle<COMP>
Expand All @@ -27,14 +26,17 @@ where
let app = Self {
scope: Scope::new(None),
};
let node_ref = NodeRef::default();
let initial_render_state =
ComponentRenderState::new(element, NodeRef::default(), &node_ref);
app.scope
.mount_in_place(element, NodeRef::default(), NodeRef::default(), props);
.mount_in_place(initial_render_state, node_ref, props);

app
}

/// Schedule the app for destruction
pub fn destroy(mut self) {
pub fn destroy(self) {
self.scope.destroy(false)
}
}
Expand Down
Loading