Commit Graph
43 Commits
Author SHA1 Message Date
Jonathan Kelley fa9d92f956 Fix tests for autofmt 2024-01-10 22:41:40 -08:00
Jonathan Kelley d9b84f9f8f Disambiguate expressions in rsx by requiring curlies 2024-01-10 19:33:34 -08:00
Jonathan Kelley c1d9553e49 Merge pull request #1624 from Erithax/rename_into_node_traits
rename IntoDynNode and IntoTemplate traits
2024-01-04 10:25:49 -08:00
Jonathan Kelley 8df7a7685e Merge branch 'master' into many_optional_attributes 2024-01-04 10:18:57 -08:00
Erithax c2749b3371 rename IntoDynNode and IntoTemplate traits 2023-11-09 02:00:36 +01:00
Jonathan Kelley e819702fc5 Add into_vnode temporary logic for more things
This commit adjusts how rsx! works, making it more forgiving with signals.

Notably, we add the temporaries to if chains too.
2023-10-17 15:42:21 -07:00
Jonathan Kelley 14b3fa72e4 Change the semantics of exprs/for loops allocations strategy
This commit adjusts how exprs and for loops are handled within
rsx. This is a breaking change in terms of codegen, but has
slight semantic changes as well.

Now, when exprs/for loops are allocated, they are given a temporary.
The temporary is elided to the <'a> lifetime of the bump, to satisfy
the borrow checker. This fixes issues with signals where exprs/for
loops mapping vecs out of RefCells would be caught up without a
temporary lifetime.
2023-10-15 17:40:56 -07:00
Evan Almloff d297e2baa2 Add optional attributes 2023-09-18 19:50:02 -05:00
Evan Almloff 3d8d8a1b6f half-build-times 2023-07-19 10:19:23 -07:00
Evan Almloff 8f67d0aafd make creating rsx nodes from macros possible 2023-06-29 12:52:27 -07:00
Evan Almloff f74854b38c fix formatting with raw elements 2023-03-20 07:21:31 -05:00
Evan Almloff 209a55da69 allow raw elements if they include a dash 2023-03-19 20:37:40 -05:00
Jonathan Kelley 6cd87796f2 feat: allow ifchains and for loops 2023-01-13 10:51:12 -08:00
Evan Almloff a6c226ae57 fmt 2022-12-23 18:31:40 -06:00
Evan Almloff 555b192436 Merge branch 'upstream' into fix-hot-reloading 2022-12-23 18:06:47 -06:00
Evan Almloff e5a5850354 merge master 2022-12-20 20:48:28 -06:00
Jonathan Kelley 3fd08ef49e chore: remove unneeded files 2022-12-19 16:12:15 -08:00
Jonathan Kelley 09b38574db Merge branch 'master' into jk/autofmt-fixues 2022-12-19 12:19:51 -08:00
Evan Almloff 2131e5658b add hot reloading context trait 2022-12-10 14:09:59 -06:00
Jonathan Kelley 5673017def chore: clean up the repo some 2022-12-06 17:50:25 -08:00
Jonathan Kelley 3b166c9edd wip: clean up some things 2022-11-30 23:54:30 -05:00
Jonathan Kelley 6c677e64da chore: make for loops not the same 2022-11-17 22:55:46 -08:00
Jonathan Kelley c1c5821dcf Merge branch 'master' into jk/templates-v3 2022-11-16 22:12:16 -08:00
Jon Kelley 8ea61e1b3e feat: simple iterators and conditionals in rsx (#564)
* feat: simple iterators

* fix: into_iter

* feat: add support for unterminated conditionasl

* fix: add tempalte mapping for helpers
2022-11-16 22:10:50 -08:00
Jonathan Kelley 6b473cbdc5 feat: conditionals and iterators in rsx 2022-11-16 22:10:13 -08:00
Jonathan Kelley c6a6c3d0f8 feat: components pass thru children 2022-11-02 17:29:18 -07:00
Demonthos 047ed1e553 Subtree memorization / reactive templates (#488)
This commit adds subtree memoization to Dioxus.

Subtree memoization is basically a compile-time step that drastically 
reduces the amount of work the diffing engine needs to do at runtime by
extracting non-changing nodes out into a static "template." Templates 
are then understood by the various renderers in the ecosystem as a 
faster way of rendering the same items. 

For example, in the web, templates are simply a set of DOM Nodes created 
once and then cloned later. This is the same pattern frameworks like Lithtml
and SolidJS use to achieve near-perfect performance. 

Subtree memoization adds an additional level of complexity to Dioxus. The RSX
macro needs to be much smarter to identify changing/nonchanging nodes and
generate a mapping between the Template and its runtime counterparts.

This commit represents a working starter point for this work, adding support 
for templates for the web, desktop, liveview, ssr, and native-core renderers.
In the future we will try to shrink code generation, generally improve 
performance, and simplify our implementation.
2022-09-30 12:03:06 -07:00
Jonathan Kelley 181a51a63b wip: add whitespace parsing to rsx 2022-09-30 10:51:53 -07:00
Jonathan Kelley a37458b9fa chore: fixes to autoformat to prevent double rendering of expr line 2022-09-28 16:47:10 -07:00
Jon Kelley 38e8745db9 Remove lower case components that use the paran syntax (#551)
* chore: remove lowercase components

* chore: add docs are lowercase components

* docs: also add docs around lowercase components in current scope
2022-09-12 20:01:03 -07:00
Jonathan Kelley 30c1e702b3 fix: fmt 2022-07-02 22:49:19 -04:00
Jonathan Kelley a825cdcf58 feat: simple support for comments 2022-06-28 15:01:51 -04:00
Evan Almloff ffc9bf763a pass clippy 2022-06-17 13:50:41 -05:00
Evan Almloff 9e7e5b0859 Merge remote-tracking branch 'upstream/master' into jk/rsx-refactor 2022-06-16 09:17:36 -05:00
Evan Almloff 94448ea4aa handle formatting options 2022-05-30 18:32:57 -05:00
Evan Almloff 06390b9be5 allow rsx to be used outside of a proc_macro context 2022-05-28 12:10:32 -05:00
Evan Almloff a0c7e4d78a add component support 2022-05-27 09:47:44 -05:00
Jonathan Kelley 804d9af1c7 feat: improve autoformatting algorithm
- tons of new tests for various cases to be consistent
2022-04-26 18:45:08 -04:00
Jonathan Kelley 2a1970b3a9 feat: add prettyplease vendored and get basic test working 2022-04-24 02:55:20 -04:00
Jonathan Kelley 794f43ffee concept: move rsx out to its own crate 2022-04-24 02:35:52 -04:00
Ilya Maximov b8573bc4dd refactor: remove the rsx folder
it doesn't seem to be published anywhere or used at all
2022-03-19 20:35:53 +01:00
Jonathan Kelley 237f036a80 wip: add meta to rsx 2022-02-18 23:26:47 -05:00
Jonathan Kelley b93487282d feat: move files around 2022-02-18 20:54:30 -05:00