Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: inline dioxus-native from blitz #3675

Open
wants to merge 48 commits into
base: main
Choose a base branch
from
Open

Conversation

jkelleyrtp
Copy link
Member

@jkelleyrtp jkelleyrtp commented Jan 31, 2025

This PR inlines the commits from the blitz repo for the dioxus-native project.

  • Migrate package over
  • asset resolver
  • dx support
  • document support
  • history support

It also makes dx work native.

If we want to publish 0.6.3, we will need to disable this integration, but I'm assuming we're mostly done with the 0.6 patch cycle. Alternatively, we could publish blitz and then release dioxus-native under a minor release (0.6.3 / 0.6.4, etc). We would just need to commit to the "native" feature flag for the time being.

For feature-flag resolution, we use the named feature flags in the users cargo.toml for platform selection:

[dependencies]
dioxus = { features = ["fullstack"] }

[features]
default = []
desktop = ["dioxus/desktop"]
mobile = ["dioxus/mobile"]
web = ["dioxus/web"]
server = ["dioxus/server"]

This means to use the new native renderer, you would simply migrate the desktop and mobile renderers over:

[features]
default = []
desktop = ["dioxus/native"]
mobile = ["dioxus/native"]
web = ["dioxus/web"]
server = ["dioxus/server"]

nicoburns and others added 30 commits October 15, 2024 11:18
* Remove data dependencie from NetProvider + global provider.

* Feat CSS import

* Move net handler code out of util

* Fixing test...

* Use the better suited OnceLock instead of LazyLock

* Removing static and move resource callback back out of the document.

Signed-off-by: koko <[email protected]>

* Make things work

Signed-off-by: koko <[email protected]>

* Fix the servo example

Signed-off-by: koko <[email protected]>

* Replace servo image with a more compact version

Signed-off-by: koko <[email protected]>

* revert: 8467b271

Signed-off-by: koko <[email protected]>

---------

Signed-off-by: koko <[email protected]>
Takes runtime for css-flexbox from 12s -> 8s
…ates (#163)

* Rename waker module to event

Signed-off-by: Nico Burns <[email protected]>

* Create seperate DioxusNativeApplication

Signed-off-by: Nico Burns <[email protected]>

* Rename dioxus-native crate to blitz-shell

Signed-off-by: Nico Burns <[email protected]>

* Split blitz-shell out of dioxus-native crate

Signed-off-by: Nico Burns <[email protected]>

* Remove need for dioxus-native to depend directly on stylo

---------

Signed-off-by: Nico Burns <[email protected]>
…out it being a todo (#168)

Using the `todo` macro causes a panic when this event is encountered. Noop is preferable in this case as it does not crash the application. This is especially annoying on platforms where `Ime::Enabled` event is sent upon application start even when the user is using a keyboard layout that does not need an IME support. There was added a "TODO" comment that informs about this feature being missing. Most IDEs and code editors have support/plugins/extensions to work with this type of comments and this type of comment is already used widely across the codebase. As such, the information about this feature not being implemented is not lost.
blitz-shell no longer depends on blitz-renderer-vello

Signed-off-by: Nico Burns <[email protected]>
* feat: Add mousedown and mouseup event

* feat: Triggering :active pseudo-class

* fix: Triggering :active pseudo-class
@jkelleyrtp
Copy link
Member Author

Screenshot 2025-01-30 at 8 59 11 PM

asset resolver works!

@jkelleyrtp
Copy link
Member Author

Screenshot 2025-01-30 at 9 31 03 PM

dx serve also works

@jkelleyrtp jkelleyrtp marked this pull request as ready for review January 31, 2025 06:41
@jkelleyrtp jkelleyrtp requested a review from a team as a code owner January 31, 2025 06:41
@nicoburns
Copy link
Contributor

For feature-flag resolution, we use the named feature flags in the users cargo.toml for platform selection:
This means to use the new native renderer, you would simply migrate the desktop and mobile renderers over:

With the current code, is it possible to setup feature flags so that you can have both "webview" and "blitz" versions of an app (with different feature flags)?

@nicoburns
Copy link
Contributor

Moving the crate here will mean that we wont be able to easily run dioxus-native-based examples from the Blitz repository. Is the idea is that we would move any relevant examples here? Most of them were based on dioxus examples in the first place, but we might want to check that the unmodified examples work with the native renderer, and port some of the blitz examples that are just testing rendering features to the html renderer?

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.

5 participants