Commit graph

333 commits

Author SHA1 Message Date
Evan Almloff
90d0164b9e fix formatted strings in components 2024-01-16 12:47:23 -06:00
Jonathan Kelley
98bd78de43
Fix issue with mutability in component macro 2024-01-15 23:57:10 -08:00
Evan Almloff
af1749d7be re export renderers in dioxus 2024-01-15 19:14:11 -06:00
Evan Almloff
36e9eb1160 partially restore spreading attributes 2024-01-14 15:21:19 -06:00
Jonathan Kelley
1dde044697
remove cx.render 2024-01-13 21:12:21 -08:00
Jonathan Kelley
fae0b08e61
Fix the router and stub out a number of crates to get compiling 2024-01-13 20:51:37 -08:00
Jonathan Kelley
3f15612c8e
Fix remaining issues to get desktop running 2024-01-11 17:30:50 -08:00
Jonathan Kelley
2ae3241cc0
Merge branch 'master' into jk/breaking-merged 2024-01-11 16:04:36 -08:00
Evan Almloff
8d783490a0 fix the component macro when the function takes a single argument 2024-01-11 12:01:40 -06:00
Evan Almloff
404c864246 make the root component take no arguments 2024-01-11 10:48:04 -06:00
Jonathan Kelley
47805461d0
Dump skip(0) 2024-01-10 16:39:40 -08:00
Jonathan Kelley
2a7f3a4164
Fix: quick tweak to allow #[component] macro working 2024-01-10 16:38:07 -08:00
Evan Almloff
c59926cb1f remove IS_STATIC 2024-01-07 09:19:40 -06:00
Evan Almloff
58c01253e5 make EventHandler clone 2024-01-07 09:17:26 -06:00
Evan Almloff
5d842bad2b add the visit feature to syn in core-macro 2024-01-06 08:59:57 -06:00
Evan Almloff
e5df83ceec Merge branch 'master' into pr/atty303/1349 2024-01-06 08:52:37 -06:00
Evan Almloff
4013341b6c hello world example working 2024-01-05 18:01:05 -06:00
Hampus Lidin
8230566c4d
Add doc comment on generated inline properties struct (#1775) 2024-01-02 10:01:53 -06:00
Evan Almloff
a840e012d8 fix clippy 2023-11-29 11:46:18 -06:00
Evan Almloff
be94c69f11 make optional props accept T or Option<T> 2023-11-29 11:38:28 -06:00
Evan Almloff
355cd9b19e Merge branch 'master' into pr/atty303/1349 2023-11-20 18:37:33 -06:00
tigerros
d4b0451d09
Allow warning in necessary functions (#1626) 2023-11-09 12:31:59 -06:00
Lee TaeWoo
be1decf9f2
fix syntax error at derive Props using const generics (#1607) 2023-11-04 13:53:50 -05:00
Evan Almloff
46fec1ae48 fix clippy 2023-11-02 13:46:57 -05:00
tigerros
bf36fc6def
Fix #[component] expansion Clippy warning (#1599)
Adds a `#[allow(clippy::inline_always)]` attribute to the generated `__dx_inner_comp` function.
2023-11-01 08:14:07 -05:00
Evan Almloff
77d53df532 Merge branch 'master' into pr/atty303/1349 2023-10-31 13:39:20 -05:00
Jonathan Kelley
035f26d4bf
Merge pull request #1573 from tigerros/fix-props-docs-line-breaks
Fix prop docs line breaks
2023-10-25 17:03:46 -04:00
Leonard
33d4721fbe Fix 2023-10-24 00:10:56 +02:00
Jonathan Kelley
647815fa6f
Merge pull request #1558 from ealmloff/link-key-props
Add an readable error when you name a prop key
2023-10-23 16:58:53 -04:00
Leonard
cea9563e25
Improve prop docs (#1565)
* Do the stuff

* More sanitizing + fix warnings and format
2023-10-23 08:41:26 -05:00
Leonard
74952179db
Append prop documentation to function when using #[inline_props] or #[component] (#1563)
* Do the stuff

* Add deprecated warning and attribute list

Also move out methods that didn't take self as a parameter from `InlinePropsDeserializer`
2023-10-22 09:28:17 -05:00
Evan Almloff
42eb4b5098 fix clippy 2023-10-19 15:48:06 -05:00
Evan Almloff
ad9c59c2b4 add an readable error when you name a prop key 2023-10-19 13:23:58 -05:00
Leonard
2d1234c3d1
Include README and Dioxus logo in package docs (#1536)
* Include README in docs.rs and add Dioxus logo

* Update README.md
2023-10-10 10:52:48 -05:00
Evan Almloff
7f0fa07757 fix hot reloading 2023-10-04 09:11:21 -05:00
Leonard
06814dc17b
Update core-macro README per #1448 (#1510) 2023-10-03 06:59:53 -05:00
Evan Almloff
3e55bb8885 fix some clippy lints 2023-09-27 10:21:33 -05:00
Evan Almloff
ee25c03e74 fix some clippy lints 2023-09-27 10:13:45 -05:00
Evan Almloff
b60671e0fe fix non extending attributes 2023-09-27 10:02:49 -05:00
Evan Almloff
7b51bb8060 WIP: add extends to the props macro 2023-09-26 19:23:00 -05:00
Evan Almloff
56b1a0aefc add bump to props 2023-09-25 15:42:37 -05:00
Evan Almloff
7033276c34 Merge branch 'master' into pr/atty303/1349 2023-09-20 16:19:23 -05:00
Evan Almloff
fa494349fe add a lifetime to the properties trait and make the manual spread example work 2023-09-20 16:15:11 -05:00
Evan Almloff
dc446b5e5b fix extending an element 2023-09-19 16:38:27 -05:00
marc2332
7f8c963cd9
fix: Update doc links from v3 to v4 2023-09-16 19:03:27 +02:00
Leonard
c866ae602b
Add system for creating component attributes + new #[component] attribute (#1448)
* Add `#[component]` attribute + system for creating component attributes + other stuff

* Delete inlineprops.rs

* Update inline_props.rs

* Cargo fmt

* Fix clippy warnings and paths in props/mods.rs

* Include where clause in `#[inline_props]` output

* Allow Clippy type complexity in `LinkProps`

* Allow the type complexity lint for the entire link.rs file

* Remove snake_case -> PascalCase converter, but rather enforce PascalCase

Also:
- Put the second function inside the main one instead of besides it.
- Simplify

* Simplify type check lints so they don't return false positives

They will not always work, but they won't return any false positives, like for aliases. This is likely going to be replaced by a more polished Clippy-backed linting system.

* Fix #583

* Cargo fmt

* Add docs for `deserialize()` and remove useless comment

* Add `#[component]` to prelude

* Merge branch 'master' of https://github.com/tigerros/dioxus

* #[inline_props] is no more. Except in the docs folder, but that's going to be removed

* Remove docs folder

* Remove docs from workspace

* Resolve `DeserializerOutput` conversation
2023-09-15 09:13:36 -05:00
Jonathan Kelley
39e89c1fac
Bump crate versions, fix any publish errors 2023-07-31 18:49:54 -07:00
Jonathan Kelley
f0289068a2
Merge pull request #1219 from Demonthos/improve-build-times
Halve Build Times
2023-07-20 10:50:15 -07:00
Andrea Frigido
dccad58f1d Update license field following SPDX 2.1 license expression standard 2023-07-20 18:00:07 +01:00
Evan Almloff
212022d0c2 more clippy fixes 2023-07-19 13:54:10 -07:00
Evan Almloff
3d8d8a1b6f half-build-times 2023-07-19 10:19:23 -07:00
Jonathan Kelley
f62af4057f
Fix clippy lint 2023-07-14 13:22:08 -07:00
Jonathan Kelley
3b3020edd2
Make clippy ignore dumb lint 2023-07-14 13:13:33 -07:00
Marc Espín
32d4472bfd
fix: Remove duplicated doc links and improved some descriptions (#1167) 2023-07-08 11:04:27 -05:00
Torstein Grindvik
a3169ac17b Change missing trailing comma span to point to span where comma is missing from
Signed-off-by: Torstein Grindvik <torstein.grindvik@nordicsemi.no>
2023-07-02 15:19:03 +02:00
Evan Almloff
5f873511c5 use workspace dependancies 2023-06-19 14:29:11 -05:00
Evan Almloff
bfdcad6ede fix trait bounds on generics with inline_props 2023-03-01 20:41:49 -06:00
Jonathan Kelley
f664ce8fe0 Merge branch 'master' of github.com:DioxusLabs/dioxus 2023-02-22 13:06:41 -08:00
Jonathan Kelley
ab0023129d bump rsx 2023-02-22 12:22:45 -08:00
Evan Almloff
a51f67c2ec add version to docs links in readmes 2023-02-18 18:38:30 -06:00
Jon Kelley
4f0f2484fd
Merge pull request #774 from Demonthos/update-doc-links
Update guide doc links
2023-02-17 11:53:15 -08:00
Evan Almloff
b6c7d44a27 fix clippy 2023-01-27 20:35:46 -06:00
Jonathan Kelley
07447fd756 Fix 782 - inline props should use cx token 2023-01-17 15:50:04 -08:00
Evan Almloff
3f3db39c28 update doc links 2023-01-15 15:18:12 -06:00
Evan Almloff
52d5c8d4e7 update READMEs and tags for the 0.3 release 2023-01-10 10:16:11 -06:00
Jonathan Kelley
7f01f61138 feat: publish 0.3 versions of many crates 2023-01-04 14:31:07 -05:00
Jonathan Kelley
4fdbce9a70 chore: clean up readmes 2022-12-29 16:17:03 -05:00
Jonathan Kelley
e7e21fa2f0 fix: errors when using render macro 2022-12-23 17:47:57 -05:00
Jonathan Kelley
19eb12b8dd rollback: use default default 2022-12-19 20:25:21 -08:00
Jonathan Kelley
b254d9e761 chore: remove cross-crate doc comments 2022-12-09 15:03:56 -08:00
Jonathan Kelley
9c4abcbea0 wip: more tests! 2022-11-22 21:32:26 -08:00
Jonathan Kelley
642b21f125 suspense works in desktop 2022-11-16 11:48:47 -08:00
Jonathan Kelley
c6a6c3d0f8 feat: components pass thru children 2022-11-02 17:29:18 -07:00
Jonathan Kelley
4a31b29703 feat: simple tests passing 2022-11-01 18:42:29 -07:00
Demonthos
23c48cf795
render optimizations (#585) 2022-10-08 23:24:41 -07:00
Demonthos
daeffd4149
pass clippy (#575) 2022-10-02 14:12:24 -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
Jon Kelley
28fba42e7e
feat: add an unhygenic render macro (#556)
* feat: add an unhygenic render macro

* chore: use render instead of rsx!(cx,
2022-09-25 01:05:16 -07:00
Demonthos
baf1807338
allow duplicate idents in format_args_f (#515) 2022-08-10 22:45:56 -07:00
Jon Kelley
d9546d9504
Renderers are now packages, not features. (#387)
* feat: use synchronous router design

* feat: function to get router out of dom

* chore: restructure workspace to use renderers as packages, not features
2022-07-09 15:15:20 -04:00
Demonthos
4a5ae758ee
Allow Multiple dependencies for states in the RealDom (native core) (#412)
* WIP multable deps

* WIP: refactor and genralize state macro

* add traversable trait

* update tui to use elementid to index dom
2022-07-07 00:50:22 -04:00
Jonathan Kelley
2884d72b08 chore: make clippy happy 2022-07-02 23:45:32 -04:00
Evan Almloff
7730401288 fix escape sequences in ifmt 2022-06-28 12:19:07 -05:00
YuKun Liu
0af69f83f2 Rename hot_reload to hot-reload 2022-06-26 14:23:19 +08:00
Evan Almloff
dd335cda59 use line!, col!, and row! instead of panic location 2022-06-20 15:44:10 -05:00
Evan Almloff
9e7e5b0859 Merge remote-tracking branch 'upstream/master' into jk/rsx-refactor 2022-06-16 09:17:36 -05:00
Demonthos
df4ea20bb8 create serde compatible parse error 2022-06-15 12:58:08 -05:00
Evan Almloff
2a6d9ed075 handle rsx!{cx, ...} 2022-06-05 07:38:05 -05:00
Evan Almloff
8c6fceb0c7 finish desktop implementation 2022-06-04 14:26:37 -05:00
Evan Almloff
2bcaa2e43e refactor interperting macro into function and don't rely on cx being in scope 2022-06-04 12:20:56 -05:00
Muhannad Alrusayni
dded91a589 doc: put docs in once place instead of two 2022-06-04 13:40:50 +03:00
Muhannad Alrusayni
252f9343b8 fix: Support Div () as component
previously I from some reason I thought this not allowed syntax. Some test
failed because of my misunderstood, so now I fix this :D
2022-06-04 13:40:50 +03:00
Muhannad Alrusayni
03a14f4a86 fix: element start with lowercase letter again :D 2022-06-04 13:40:50 +03:00
Muhannad Alrusayni
062f986841 refactor: Remove unused types from scope 2022-06-04 13:40:50 +03:00
Muhannad Alrusayni
37f7fe2ac6 fix: Element must be of lowercase letters only 2022-06-04 13:40:50 +03:00
Muhannad Alrusayni
690efade88 fix: Support Input::<..> style to for generic components
before that, we accepted this style `Input<..>` but to be consistent
with Rust syntax this is dropped now.

> For reference, the two ways of specifying explicit type parameters in
> Rust are:
> // for functions
> let _ = foo::<MyType>();
>
> // for structs
> let _ = Foo::<MyType> { ... };
>
> by @jkelleyrtp
2022-06-04 13:40:50 +03:00
Muhannad Alrusayni
5b079075d7 refactor: clean up commented code. 2022-06-04 13:40:50 +03:00
Muhannad Alrusayni
0b5b7f09db feat: Support generic component with inline_props with some limitation 2022-06-04 13:40:50 +03:00
Muhannad Alrusayni
a55b56b403 feat: Support generic components in rsx!() macro 2022-06-04 13:40:50 +03:00
Evan Almloff
0079f7d18b WIP: expose pipe for desktop 2022-06-02 13:33:08 -05:00