Commit Graph
44 Commits
Author SHA1 Message Date
Evan AlmloffandJonathan Kelley a6c025c8ef Unify the warning system (#2649)
* unify the warning system

* fix VirtualDom::new warning with a component

* move warnings to dioxuslabs

* also allow writes in the component body when converting from T -> ReadOnlySignal<T>

* fix clippy from merge conflict

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-07-24 15:50:36 -07:00
Matt HunzingerandEvan Almloff d07e81005f Better expect error messages (#2629)
* Replace expect error messages

* Change message

* Create RuntimeError struct

* Pass error through core methods

* Fix use of Runtime::current in signals package

* Fix tests

* Add #[track_caller] for better error output and fix maybe_with_rt

* provide a help message along with RuntimeError

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2024-07-24 13:31:56 -05:00
88af3e7eff Hotreloading of for/if/body, formatted strings, literals, component props, nested rsx, light CLI rewrite, cli TUI (#2258)
Hotreload the contents of for loops, if chains, component bodies, props, attributes, and any literals discovered in rsx!
Add a TUI renderer to the CLI.
Improve the CLI build system to be async and parallel.
Refactor RSX to allow partial expansion of expressions.
Merge autofmt implementations for consistency.
Merge the representation of elements and components under the hood.
Add a diagnostics system for rsx for improved error messages.
Drop interprocess and move to websockets for communication between the CLI and the server.
Assign IDs to nodes and attributes in a stable way to be used in non compiler contexts.
Add hotreloading to any body of component/for loop/if chain/etc.

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
Co-authored-by: Liam Mitchell <liamkarlmitchell@gmail.com>
2024-07-17 19:11:18 -07:00
Evan Almloff 6320e00056 Convert closures into Option<Callback> automatcially (#2538)
* convert from a closure to Option<Callback> in props

* add a test for optional callback conversion
2024-06-18 16:39:35 -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 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 0662033c84 Fix early drop of eventhandlers (#2126)
* fix early drop of eventhandlers

* add a test for stale props that are memorized in place

* fix clippy
2024-03-22 14:37:02 -07:00
Jonathan Kelley 44e997f7df Fix eventhandler optional (#2119) 2024-03-20 09:04:37 -07:00
Jonathan Kelley 8f07d881a6 Switch todo!() to unreachable!/unimplemented! where it matters 2024-01-31 16:26:20 -08:00
Evan Almloff aa03a6316a remove Rc from the Component type alias 2024-01-30 12:29:47 -06:00
Evan Almloff 50e3216d8b convert T into signals automatically 2024-01-29 13:36:39 -06:00
Evan Almloff c3555a7ec0 fix Option<String> in props 2024-01-24 16:40:14 -06:00
Jonathan Kelley d8af9b7ed1 Fix compile checks on numerous packages using --all --all-features 2024-01-18 16:27:43 -08:00
Evan Almloff dab87c0144 try not double boxing 2024-01-17 15:07:45 -06:00
Jonathan Kelley fb4f97406c Fix router codegen 2024-01-16 15:48:37 -08:00
Jonathan Kelley 3fb7c359c2 Rename to component function 2024-01-16 15:09:44 -08:00
Jonathan Kelley c94af9538b Remove phantom markers and just default to Rc<dyn Fn(props) -> Element> where it makes sense 2024-01-16 15:07:22 -08:00
Evan Almloff e65c5f0eb3 depreciate the render macro 2024-01-16 13:18:46 -06:00
Evan Almloff ef553a2cb2 unbox component functions 2024-01-16 07:48:32 -06:00
Evan Almloff af1749d7be re export renderers in dioxus 2024-01-15 19:14:11 -06:00
Evan Almloff 69da70fd32 make diffing a bit more resilient 2024-01-11 17:21:38 -06:00
Evan Almloff 1034377a6f document ComponentFunction 2024-01-11 16:37:42 -06:00
Evan Almloff 598b557aee rename HasProps to ComponentFunction 2024-01-11 15:53:14 -06:00
Evan Almloff 7fe6e05da3 remove trybuild now that core is more safe 2024-01-11 15:21:13 -06:00
Evan Almloff a9d09d858b fix more errors in core tests 2024-01-11 12:40:36 -06:00
Evan Almloff bcbb647d02 fix constructing no argument components 2024-01-11 11:44:18 -06:00
Evan Almloff 1794debf79 fix components that take no arguments 2024-01-11 11:11:44 -06:00
Evan Almloff d1b9703ee7 fix release mode 2024-01-09 10:24:02 -06:00
Evan Almloff f42ef3ef9d remove more lifetimes 2024-01-05 08:39:22 -06:00
Evan Almloff 3ad16ddd37 rip out more lifetimes 2024-01-04 18:33:01 -06:00
Evan Almloff c9ff449e45 remove the bump allocator 2024-01-04 17:33:22 -06:00
Evan Almloff d559fdaeab fix borrowed props with temp values 2023-08-12 19:19:46 -05:00
Evan Almloff 80ac1a99af fix miri 2023-08-09 14:20:46 -07:00
Evan Almloff f91eeccca7 add compile test for unsound case 2023-08-09 10:49:47 -07:00
Jonathan Kelley cbd88bbcc3 Rip out async components 2023-07-14 16:15:20 -07:00
Jonathan Kelley 493591400f wip: pre any props 2022-11-19 17:07:29 -08:00
Jonathan Kelley c44bd11fe5 chore: more refactoring, docs 2022-11-11 18:29:27 -08:00
Jonathan Kelley 94601ccd1f feat: async components! 2022-11-03 17:34:42 -07:00
Jonathan Kelley c6a6c3d0f8 feat: components pass thru children 2022-11-02 17:29:18 -07:00
Jonathan Kelley 23603aaaf5 wip: rewrite core to be template focused 2022-10-27 21:58:47 -07:00
Jonathan Kelley 90982e0ccb wip: start to refactor out hot reloading from packages
Also implement alternative simpler template system
2022-10-20 09:56:09 -07:00
王一旋 2433b9d305 docs: examples of mistakes
docs: add hard_diff example missing parameter
2022-06-02 10:29:41 +08:00
Jonathan Kelley 62df5f7097 docs: document the entire core crate 2022-02-20 17:37:46 -05:00
Jonathan Kelley d84fc05386 feat: plug in bubbling 2022-01-03 02:06:42 -05:00