dioxus
dioxus copied to clipboard
DX questions
I'm familiar with React/Vue and tried to develop a fullstack app using Dioxus recently. idk if the following blocker I've met is general enough but I'd like to bring them out here:
- fullstack app conflicts: SSR + Router can conflict with static resources (e.g., public/some.js) in some cases
- insufficient hooks documentation: I tried to find sth. like useCallback and component lifecycle, but after successfully finding them (usecallback & onload), there's no doc about their usage and possible gotchas
- starter/boilerplate template inconsistency: I tried to run the fullstack/ssr examples under the corresponding workspaces but some of them cannot compile on my m2 mac
- DX(dev experience): IMHO the point of fullstack is to make seamless FE and BE integrations, but rn there's no watch cmd to spontaneously build web and server sides, and the socket sometimes close unexpectedly causing the browser tab to hang, so I have to 0) compile Tailwind 1) build the web 2) build the server 3) open a new tab each time when I make a subtle change in the UI
disclaimer: I'm not a professional FE engineer -- specialized at database...I want to get some advice on how to ramp up with Dioxus and may be contributing to it in the future, but rn there are so many blockers.
WebSocket connection to 'ws://localhost:8080/_dioxus/ws' failed:
I'm familiar with React/Vue and tried to develop a fullstack app using Dioxus recently. idk if the following blocker I've met is general enough but I'd like to bring them out here:
- fullstack app conflicts: SSR + Router can conflict with static resources (e.g., public/some.js) in some cases
I haven't encountered that issue before. If you are serving two resources on the exact same route they may conflict. There isn't much dioxus can do about that other than log a warning. If you are getting conflicts with different routes like a page at /hello conflicting with a resource at /public/script.js that sounds like a bug. More details in a separate issue would be helpful to track down the source of the problem.
If you are linking to an asset in your cargo.toml, you might be running into https://github.com/DioxusLabs/dioxus/issues/1171. The git version of dioxus provides a better way to link to local assets with a macro that will automatically be picked up and optimized by the CLI without that issue. Here is an example
- insufficient hooks documentation: I tried to find sth. like useCallback and component lifecycle, but after successfully finding them (usecallback & onload), there's no doc about their usage and possible gotchas
There are some areas that should be documented more. If you notice specific functions/structs that are not documented or are missing examples, an issue for those specific functions/structs would be very helpful for tracking. Some docs are documented in the doc.rs/inline documentation that are not included in the guide (like the on_destroy hook).
- starter/boilerplate template inconsistency: I tried to run the fullstack/ssr examples under the corresponding workspaces but some of them cannot compile on my m2 mac
If you are trying to run the examples that currently exist in the fullstack folder with dioxus 0.4 they may not work because they are checked against the git version of dioxus. We also recently switched to checking all features in examples to make sure the ssr and web features are working
- DX(dev experience): IMHO the point of fullstack is to make seamless FE and BE integrations, but rn there's no watch cmd to spontaneously build web and server sides, and the socket sometimes close unexpectedly causing the browser tab to hang, so I have to 0) compile Tailwind 1) build the web 2) build the server 3) open a new tab each time when I make a subtle change in the UI
The first issue was addressed in #1334 and is supported in the git version of the CLI (note the ssr feature has been renamed to server so some other changes may be needed with the new CLI)
The second issue was fixed in #1925