Commit graph

246 commits

Author SHA1 Message Date
Jonathan Kelley
e4cdb645aa feat: beaf up the use_state hook 2021-07-08 09:29:12 -04:00
Jonathan Kelley
7aec40d57e feat: enable arbitrary body in rsx! macro 2021-07-07 18:17:00 -04:00
Jonathan Kelley
fd7933561f chore: move CLI into its own "studio" app 2021-07-07 16:58:23 -04:00
Jonathan Kelley
98a09339fd wip: move some examples around 2021-07-07 16:19:10 -04:00
Jonathan Kelley
cca7c5fc3a wip: remove the scoped trait 2021-07-07 15:07:46 -04:00
Jonathan Kelley
36542b482f wip: move the functions around a bit 2021-07-07 14:37:31 -04:00
Jonathan Kelley
a38a81e129 wip: fix issues with lifetimes
this commit fixes some lifetime issues regarding having to "move" data into the IntoVNode closure.
2021-07-07 13:51:55 -04:00
Jonathan Kelley
22e659c2bd feat: namespaced attributes
this commit adds namespaced attributes. This lets us support attribute groups, and thus, inline styles.

This namespaced attribute stuff is only available for styles at the moment, though it theoretically could be enabled for any other attributes.
2021-07-06 23:04:33 -04:00
Jonathan Kelley
11f89e5d33 wip: more examples 2021-07-06 12:13:00 -04:00
Jonathan Kelley
904b26f711 feat: add edits back! and more webview support!
This commit adds a new type - the DomEdit - for serializing the changes made by the diffing machine. The architecture of how DomEdits fit into the cooperative scheduling is still TBD but it will allow us to build change lists without applying them immediately. This is more performant  and allows us to only render parts of the page at a time.

This commit also adds more infrastructure around webview. Dioxus can now run on the web, generate static pages, run in the desktop, and run on mobile, with a large part of thanks to webview.
2021-07-05 18:37:15 -04:00
Jonathan Kelley
e8f29a8f8a wip: enable more diffing 2021-07-05 01:11:49 -04:00
Jonathan Kelley
b5e5ef171a feat: two calculator examples 2021-07-02 15:48:19 -04:00
Jonathan Kelley
d9e6d0925b docs: examples 2021-07-02 01:30:52 -04:00
Jonathan Kelley
eb39b000d7 wip: example 2021-07-01 16:03:27 -04:00
Jonathan Kelley
952a91d540 wip 2021-07-01 14:14:59 -04:00
Jonathan Kelley
93900aac44 concept: integrate signals 2021-06-30 14:08:12 -04:00
Jonathan Kelley
7665f2c6cf feat: move to slotmap 2021-06-29 22:44:21 -04:00
Jonathan Kelley
21685fbb16 wip: more work on diffing 2021-06-28 22:22:11 -04:00
Jonathan Kelley
f4fb5bb454 feat: integrate serialization and string borrowing
This commit adds lifetimes to the diff and realdom methods so consumers may borrow the contents of the DOM for serialization or asynchronous modifications.
2021-06-28 12:05:17 -04:00
Jonathan Kelley
9813f23cdf wip: more work on diffing machine 2021-06-26 22:13:57 -04:00
Jonathan Kelley
ca3b80f069 wip: more work on diffing.
This commit is working on the diffing algorithm. We're *mostly* there but need to get fragments wired in and then keyed elements need to be re-implemented. For Dioxus core, this is the last major technical hurdle barring "fibers" (suspense) and attribute groups (inline styles).
2021-06-26 03:15:20 -04:00
Jonathan Kelley
895cc0142b wip: stack-based "real child iterator" 2021-06-26 03:06:29 -04:00
Jonathan Kelley
0826fdfee1 docs: more docs 2021-06-26 02:05:20 -04:00
Jonathan Kelley
ea91fc984d perf: refcell to cell for hookidx 2021-06-26 01:29:51 -04:00
Jonathan Kelley
81382e7044 chore: rename ctx to cx 2021-06-25 21:15:33 -04:00
Jonathan Kelley
daa9bd82c3 docs: more work on docs 2021-06-25 09:31:13 -04:00
Jonathan Kelley
7fbaf69cab Docs: more examples and docs 2021-06-24 11:09:38 -04:00
Jonathan Kelley
f5683a2346 wip: docs
Worked a bit on adding more examples. Trying out a new "antipattern" example to show how *not* to use Dioxus.
2021-06-23 22:32:54 -04:00
Jonathan Kelley
9d7ee79826 feat: events work again! 2021-06-23 01:44:48 -04:00
Jonathan Kelley
73047fe956 feat: props memoization is more powerful
This commit solves the memoization , properly memoizing properties that don't have any generic parameters. This is a rough heuristic to prevent non-static lifetimes from creeping into props and breaking our minual lifetime management.

Props that have a generic parameter are opted-out of the `partialeq` requirement and props *without* lifetimes must implement partialeq. We're going to leave manual disabling of memoization for future work.
2021-06-22 17:20:54 -04:00
Jonathan Kelley
7102fe5f98 docs: add some more sources in the core implementation 2021-06-21 01:35:12 -04:00
Jonathan Kelley
cff0547f1a wip: get diff compiling
Currently working through the normalization process. Occasionally, we want to iterate through all the nodes that we know have a real image in the dom. However, fragments and components don't directly have a mirror in the dom. This commit is exploring the concept of a custom iterator that explores every node in an array of nodes, returning only valid nodes which may be mounted to the dom. A big issue we're working through is heavily nested rootless nodes - something not terribly common but important nonetheless.

Inferno, React, and Preact all perform a mutative-form of normalization which alter the children list before comparing to the previous. Mostly, we're concerned about fragments in lists and heavily nested components that do not render real elements.
2021-06-21 00:52:37 -04:00
Jonathan Kelley
79127ea6cd wip: moving to IDs 2021-06-20 02:16:42 -04:00
Jonathan Kelley
45ee803609 wip: moving to imperative method of dom 2021-06-20 01:52:32 -04:00
Jonathan Kelley
62ae5d3bb9 wip: rethinking stack machine 2021-06-19 20:31:25 -04:00
Jonathan Kelley
70cd46dbb2 docs: move around examples 2021-06-17 18:00:32 -04:00
Jonathan Kelley
b9ff95fa12 wip: start moving events to rc<event> 2021-06-16 23:37:55 -04:00
Jonathan Kelley
9222d8ece3 docs: more docs on recoil 2021-06-16 13:47:41 -04:00
Jonathan Kelley
318cac9767 Feat: tweak docs for atoms 2021-06-16 13:42:12 -04:00
Jonathan Kelley
3bc02ee7c4 Feat: more docs 2021-06-16 11:25:47 -04:00
Jonathan Kelley
36ea39ae30 Feat: rename recoil to atoms 2021-06-16 11:19:37 -04:00
Jonathan Kelley
47e896038e wip: more work on updating syntad 2021-06-15 10:02:46 -04:00
Jonathan Kelley
517d7f1495 Chore: some cleanup and documentation 2021-06-10 01:01:53 -04:00
Jonathan Kelley
fe6938ceb3 wip: pre vnodes instead of vnode 2021-06-08 14:00:29 -04:00
Jonathan Kelley
e3d9db0847 wip: successfully building 2021-06-07 14:14:49 -04:00
Jonathan Kelley
7790750349 wip: merge in some code from the other branch 2021-06-05 23:47:54 -04:00
Jonathan Kelley
795a54a2e4 wip: new approach at direct access to vdom
This commit starts the process of merging scope arena
with the diff machine to give the diffing algorithm mutable
access to components. React and Preact mutate the dom
as they diff it which makes their implementations simpler
and cleaner. The goal here is to give access of scopes to
the diffing machine which can mutate the underyling
representation during diffing.
2021-06-05 23:38:51 -04:00
Jonathan Kelley
424a18137f Wip: pre-diffmachine merge fork 2021-06-03 13:57:41 -04:00
Jonathan Kelley
69f5cc3802 docs: move into a fromjs tutorial 2021-06-03 12:02:46 -04:00
Jonathan Kelley
50c8b93aad Feat: move the rsx macro around 2021-06-03 10:42:28 -04:00
Jonathan Kelley
1919f88f03 Feat: some docs 2021-06-02 11:07:30 -04:00
Jonathan Kelley
508c560320 Feat: massive changes to definition of components
This change switches back to the original `ctx<props>` syntax for
commponents. This lets lifetime elision to remove the need to match
exactly which lifetime (props or ctx) gets  carried to the output. As
such, `Props` is currently required to be static. It *is* possible to
loosen this restriction, and will be done in the future, though only
through adding metadata about the props through the Props derive
macro. Implementing the IS_STATIC trait is unsafe, so the derive macro
will do it through some heuristics.

For now, this unlocks sharing vnodes from parents to children, enabling
pass-thru components, fragments, portals, etc.
2021-06-01 18:33:15 -04:00
Jonathan Kelley
c1fd848f89 WIP: move to static props 2021-05-31 18:55:56 -04:00
Jonathan Kelley
c5089ba3c5 wip: more progress on parity docs.
Placeholders in the rsx macro for future features.
2021-05-28 12:56:21 -04:00
Jonathan Kelley
4d5c528b07 Feat: dirty hack to enable send + sync on virtual dom 2021-05-28 00:28:09 -04:00
Jonathan Kelley
fe67ff9fa4 wip: doesnt share on thread 2021-05-27 17:57:59 -04:00
Jonathan Kelley
ba975410f9 wip: parity document 2021-05-26 11:22:44 -04:00
Jonathan Kelley
ee67654f58 wip: recoil 2021-05-26 01:40:30 -04:00
Jonathan Kelley
3cfa1fe125 Feat: buff the readme and docs 2021-05-19 20:57:19 -04:00
Jonathan Kelley
b843dbd367 WIP: Todomvc in progress 2021-05-19 10:14:02 -04:00
Jonathan Kelley
0d44f009b0 Feat: introduce children for walking down the tree 2021-05-18 10:36:17 -04:00
Jonathan Kelley
24805a02f6 Feat: context api wired up 2021-05-18 01:16:43 -04:00
Jonathan Kelley
4c8130c4e4 Feat: about to consolidate context and scope 2021-05-17 17:59:10 -04:00
Jonathan Kelley
3de54d0b52 Feat: remove old code 2021-05-16 03:01:36 -04:00
Jonathan Kelley
2284b35782 Feat: abstraction lifetimes work out nicely 2021-05-16 02:58:57 -04:00
Jonathan Kelley
a99147c85b Feat: Clean up repo a bit 2021-05-16 02:55:16 -04:00
Jonathan Kelley
c28697e1fe Feat: some code health 2021-05-16 02:06:02 -04:00
Jonathan Kelley
9810feebf5 Feat: major overhaul to diffing 2021-05-15 12:03:08 -04:00
Jonathan Kelley
c809095124 Wip 2021-04-09 12:04:04 -04:00
Jonathan Kelley
2eeb8f2386 wip: refactor a bit 2021-04-04 21:47:53 -04:00
Jonathan Kelley
8c541f66d5 wip: todos 2021-04-01 21:44:18 -04:00
Jonathan Kelley
cfa0927cdd feat: todomvc 2021-04-01 00:01:42 -04:00
Jonathan Kelley
ce33031519 wip: todomvc 2021-03-29 12:31:47 -04:00
Jonathan Kelley
0bcff1f88e Feat: more ergonomics, more examples 2021-03-26 15:50:28 -04:00
Jonathan Kelley
44aad2746c Feat: use rsx! inline! 2021-03-26 00:47:15 -04:00
Jonathan Kelley
9f7f43b661 Feat: building large apps, revamp macro 2021-03-22 23:52:54 -04:00
Jonathan Kelley
5791e49700 wip: integrate 3d renderer components 2021-03-21 14:09:15 -04:00
Jonathan Kelley
742f150eb3 wip: begint to accept iterator types 2021-03-18 18:54:26 -04:00
Jonathan Kelley
f24d29130a wip: need iterator for bracketed children 2021-03-17 10:35:21 -04:00
Jonathan Kelley
9b560dfedb wip: more liveview and webview custom client 2021-03-16 14:28:54 -04:00
Jonathan Kelley
7856f2b153 wip: livehost bones 2021-03-16 11:03:59 -04:00
Jonathan Kelley
5b7887d76c Fix: some stuff related to event listeners. POC for lifecyel 2021-03-15 02:16:03 -04:00
Jonathan Kelley
4e48e0514e wip: diffing approach slightly broken 2021-03-14 20:33:37 -04:00
Jonathan Kelley
9d0727edab Feat: remove old macro 2021-03-13 19:11:06 -05:00
Jonathan Kelley
e66827ec92 wip: add deeply neste example 2021-03-13 10:02:57 -05:00
Jonathan Kelley
39bd1856f4 Feat: update examples 2021-03-12 17:21:06 -05:00
Jonathan Kelley
305ff919ef Feat: ensure mutabality is okay when not double-using the components 2021-03-12 16:58:30 -05:00
Jonathan Kelley
b3c96a5996 Feat: props now autoderives its own trait 2021-03-12 15:41:36 -05:00
Jonathan Kelley
d4f1ceaffb feat: somewhat working with rc and weak 2021-03-12 14:27:32 -05:00
Jonathan Kelley
ec801eab16 wip: foregin eq from comparapable comp type.
This commit adds the framework for "comparable components". This allows
complete sealing of bump-allocated properties types, and a comparison method
that performs a "safe" cast without transmute. This lets us completely erase types
but still be able to perform partialeq over render frames
2021-03-12 13:03:37 -05:00
Jonathan Kelley
5ad81885e4 wip: staticify? 2021-03-11 12:27:01 -05:00
Jonathan Kelley
78d093a945 FIx: cargo fix to clean up things 2021-03-10 19:42:31 -05:00
Jonathan Kelley
29751a4bab Feat: implement vcomp fully 2021-03-10 19:42:10 -05:00
Jonathan Kelley
5abda91892 Feat: add some docs 2021-03-10 19:24:45 -05:00
Jonathan Kelley
8fcd001677 Feat: update component so build passes 2021-03-09 14:46:00 -05:00
Jonathan Kelley
37f5a7ad33 Feat: wire up props macro 2021-03-09 14:45:52 -05:00
Jonathan Kelley
7158bc3575 Feat: revert FC changes (like the old style).
This commit reverts to the old style of props + FC. The old style is desirable
because people comfortable with react can automatically be comfortable with
dioxus. It's also nice in that the same props can be used to drive two different
components - something the trait version couldn't do. Now, our trait bound forces
implementations to have the #[derive(Props)] flag. This will need to implement the
Properties trait as well as PartialEq (using ptr::equal for closure fields).
2021-03-09 00:58:20 -05:00
Jonathan Kelley
92d9521a73 WIP: remove FC 2021-03-07 21:28:20 -05:00
Jonathan Kelley
3740f81383 WIP: still a bit stumped on DFS vs BFS 2021-03-05 15:02:36 -05:00
Jonathan Kelley
89f2290692 feat: dyn scope 2021-03-04 23:57:25 -05:00