-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rust_2018_idioms * Ccorrectly stringify self-closing tags in SSR * Rename render to create * Move render_* functions into sub-modules * Naive hydration * get_children utility * Add mapped and indexed placeholder * Allow effects to be FnMut (#103) * Allow effects to be FnMut * Only add -Dwarnings for clippy * Set CARGO_TERM_COLOR to always * map_indexed * Implement map_keyed * Add fast paths for map_keyed * Make TemplateResult recursive * Make map_* return closures * Refactor TemplateResult * Add a Lazy TemplateResult * Allow create_memo and create_selector to take FnMut * Fix unit tests * Change TemplateResultInner::Lazy to be FnMut * insert_expression node and lazy * Make most of the tests pass * Remove append_render * Make Lazy work * Fix reactivity * Make fragment template work * renconcile_fragments * Support TemplateResult in interpolation syntax * wip * wip * Push lazy TemplateResult to normalized * wip * wip * NodeId * Add renconcile tests * Add reconcile do not clone node test * Update wasm-bindgen to 0.2.74 in CI * Interpolation nested reactivity test * Remove Option from TemplateResultInner::Lazy type * cargo clippy * Append fragment nodes at the right location * wip * refactor * refactor * Fix map_keyed * Fix clippy * Remove unused NodeRef in TodoMVC example * Remove fragment from GenericNode * Remove Fragment from SsrNode * Refactor SsrNode::try_remove_child * Deprecate TemplateResult::flatten * Change Render to IntoTemplate * Refactor rendering of template fragments * Rewrite impl ToTokens for Element * Split up ToTokens in element.rs * Visitor pattern for Html nodes * TemplateVisitor * Insert components and interpolated values before a marker * Fix nested fragments * Lazy in fragment test * Fix DomNode::replace_child * Fix Indexed and Keyed * Fix iteration example * Fix reconcile * Pass the wasm test suite!!! * Fix the ssr test
- Loading branch information
Showing
33 changed files
with
1,935 additions
and
807 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,9 @@ jobs: | |
env: | ||
RUSTFLAGS: -Dwarnings | ||
|
||
env: | ||
RUSTFLAGS: -Dwarnings | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
authors = ["Luke Chu <37006668+lukechu10@users.noreply.github.com>"] | ||
edition = "2018" | ||
name = "iteration" | ||
publish = false | ||
version = "0.1.0" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
console_error_panic_hook = "0.1.6" | ||
console_log = "0.2.0" | ||
log = "0.4.14" | ||
maple-core = {path = "../../maple-core"} | ||
wasm-bindgen = "0.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<title>Hello World!</title> | ||
|
||
<style> | ||
body { | ||
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; | ||
} | ||
</style> | ||
</head> | ||
<body></body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use maple_core::prelude::*; | ||
|
||
#[component(App<G>)] | ||
fn app() -> TemplateResult<G> { | ||
let items = Signal::new(vec![ | ||
template! { "Hello!" }, | ||
template! { "I am an item in a fragment"}, | ||
]); | ||
|
||
let add_item = cloned!((items) => move |_| { | ||
items.set( | ||
(*items.get()) | ||
.clone() | ||
.into_iter() | ||
.chain(Some(template! { "New item" })) | ||
.collect(), | ||
); | ||
}); | ||
|
||
template! { | ||
div { | ||
button(on:click=add_item) { "Add item" } | ||
div(class="items") { | ||
(TemplateResult::new_fragment((*items.get()).clone())) | ||
} | ||
} | ||
} | ||
} | ||
|
||
fn main() { | ||
console_error_panic_hook::set_once(); | ||
console_log::init_with_level(log::Level::Debug).unwrap(); | ||
|
||
render(|| template! { App() }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.