Skip to content

alias rsx*! macros to html*! macros#185

Open
thefiddler wants to merge 1 commit intovidhanio:mainfrom
thefiddler:feature/html-macro
Open

alias rsx*! macros to html*! macros#185
thefiddler wants to merge 1 commit intovidhanio:mainfrom
thefiddler:feature/html-macro

Conversation

@thefiddler
Copy link

@thefiddler thefiddler commented Mar 6, 2026

This PR builds on #184 and adds html!, html_borrow!, html_file! and html_file_borrow! aliases to the corresponding rsx! macros. Using the html! alias instead of rsx! fixes subsecond hotpatching (re #123) - the underlying issue is that dioxus-cli searches for rsx! by name and special-cases them, which doesn't work in our case.

I have also added a subsecond example that you can try out:

cargo install dioxus-cli
dx serve --hotpatch -p hotpatch

@vidhanio let me know if this workaround makes sense upstream or if you would prefer a feature flag for it. This is easy enough to handle downstream, but I suspect a good subsecond hotpatching experience would be appreciated by end users.

Closes #123 #148

@thefiddler thefiddler force-pushed the feature/html-macro branch from effe952 to b11b336 Compare March 6, 2026 07:20
@vidhanio
Copy link
Owner

vidhanio commented Mar 6, 2026

thank you @thefiddler! i'm so sorry but i've just merged a big refactor i've had sitting on the backburner. it hopefully shouldn't change too much for this PR or your other. would you be okay with

  1. combining both of these PRs/change them for the new structure
  2. wait until Using builder for component instantiation #183 is added to avoid conflicts

@vidhanio vidhanio linked an issue Mar 7, 2026 that may be closed by this pull request
@thefiddler
Copy link
Author

Hi @vidhanio , no worries, I will merge the two PRs in one and rebase as soon as #183 is merged.

- rsx_file! / rsx_file_borrow!: load RSX from external files
- html! / html_borrow! / html_file! / html_file_borrow!: rsx aliases
  that avoid Dioxus CLI name collision
- File paths resolve relative to CARGO_MANIFEST_DIR
- include_bytes! emitted for automatic recompilation on file changes
- Rebased on upstream/main (includes vidhanio#183 builder refactor)
@thefiddler thefiddler force-pushed the feature/html-macro branch from b11b336 to 7633314 Compare March 8, 2026 21:55
@thefiddler
Copy link
Author

@vidhanio done, I merged both PRs in one and rebased on master.

Let me know if you'd like any changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hot-reload support

3 participants