Skip to content

Renderers are now packages, not features.#387

Merged
jkelleyrtp merged 3 commits into
masterfrom
jk/sync-router
Jul 9, 2022
Merged

Renderers are now packages, not features.#387
jkelleyrtp merged 3 commits into
masterfrom
jk/sync-router

Conversation

@jkelleyrtp

@jkelleyrtp jkelleyrtp commented Apr 30, 2022

Copy link
Copy Markdown
Member

This PR changes how we do packages since things have started to become unwieldy when adding functionality to crates like the router, fermi, and 3rd party renderers.

Now, all renderers are their own package and need to be added to Cargo.toml as such:

[dependencies]
dioxus = "0.3"
dioxus-router = "0.3"
dioxus-web = "0.3"

Instead of dioxus::web::launch you'll do dioxus_web::launch.

For releases, we'll using the minor version to keep things in lock step, but freely bump minor versions as new updates are pushed. It should've been this way since the beginning but I was experimenting. This also gets rid of the rsx-prelude which was a patch until we had a better solution.

The benefits:

  • 3rd party crates can be released without bumping dioxus as a whole
  • rsx prelude is now easier to deal with in 3rd party crates
  • tests and examples can now be moved into the 3rd party crates without conflicts
  • vscode and cargo no longer yells at me when I do circular imports

The stuff that remains under "dioxus" includes:

  • core
  • core-macro
  • html
  • hooks
  • rsx
  • rsx-interpreter (until we've moved to a more flexible hot reloading system)

@jkelleyrtp jkelleyrtp changed the title Use synchronous router for simpler server side rendering Renderers are now packages, not features. Jul 6, 2022
@jkelleyrtp jkelleyrtp marked this pull request as draft July 6, 2022 19:46
@jkelleyrtp jkelleyrtp added breaking This is a breaking change organization Layout of the repository labels Jul 7, 2022
@jkelleyrtp jkelleyrtp marked this pull request as ready for review July 7, 2022 21:20
@jkelleyrtp jkelleyrtp requested review from ealmloff and rMazeiks July 7, 2022 21:20

@rMazeiks rMazeiks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand where a bunch of changes are comming from; this is supposed to be just a re-structuring right? Might wanna check what Git has done here in the diff. Anyway, the other stuff looks good!

Comment thread Cargo.toml Outdated
@@ -0,0 +1,185 @@
//! Example: Antipatterns

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i deleted some of these examples when i re-wrote the guide

the guide now contains the parts of this info i found important, in a more concise form

any reason for adding them back or just git merge madness?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge madness :) I need to figure out which ones slipped through

}
});

cx.provide_context(svc)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleting this seems sus and unrelated, is it intentional?

@ealmloff ealmloff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems much more organized. 🙂
A few things I noticed that don't fit specific lines:

  • There are some dioxus::{plaform} imports left in the docs/guide/examples
  • The tui_benchmark should probably be moved from the dioxus to the tui crate
  • I think we can remove rsx-prelude now

Comment thread packages/router/Cargo.toml Outdated
Comment thread packages/router/examples/simple.rs
Comment thread packages/router/tests/ssr_router.rs
@jkelleyrtp jkelleyrtp enabled auto-merge (squash) July 9, 2022 19:15
@jkelleyrtp jkelleyrtp disabled auto-merge July 9, 2022 19:15
@jkelleyrtp jkelleyrtp merged commit d9546d9 into master Jul 9, 2022
@jkelleyrtp jkelleyrtp deleted the jk/sync-router branch July 9, 2022 19:15
amindWalker pushed a commit to amindWalker/dioxus that referenced this pull request Jul 10, 2022
* feat: use synchronous router design

* feat: function to get router out of dom

* chore: restructure workspace to use renderers as packages, not features
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking This is a breaking change organization Layout of the repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants