Commit graph

4368 commits

Author SHA1 Message Date
Evan Almloff
d795995e20
Create closure type; allow async event handlers in props; allow short hand event handlers (#2437)
* create closure type; allow async event handlers in props; allow shorthand event handlers

* test forwarding event handlers with the shorthand syntax

* fix clippy

* fix imports in spawn async doctest
2024-06-10 18:47:07 -07:00
Evan Almloff
79e18c2d62 fix hooks release build 2024-06-10 07:41:15 -05:00
nayo0513
689ac5433f
add popover api (#2498)
Co-authored-by: nayo0513 <nayo05130513@gmail.com>
2024-06-10 07:23:12 -05:00
igor
ae95e74b80
fix: Add missing name attribute for <slot> (#2494)
Fix #2493
2024-06-10 07:21:16 -05:00
Miles Murgaw
d6fc5dc5bd
feat: progress bar or println (#2489) 2024-06-07 17:29:55 -07:00
Evan Almloff
e4764f2bba
switch from slab to slotmap for tasks to fix that ABA problem (#2488) 2024-06-07 14:36:08 -07:00
Evan Almloff
5024139e01
Detect components called as functions (#2461)
* detect components called as functions
* use the existing component name information instead of a thread local
2024-06-07 13:55:10 -07:00
Evan Almloff
7efe4d0e49
Fix recursive copy while bundling (#2419) 2024-06-07 12:43:17 -07:00
Evan Almloff
a35436ee4f
Change ToRouteSegments to borrow self (#2283)
* Change display route segments to borrow the type

* fix formatting
2024-06-07 12:40:50 -07:00
Evan Almloff
0127501dbf
Improve inline docs (#2460)
Improve inline docs

* improve incorrect event handler return error message

* Improve event handler docs

* document the eval functions

* document spawn and common spawn errors

* fix event handler docs

* add notes about how you use attributes and elements in rsx

* add doc aliases for attributes and events we rename

* add some more aliases for common search terms

* don't doc ignore any public examples in core

* don't ignore public doc examples in ssr

* don't ignore examples in the dioxus package readme

* add a warning when you launch without a renderer enabled

* fix some outdated element docs

* add a bunch of examples to resource

* add notes about desktop events

* add more docs for use_resource

* add on_unimplemented hint to Dependency

* fix some unresolved links

* add examples to each of the router traits

* add not implemented errors for router traits

* add an example to the routable trait

* expand rsx macro docs

* improve memo docs

* update the dioxus readme

* mention dioxus crate features in the docs

* fix a bunch of doc tests

* fix html doc tests

* fix router doc tests

* fix dioxus signals doc tests

* fix dioxus ssr doc tests

* fix use_future example in the hooks cheat sheet

* add a javascript alias for eval

* fix hook explanation values

* remove unused embed-doc-image dependency
2024-06-06 18:15:17 -07:00
Evan Almloff
5494e38cf8
Fix event bubbling inside templates after a hot template reload (#2484) 2024-06-06 17:10:38 -07:00
Evan Almloff
b6cdcb4e7f
fix routers without an index route (#2477) 2024-06-06 17:03:59 -07:00
Evan Almloff
5e57779435
fix memo and resource caller information (#2443) 2024-06-06 17:01:42 -07:00
Evan Almloff
489758d5ba
remove value attribute in addition to resetting it (#2480) 2024-06-06 17:00:54 -07:00
Evan Almloff
e1044a2fa8 fix clippy 2024-06-06 15:34:52 -05:00
airblast
0eb16f27d4
chore: Remove unused dependency (#2466)
Removes the constcat dependeny from core-macro.
2024-05-31 07:06:55 -05:00
Drew Pirrone-Brusse
e1b0e0425a
Switch from an absolute ::dioxus to the relative dioxus_core (#2465) 2024-05-31 06:12:32 -05:00
Rafał Krzyważnia
54dbe6d074
Use RwLock::read in SyncStorage (#2463)
Replaces `RwLock::try_read` with `RwLock::read` in `SyncStorage`. This change prioritizes potential deadlocks over panics, as unwrapping a failed `try_read` is deemed less desirable.
2024-05-30 07:05:20 -05:00
Marc Espin
7d529cf39c
fix: Avoid cloning a provided context unnecessarily (#2458)
* fix: Avoid clonning a provided context unnecessarily

* remove another useless clone in use_context_provider

* fix formatting

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2024-05-29 08:53:21 -05:00
Evan Almloff
b3cd4fac10
set up example scaping for docs.rs (#2450) 2024-05-28 13:05:55 -07:00
Gino Valente
160cde7b48
Make use of #[doc] field attributes in Props derive macro (#2456)
* Support passing docs along to prop fields

* Pass along entire doc attribute
2024-05-28 11:33:51 -07:00
Evan Almloff
1eb90bf43a fix static site generation with child routers 2024-05-23 12:32:39 -05:00
ASR-ASU
9f670e1eb0
Fix value returned by get_scroll_size (#2445)
The scroll position was returned instead.
2024-05-23 11:12:47 -05:00
luveti
d3f96ec323
Improved fullstack reload_upon_connect timeout (#2436)
Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2024-05-22 07:35:07 -05:00
Evan Almloff
2523581cf4
Autocomplete rsx (#2421)
* autocomplete rsx

* hide the completions module

* fix autocomplete for identifiers that start with a raw identifier

* add field completion hints for props

* remove extra import

* Revert "add field completion hints for props"

This reverts commit 194899c737.

* fix autocomplete inside raw expressions

* fix autofmt

* feat: just use regular ifmt if it's compatible

reuses the tokens for ifmt so RA provides its HIR lowering on simple formatted strings

* fix merging ifmt strings

* add a better error message for components called like functions

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-05-22 07:24:50 -05:00
Evan Almloff
245003a5d4
Create a Static Site Generation platform; Deduplicate hot reloading code (#2226)
* create static site generation helpers in the router crate

* work on integrating static site generation into fullstack

* move ssg into a separate crate

* integrate ssg with the launch builder

* simplify ssg example

* fix static_routes for child routes

* move CLI hot reloading websocket code into dioxus-hot-reload

* fix some unused imports

* use the same hot reloading websocket code for fullstack

* fix fullstack hot reloading

* move cli hot reloading logic into the hot reload crate

* ssg example working with dx serve

* add more examples

* fix clippy

* fix formatting

* fix hot reload doctest imports

* fix axum imports

* don't run server doc tests

* Fix hot reload websocket doc examples
2024-05-22 07:24:15 -05:00
ASR-ASU
460b70e0f0
Add access to the Element attributes related to scrolling (#2338)
* Add access to the Element attributes related to scrolling

* Fix clippy warnings

* Restore interpreter/src/js/hash.txt content

* Update generated interpreter files

* Use euclid types as return types

* Remove redundant functions

* It's not necessary for PixelsSize to be in 3D

* Rename PixelsVector to PixelsVector3D and add a PixelsVector2D type

* Remove unused PixelsLength type
2024-05-21 12:56:49 -05:00
Sam Tay
e51d0d6983
Fix default launcher for web targets (#2431) 2024-05-20 06:55:12 -05:00
Andrew Voynov
e69c69abd7
chore(cli): optimized args handling for init & new (#2418) 2024-05-15 13:29:50 -05:00
Andrew Voynov
16313894da
feat(cli): init cmd can now skip user interaction (#2412)
Previously only `dx new` had this ability, now `dx init` has it, too.
2024-05-15 12:13:36 -05:00
Andrew Voynov
720899e19e
feat(cli): now user interaction can be skipped (#1872)
when creating a new project
2024-05-14 09:39:56 -05:00
Evan Almloff
40df088b7d
Make use_server_future accept FnMut (#2387) 2024-05-04 15:30:25 +01:00
Evan Almloff
5290b658fd
Fix effects triggered from async tasks; improve work scheduling docs (#2370)
* outline work scheduling

* move scheduling code from dirty_scope to scheduler

* introduce queue_effect

* Run effects after all tasks are polled if there are no components rerendered

* add a new test for async effects
2024-05-04 15:30:13 +01:00
Evan Almloff
05eaca320f fix empty docs clippy warning 2024-05-03 13:41:48 -05:00
Drew Pirrone-Brusse
010dcf9533
Improve the base_path story (#2381)
* Improve the base_path story

* allow base path routes without trailing slash

* remove note about trailing /

* fix clippy empty docs

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2024-05-03 13:38:07 -05:00
Wojciech Niedźwiedź
1b82ad4ddd
cli: disable opening the tab by default, add some trace logging for config resolution (#2377) 2024-05-01 08:32:04 -05:00
Evan Almloff
74352f2f61
Fix desktop effect race condition (#2313)
* don't poll desktop before the render has been applied

* fix desktop headless tests

* move edit queued code into the edit channel and add more comments
2024-04-26 12:52:33 -04:00
Jonathan Kelley
a0e06271dd
Fix: flaky CI by correcting autofmt to match proper spacing (#2369) 2024-04-26 12:04:56 -04:00
Evan Almloff
cbeda0af76
Refactor and fix eval channels (#2302)
* wip

* pull out eval into the interpreter

* fix web eval

* fix DioxusChannel name

* properly drop dioxus channel

* use typescript dioxus chanel in desktop

* add more comments to native eval

* add desktop headless eval tests

* expand web playwright eval tests

* fix web headless tests

* fix default hasher path

* run eval tests on windows

* restore desktop query drop code

* remove data from drop desktop query message

* catch syntax errors in desktop eval

* catch js runtime errors in desktop

* fix typo interprerter -> interpreter

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-04-26 11:55:48 -04:00
Evan Almloff
1d72ef16c4
Restore set compare hook (#2287)
* restore set compare hook

* fix use_set_compare doc example

* add a hook to compare a value with a set

* implement partialeq for SetCompare

* export the new hook

* fix the use_set_compare hook
2024-04-26 11:55:11 -04:00
Evan Almloff
fc2b441ee1
Fix memorization for the fragment component (#2360) 2024-04-26 00:48:06 -04:00
Evan Almloff
47c87568e1
Fix event handler memory leak (#2298)
* fix event handler memory leak and double drops

* Prevent double dropping generational boxes

* recycle instead of dropping
2024-04-26 00:47:22 -04:00
Evan Almloff
a27d4e71ed
Only compress web assets in the CLI (#2329)
* only compress web assets in the CLI

* precompressed -> pre-compressed

* only enable pre-compression in release builds
2024-04-26 00:47:04 -04:00
Chris Rogus
b147f5a737
impl HasFileData for FormData (#2346) 2024-04-25 14:31:50 -04:00
Evan Almloff
08da9a1253
Implement hash fragments in the router (#2320)
* implement hash fragments in the router

* clean up query and search example

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-04-25 14:30:25 -04:00
Evan Almloff
dd8e69635b
Fix calling server functions on desktop (#2357) 2024-04-25 14:24:46 -04:00
Evan Almloff
b30b363460
remove unused once-cell in memo (#2311) 2024-04-25 13:58:42 -04:00
Evan Almloff
cf6998b5ba
Warnings for signal writes that may cause infinite loops (#2277)
* warnings for signal writes that may cause infinite loops

* improve debugging output for reactive contexts on scopes

* expand help message
2024-04-25 13:58:25 -04:00
Evan Almloff
61360ea05f
extend the subscriber list instead of overriding it; fixes subscribers added in mark_dirty (#2319) 2024-04-25 13:57:46 -04:00
Evan Almloff
88f3558419
Fix reclaim element when hot reloading (#2361)
* Fix reclaim element when hot reloading

* Just disable headless tests on windows
2024-04-25 13:36:43 -04:00
Evan Almloff
39cef8fe42
fix out of order fields in route definitions (#2356) 2024-04-25 13:36:04 -04:00
Evan Almloff
6234f60b0e
Fix desktop drag events that don't have associated files (#2358) 2024-04-25 13:34:21 -04:00
Evan Almloff
72ef58b95e
Create use_muda_event_handler hook (#2367)
* create use_muda_event_handler hook

* fix use_muda_event_handler re-export
2024-04-25 13:32:34 -04:00
Jonathan Kelley
790b984e61
bump extension version 2024-04-24 22:41:31 -04:00
Alexander
1ec6819ac8
enables ability to turn off hot reloading (#2351) 2024-04-24 08:02:57 -05:00
Miles Murgaw
4e0c7940cc
revision: cli help docs (#2349) 2024-04-22 09:57:56 -05:00
alongdate
a5b4ceed39
chore: fix some typos in comments (#2340)
Signed-off-by: alongdate <alongyear@outlook.com>
2024-04-19 08:29:22 -05:00
Evan Almloff
5ce91e1bfc
Fix flakey windows tests (#2332) 2024-04-17 15:08:38 -07:00
Chung
c9ab09b348
fix path of set_server_url (#2314)
Co-authored-by: =Chung Wong <=wch705@gmail.com>
2024-04-16 09:18:50 -05:00
Marc Espin
b6d3da2b31
fix: Update use_resource docs (#2303)
* fix: Update `use_resource` docs

* Fix use_recourse docs; match ref instead of deref because WeatherLocation isn't copy

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2024-04-15 08:28:12 -05:00
Miles Murgaw
05b662ee2d
fix: cli spam when build (#2300) 2024-04-13 18:16:13 -05:00
Marc Espin
29f69fa145
fix: Update use_hook docs (#2296)
* fix: Update `use_hook` docs

* rust

* fixes
2024-04-11 15:43:58 -05:00
Matt Hunzinger
96b9baafff
Fix event handler drops (#2288)
* Try to fix event handler drops

* fix Option<EventHandler> parsing logic

* only move over props if both event handlers are some

* fix owner forwarding with props(extends)

* fix clippy

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2024-04-10 11:23:45 -05:00
Jonathan Kelley
994056e16d
Don't eat keys (#2280) 2024-04-08 22:31:58 -07:00
Jonathan Kelley
67af2d89dd
Autofmt nested rsx using syn::Visitor (#2279)
* Nested macros using visitor pattern
2024-04-08 22:15:52 -07:00
Jonathan Kelley
0b7c7701a3
fmt 2024-04-08 19:24:49 -07:00
Evan Almloff
af524d979b
Fix empty for loop, if statements and children (#2275)
* fix empty for loop, if statements and children

* fix clippy
2024-04-08 19:23:55 -07:00
Evan Almloff
40b576894f
fix the assets head path (#2267) 2024-04-08 19:23:11 -07:00
Evan Almloff
a012fb57ab
poll tasks in the same order they are queued (#2273) 2024-04-08 18:44:43 -07:00
Evan Almloff
26c109f661
fix volatile attributes (#2278) 2024-04-08 18:42:48 -07:00
Aron Puddy
c799168666
pass features thru to cargo on dx bundle (#2271) 2024-04-08 08:52:04 -05:00
Ahmet Kaan GÜMÜŞ
e03593cff7
docs: ✏️ unnecessary need to in global_context.rs (#2268) 2024-04-08 08:51:14 -05:00
Miles Murgaw
f4164c78c2
Fix: CLI Logging (#2254)
* fix: cli logging

* remove: debug print
2024-04-05 12:37:40 -07:00
Zan Pan
bd852c68fd
Use tracing::warn when the dioxus CLI is not used (#2250) 2024-04-05 12:36:05 -07:00
Zan Pan
fcbebbbf14
Use tracing::warn! instead of error! when assets not being preloaded (#2251)
* Use `tracing::warn!` instead of `error!` when assets not being preloaded

Currently, it emits a `tracing::error` when assets not being preloaded if the dioxus CLI was not used to build the application. It should be a warning since `cargo` can also build the application successfully.

* add more details to desktop preload warning

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2024-04-05 08:33:02 -05:00
Jonathan Kelley
7eccc7a104
Release 0.5.2
dioxus-cli@0.5.2
dioxus-fullstack@0.5.2

Generated by cargo-workspaces
2024-04-04 18:32:14 -07:00
Evan Almloff
c43bbe6aa5
fix the relative paths issue in the fullstack crates.io build (#2248) 2024-04-04 18:30:14 -07:00
Jonathan Kelley
9c5e5f969f
Release 0.5.1
dioxus@0.5.1
dioxus-autofmt@0.5.1
dioxus-check@0.5.1
dioxus-cli@0.5.1
dioxus-core@0.5.1
dioxus-core-macro@0.5.1
dioxus-desktop@0.5.1
dioxus-fullstack@0.5.1
dioxus-hooks@0.5.1
dioxus-html@0.5.1
dioxus-interpreter-js@0.5.1
dioxus-lib@0.5.1
dioxus-liveview@0.5.1
dioxus-mobile@0.5.1
dioxus-router-macro@0.5.1
dioxus-rsx@0.5.1
dioxus-signals@0.5.1
dioxus-ssr@0.5.1
dioxus-web@0.5.1
dioxus_server_macro@0.5.1
generational-box@0.5.1
rsx-rosetta@0.5.1

Generated by cargo-workspaces
2024-04-04 17:05:21 -07:00
Jonathan Kelley
702509cb7e
Fix recycling on component callbacks (#2247) 2024-04-04 16:48:06 -07:00
Jonathan Kelley
0a3291084f
Use a VecDequeue instead of a vec for bytes (#2246)
* Fix: add both the rAF queue and vecdequeue

* Fix: Take before recycle
2024-04-04 16:29:28 -07:00
Jonathan Kelley
633e2a70a4
Fix memory leak in owner (#2245)
* Fix: memory leak on listeners for elements

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2024-04-04 15:32:23 -07:00
Jonathan Kelley
44fe2defc2
Fix: memory leak on listeners for elements (#2244)
* Fix: memory leak on listeners for elements
* Recycle in manuallydrop

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2024-04-04 14:25:17 -07:00
Jonathan Kelley
6f3c5518ca
Feat: provide root context as method on virtualdom (#2243) 2024-04-04 12:00:06 -07:00
Jonathan Kelley
821a650f77
Fix: requeue events, process events (#2236)
* Fix: requeue events, process events

* Fix test: wait_for_work shouldn't wait 3 times when one update happens while rendering
2024-04-04 11:46:31 -07:00
Evan Almloff
4d25e3f6a2
fix hydration for non-bubbling events (#2234) 2024-04-04 11:46:22 -07:00
Jonathan Kelley
be99e29e5f
Fixes to autofmt, make it more aggressive (#2230)
* fix: fmt unterminated if, be more aggressive with line splits

* Fix: Handle long exprs in for/if statements
2024-04-03 15:27:36 -07:00
Russell Mull
46b0eeb12c
Implement the "Toggle Developer Tools" menu item in desktop (#2198) 2024-04-02 10:53:26 -07:00
Evan Almloff
11bf5ae34f
fix firefox refreshing loop in debug mode (#2214) 2024-04-02 10:52:40 -07:00
Evan Almloff
4c209e39fe
re-export generational box error types from the signals crate (#2212) 2024-04-02 10:52:27 -07:00
Evan Almloff
c8140c78b3
reuse placeholder and empty nodes on each thread to reduce allocation (#2217) 2024-04-02 10:52:16 -07:00
Evan Almloff
5df333fca2
fix and test spawn_forever (#2216) 2024-04-02 10:52:00 -07:00
Evan Almloff
947b23bda5
fix rendering aborted nodes in SSR (#2218) 2024-04-02 10:51:48 -07:00
Jonathan Kelley
aca38e6a34
Fix typo is style tag removal (#2220) 2024-04-01 16:01:44 -05:00
Marc Espin
7949fcda9a
chore: Clean up use_on_destroy docs (#2199)
* chore: Clean up `use_on_destroy` docs

* fmt
2024-04-01 09:20:04 -05:00
Evan Almloff
9f280a8d84
Fix child fields with the web history (#2172)
Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-03-29 18:23:28 -07:00
Evan Almloff
6a781af693
Fix hydration for static text nodes at the root of the template (#2184)
* Fix hydration for static text nodes at the root of the template

* fix clippy
2024-03-29 18:22:55 -07:00
Evan Almloff
4a622348f2
Fix the mobile feature on the dioxus crate (#2185) 2024-03-29 18:22:41 -07:00
David McNeil
d16ac4e736
Bump rfd to version 0.14 fixing 2149 (#2161) 2024-03-29 18:05:14 -07:00
Marko Lazić
cec6b92e42
Move dioxus_core::diff::node logs from info to trace #2165 (#2182)
Co-authored-by: Lazić <markolazic@protonmail.com>
2024-03-29 12:17:00 -05:00
Martijn Gribnau
862ec2680b
fix: Reflect that create command was renamed to new (#2174) 2024-03-29 08:34:57 -05:00