Commit graph

413 commits

Author SHA1 Message Date
Greg Johnston
a7da8232a7 I was wrong -- these will be automatically disposed by the parent scope in the correct order, and actually shouldn't be done manually 2022-12-10 14:06:18 -05:00
Jose Quesada
a5f868915a added trait for converting impl AsRef<web_sys::Element> to HtmlElement<AnyElement> 2022-12-10 12:16:08 -06:00
Jose Quesada
237bacc2da addressed all clippy lints 2022-12-10 10:50:01 -06:00
Jose Quesada
11720302a2 addressed all clippy lints for web targets 2022-12-10 09:54:49 -06:00
Jose Quesada
e097ec84c2 started addressing clippy lints and fixed an undiscovered bug 2022-12-10 08:40:24 -06:00
Greg Johnston
a7c16c9b09 Implement PartialEq and Eq for View 2022-12-10 07:37:07 -05:00
Greg Johnston
1b8db4d4f4 "Implement Clone on View and its affiliates. Necessary for <Transition/> and some routing features. No significant changes needed, every type involved could already derive Clone. 2022-12-09 22:17:26 -05:00
Jose Quesada
dd16890021 Component now creating child scope, forgot about this 2022-12-09 18:58:38 -06:00
Jose Quesada
a17651fe02 removed the workspace override 2022-12-09 18:00:06 -06:00
Jose Quesada
094492f076 impl IntoChild for tuples up to 26 in size 2022-12-09 17:13:37 -06:00
Jose Quesada
6d5994f72e removed TopoId 2022-12-09 17:08:11 -06:00
Jose Quesada
641a064200 removed IntoEach until we can come up with a better game plan 2022-12-09 17:04:32 -06:00
Jose Quesada
c83f29be1b fix DynChild saving it's old child, rather than the new one 2022-12-09 16:46:02 -06:00
Jose Quesada
bd3cc0b5ec fix DynChild trying to render old child rather than new one 2022-12-09 16:17:37 -06:00
Jose Quesada
1ee9c2432b impl IntoView for tuples of up to 26 fields as well as for (Scope, T) 2022-12-09 11:29:46 -06:00
Jose Quesada
b0c27c48f6 updated example to work with new Each 2022-12-09 10:49:15 -06:00
Jose Quesada
c74a8274f2 removed child scope creation within Each 2022-12-09 10:44:05 -06:00
Jose Quesada
2ceb7f8934 fixed Fragment which would try mounting it's children while hydrating 2022-12-09 10:03:08 -06:00
Jose Quesada
16af593277 added render_to_string entry point and fixed bug where id counter would not be reset on every server render call 2022-12-09 09:34:25 -06:00
Jose Quesada
51c8d85528 custom user id's on HtmlElement is now supported during hydration 2022-12-09 09:15:37 -06:00
Jose Quesada
4ffc53a1dc not panicking when elements/components cannot be found 2022-12-09 08:47:53 -06:00
Jose Quesada
b7eeba77a0 fixed DynChild on release to prevent it merging with surrounding text 2022-12-09 08:25:39 -06:00
Jose Quesada
a8fb2720b9 removed a sneaky c that was in the SSR id generation for components, as well as fixed an extra id call count that wasn't supposed to be there 2022-12-08 22:40:49 -06:00
Jose Quesada
a50f1c58f7 fixed Each optimizations 2022-12-08 20:38:59 -06:00
Jose Quesada
6528aadb90 removed debug statement 2022-12-08 19:18:23 -06:00
Jose Quesada
dcd9842fca Merge branch 'leptos_dom_v2' of https://github.com/jquesada2016/leptos into leptos_dom_v2 2022-12-08 18:42:55 -06:00
Jose Quesada
5a976525c0 fixed Each moving items it did not need to move 2022-12-08 18:42:36 -06:00
Greg Johnston
eb40f9f7c7 Remove leptos_dom/ssr dependencies 2022-12-08 19:32:46 -05:00
Greg Johnston
d0fa9b89bf Remove my logs 2022-12-08 19:25:50 -05:00
Jose Quesada
21716ea59d fixed panic on DynChild for double taking an option 2022-12-08 18:15:57 -06:00
Jose Quesada
e641108ed3 fixed error compiling 2022-12-08 18:01:06 -06:00
Jose Quesada
c3b4945c7e removed all cfgs that depend on anything but web and wasm32 2022-12-08 17:56:52 -06:00
Jose Quesada
95c535290d Merge branch 'leptos_dom_v2' of https://github.com/jquesada2016/leptos into leptos_dom_v2 2022-12-08 17:48:45 -06:00
Jose Quesada
6af0b1a8ed hydration is now determained at runtime startup 2022-12-08 17:48:30 -06:00
Greg Johnston
9928abf36d Fix closing-node creation in Each in release 2022-12-08 18:45:27 -05:00
Greg Johnston
135317b7b8 Method, not a field 2022-12-08 18:26:44 -05:00
Jose Quesada
6b24135070 fixed subtle bug when hydrating from a text node would cause DynChild to not unmount correctly 2022-12-08 17:00:55 -06:00
Jose Quesada
e08808c2ab fixed SSR compilation errors 2022-12-08 16:13:12 -06:00
Jose Quesada
a932f72a4f DynChild now creating child scopes 2022-12-08 16:07:44 -06:00
Jose Quesada
75befde788 now creating child scopes for Each 2022-12-08 15:17:12 -06:00
Jose Quesada
adac34790e now creating child scopes for Each items, still not cleaning them up, however 2022-12-08 11:50:22 -06:00
Jose Quesada
838d0d27c9 fixed DynChild not removing the text generated on SSR 2022-12-08 11:10:34 -06:00
Jose Quesada
d29d29c1d4 fixed .into_view(cx) calling order to match between SSR and CSR 2022-12-08 10:41:28 -06:00
Jose Quesada
61e206c227 corrected DynChild to now mount children on SSR 2022-12-08 09:19:00 -06:00
Greg Johnston
45395fe580 Fix off-by-one issue 2022-12-07 15:46:09 -05:00
Jose Quesada
3a90ed6c21 added debug aids to find the off-by-one error 2022-12-07 12:33:39 -06:00
Jose Quesada
55b691e1b0 marker hydration fixed, but we have an off-by-one error on id generation 2022-12-07 12:05:12 -06:00
Jose Quesada
c9b57ffa85 changed the value to bind to another input while I fix text 2022-12-07 10:43:10 -06:00
Jose Quesada
c239716170 updated the example to work with hydartion 2022-12-07 10:04:54 -06:00
Jose Quesada
46ef1bcf5d initial impl of eager hydration 2022-12-07 09:36:36 -06:00
Jose Quesada
5ac06251d4 Merge branch 'leptos_dom_v2' of https://github.com/jquesada2016/leptos into leptos_dom_v2 2022-12-07 07:24:53 -06:00
Jose Quesada
395cfe6bf1 fixed SSR and CSR cfg features 2022-12-07 07:24:35 -06:00
Greg Johnston
963ff85a5f Get basic SSR example working 2022-12-06 23:04:48 -05:00
Greg Johnston
dcbdbc8925 <template/> doesn't work as a self-closing tag 2022-12-06 23:03:33 -05:00
Jose Quesada
c290d1e9d6 started impl hydration for HtmlElement 2022-12-06 20:14:35 -06:00
Jose Quesada
51e5c6ba62 fixed TopoId not having a sum field 2022-12-06 11:35:31 -06:00
Jose Quesada
ee470b37bb removed starting_offset when calculating children ids 2022-12-06 10:26:19 -06:00
Jose Quesada
74c716e0f6 fixed attrs that start with an empty value from not having a space 2022-12-06 10:12:14 -06:00
Jose Quesada
00c25b5605 fixed EachItem not getting <template /> markers, as well as Unit 2022-12-06 09:55:02 -06:00
Jose Quesada
280f7a7735 removed cx param from all helper methods 2022-12-06 07:32:49 -06:00
Jose Quesada
f02405b649 fixed IntoProperty from disconnection from overwritten Scope 2022-12-06 07:24:21 -06:00
Jose Quesada
d6ef65daf6 fixed IntoClass from not disconnecting from overwritten Scope 2022-12-06 07:21:14 -06:00
Jose Quesada
98414ac192 removed overzelus use of Scope in Attribute 2022-12-06 07:15:39 -06:00
Jose Quesada
8b7728096a fixed IntoChild to not disconnect from overwritten Scope 2022-12-05 20:51:00 -06:00
Greg Johnston
aec289e384 Get SSR benchmarks running again 2022-12-05 20:34:29 -05:00
Greg Johnston
432eda8d6d Add some often-used helper functions 2022-12-05 20:00:27 -05:00
Greg Johnston
aa10ab861a Fix new cx-passing API for Attribute 2022-12-05 16:09:22 -05:00
Greg Johnston
166df8d4c4 Merge changes to remove cx everywhere 2022-12-05 16:05:12 -05:00
Greg Johnston
666269539d Merge branch 'leptos_dom_v2' of https://github.com/jquesada2016/leptos into leptos_dom_v2 2022-12-05 16:04:54 -05:00
Greg Johnston
0230b1ffa5 Deal w/ merge issues and get SSR working 2022-12-05 16:04:02 -05:00
Jose Quesada
3dd789f0c2 fixed IntoAttribute from disconnecting from it's overwritten Scope 2022-12-05 14:30:21 -06:00
Greg Johnston
dbb0fca1cb Merge branch 'leptos_dom_v2' of https://github.com/jquesada2016/leptos into leptos_dom_v2 2022-12-05 15:12:09 -05:00
Greg Johnston
b8bd3bef13 Merge branch 'leptos_dom_v2' of https://github.com/jquesada2016/leptos into leptos_dom_v2 2022-12-05 15:11:17 -05:00
Jose Quesada
59f753cebb impl all the macro helper traits for (Scope, T) 2022-12-05 14:09:39 -06:00
Greg Johnston
d5f91e67a5 First pass at SSR 2022-12-05 15:09:04 -05:00
Greg Johnston
1b854ed787 Warn if you re-set a NodeRef 2022-12-05 14:24:33 -05:00
Jose Quesada
13f8006162 added HtmlElement::node_ref 2022-12-05 13:19:34 -06:00
Jose Quesada
b3d813d0c1 renamed IntoNode to IntoView and Node to View, and fixed broken doc links 2022-12-05 12:39:42 -06:00
Jose Quesada
1fbe8bd790 fixed the example to show undelegated 2022-12-05 12:28:14 -06:00
Jose Quesada
eba8af3b38 fixed event names and removed superfluous debug stmt 2022-12-05 12:23:53 -06:00
Jose Quesada
589f2585cc added small list of events that don't bubble 2022-12-05 11:43:18 -06:00
Jose Quesada
b69119f11f added all events I could find 2022-12-05 11:12:31 -06:00
Greg Johnston
f893dca39b This should handle the disposal correctly, when the parent scope disposes, instead of on Drop (which is immediate.) 2022-12-05 09:24:52 -05:00
Greg Johnston
2ef8032110 The event names shouldn't actually start with "on" — that's the HTML attribute form 2022-12-04 23:03:54 -05:00
Greg Johnston
3992febbfc Restored these events so they can be used, just typed as Event 2022-12-04 23:03:19 -05:00
Jose Quesada
18ff334f70 disabled non-existant web_sys event types 2022-12-04 21:38:23 -06:00
Jose Quesada
d2b4ae30d1 Merge branch 'leptos_dom_v2' of https://github.com/jquesada2016/leptos into leptos_dom_v2 2022-12-04 21:30:55 -06:00
Jose Quesada
abed797027 added HtmlElement::prop to the builder 2022-12-04 21:30:48 -06:00
Greg Johnston
a4ca863d42 Should insert the actual event type instead of MouseEvent! 2022-12-04 22:26:28 -05:00
Jose Quesada
6737413103 made Undelegated inner field public so users can just wrap any event with it to force it undelegated 2022-12-04 21:23:16 -06:00
Greg Johnston
33c3851d5b Fix fake assignment 2022-12-04 22:13:07 -05:00
Greg Johnston
7c298272d3 Merge branch 'leptos_dom_v2' of https://github.com/jquesada2016/leptos into leptos_dom_v2 2022-12-04 22:11:00 -05:00
Greg Johnston
71a2a24d09 Working components in view! macro 2022-12-04 22:10:56 -05:00
Jose Quesada
cffdc56062 added Custom event helper type for events not included 2022-12-04 20:45:58 -06:00
Jose Quesada
c29c15e1b7 removed on_delegated, as this can be done through Delegated<E>` type 2022-12-04 20:36:18 -06:00
Jose Quesada
fe417d50af Merge branch 'leptos_dom_v2' of https://github.com/jquesada2016/leptos into leptos_dom_v2 2022-12-04 17:22:24 -06:00
Jose Quesada
cc538f8427 added more events 2022-12-04 17:22:03 -06:00
Jose Quesada
07db7ae62b started the grooling process of adding typed events 2022-12-04 09:13:20 -06:00
Greg Johnston
09d2a56672 Merge branch 'leptos_dom_v2' of https://github.com/jquesada2016/leptos into leptos_dom_v2 2022-12-03 21:29:22 -05:00
Greg Johnston
8ea7e20dfb Builder-compatible view! macro 2022-12-03 21:28:39 -05:00
Greg Johnston
02c982c80f Missing cfg causing non-CSR builds to break; I may have removed this accidentally or somethign 2022-12-03 21:27:53 -05:00
Jose Quesada
a5b157f14f uncommented (presumably) accidental comment of components import 2022-12-03 17:58:51 -06:00
Jose Quesada
5d439ceee8 fixed merge conflict 2022-12-03 16:52:57 -06:00
Jose Quesada
282ece2fab fixed Each when moving to take into account backshift 2022-12-03 16:50:29 -06:00
Greg Johnston
205abd4cbc Add _prop macro helper 2022-12-03 14:47:39 -05:00
Greg Johnston
fbb372e618 Add is_server and is_dev helper macros 2022-12-03 14:47:31 -05:00
Greg Johnston
b4679ea688 Fix NodeRef on stable 2022-12-03 14:28:33 -05:00
Greg Johnston
d2f68d8a0a Add helpers for simple logging 2022-12-03 14:22:19 -05:00
Greg Johnston
ebe872ca57 Add NodeRef 2022-12-03 14:21:42 -05:00
Greg Johnston
bce1ed8d67 Add NodeRef 2022-12-03 14:21:36 -05:00
Greg Johnston
a87ffd6d5c Make it possible for macro to specify event types automatically by reducing to one generic 2022-12-03 14:20:18 -05:00
Greg Johnston
c0d2dde53a _class helper for macro 2022-12-03 14:05:59 -05:00
Greg Johnston
cd93ecb5ab Merge branch 'leptos_dom_v2' of https://github.com/jquesada2016/leptos into leptos_dom_v2 2022-12-03 13:43:14 -05:00
Greg Johnston
4beee7f924 Fix bounds check -- was panicking on remove because added_delta was -1 2022-12-03 13:43:05 -05:00
Jose Quesada
234260a784 Merge branch 'leptos_dom_v2' of https://github.com/jquesada2016/leptos into leptos_dom_v2 2022-12-03 12:29:45 -06:00
Jose Quesada
e82d4d492b revert EachItem lazy text fill 2022-12-03 12:29:28 -06:00
Greg Johnston
aa0271a493 Add _attr helper for macro 2022-12-03 13:06:15 -05:00
Greg Johnston
29db252411 Remove fill_if_text since eager now 2022-12-03 13:06:06 -05:00
Jose Quesada
aa5caaf4f1 Merge branch 'leptos_dom_v2' of https://github.com/jquesada2016/leptos into leptos_dom_v2 2022-12-03 10:38:47 -06:00
Jose Quesada
718b5f8ae1 forgot to fill child text nodes of EachItem 2022-12-03 10:34:36 -06:00
Greg Johnston
48e4e01e24 Fast path for Text -> Text. I think this is probably broken at the moment (if you replace Text with something else) but can fix 2022-12-03 11:29:53 -05:00
Greg Johnston
7948a1914a Fill Text node eagerly 2022-12-03 10:54:38 -05:00
Greg Johnston
1fa023ee08 Merge branch 'leptos_dom_v2' of https://github.com/jquesada2016/leptos into leptos_dom_v2 2022-12-03 10:35:58 -05:00
Greg Johnston
cc1c264548 ._child() helper for macro (merges child and dyn_child) 2022-12-03 10:34:27 -05:00
Jose Quesada
11960efb1b impl Deref<Target = web_sys::HtmlElement> for HtmlElement<El>` 2022-12-03 08:45:29 -06:00
Jose Quesada
16706233c7 fixed Each move requiring backshifting all items 2022-12-02 21:17:27 -06:00
Jose Quesada
c49ed49580 refactored a bit and left the premise for fixing Move in Each 2022-12-01 23:14:30 -06:00
Greg Johnston
a0e0194475 FxHashSet uses a faster hashing algorithm than the default SipHash 2022-12-01 17:22:35 -05:00
Greg Johnston
d266943a8f id isn't necessary in the browser version, right? 2022-12-01 17:22:05 -05:00
Jose Quesada
86acd8a461 now reusing text nodes 2022-12-01 14:31:47 -06:00
Jose Quesada
786b7abcb7 fixed Each opts to handle more edge casses 2022-12-01 07:58:28 -06:00
Jose Quesada
05adbda4ca fixed panic when trying to get parent node 2022-11-30 20:31:09 -06:00
Jose Quesada
6db59d526f fixed panic when dropping components 2022-11-30 20:12:13 -06:00
Jose Quesada
0149ce1be1 removed need for 2 marker nodes 2022-11-30 13:29:51 -06:00
Jose Quesada
b058e68e4e addressed errors and clippy lints 2022-11-30 09:01:16 -06:00
Greg Johnston
0ef0417b5a Separate SSR + browser implementations, with eager creation in browser (+ string interning) 2022-11-29 22:15:27 -05:00
Jose Quesada
649378ffbe now using Range only for potentially large groups of nodes 2022-11-29 20:08:54 -06:00
Jose Quesada
060f8d7a6a usine clone_node on cached nodes 2022-11-29 17:00:42 -06:00
Jose Quesada
b8c125cd14 initial impl of eager builder 2022-11-29 16:50:52 -06:00
Jose Quesada
33afcf6b17 impl eager setting of attr 2022-11-29 15:49:32 -06:00
Jose Quesada
bbb188d2f6 added some more small opts, including using only a single Range obj 2022-11-29 13:44:03 -06:00
Jose Quesada
d8f8673ad3 tuned append opt to include the limit 2022-11-29 13:11:00 -06:00
Jose Quesada
a73c71842a added Each append opt 2022-11-29 12:49:46 -06:00
Jose Quesada
d59ce5aebf fixed replace all items opt 2022-11-29 12:01:19 -06:00
Jose Quesada
5b14aa98e9 Comment markers are now being created by cloning a reference 2022-11-29 11:15:29 -06:00
Jose Quesada
f78400a955 fixed merge conflict 2022-11-29 07:44:47 -06:00
Jose Quesada
488856fdcc removed broken debug assertions 2022-11-29 07:37:33 -06:00
Greg Johnston
42659e20cd Fast path for clearing 2022-11-28 21:51:23 -05:00
Greg Johnston
54b7b780c8 (Some of?) these debug assertions seem to break the release build 2022-11-28 21:37:47 -05:00
Jose Quesada
a638c3d39a removed superfluous console::log 2022-11-28 19:13:46 -06:00