refactor: remove wry/cef feature flags, enforce runtime crates usage#15068
refactor: remove wry/cef feature flags, enforce runtime crates usage#15068lucasfernog wants to merge 9 commits intofeat/ceffrom
Conversation
Package Changes Through 4fce1dfThere are 5 changes which include tauri-macos-sign with patch, tauri with minor, @tauri-apps/cli with patch, tauri-cli with patch, tauri-bundler with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
|
i didn't look through the whole PR yet but what do you think about including it (minus the cef part) in tauri v3 as well? I think with that in place we could potentially gradually port over cef support, keeping the runtime itself separate for the time being. With v3 still being some time off i think we have enough time to test this approach before bringing it into v3. |
There was a problem hiding this comment.
Removing tauri::Wry would mean removing the default Runtime implementation for tauri::AppHandle, tauri::Window...etc which is a big breaking change given that a lot of users use these types without specifying the generic R and defaulting to Wry runtime.
I am not opposed to removing though, I just think we can go a little further by removing the R generic from all public types and instead use dynamic dispatched runtime.
tauri::Builder::default()
.runtime(tauri_runtime_wry::default())
.run()
.expect("failed to run")where the runtime method would use Arc or Box
impl Builder {
fn runtime<R: Runtime>(mut self, runtime: R) -> Self {
self.runtime = Some(Arc::new(runtime));
}
}
hmm that's a breaking change to every plugin out there - but there are more apps than plugins, I can see why that makes sense.
well currently this feat/cef branch is what i envision the "v3" branch being.. if we start a dev -> v3 -> feat/cef branch cascade that works too, but it'll be fun to manage 😂 |
hmm the last few conversations sounded more like cef will come later than v3 (or in a follow up 3.x) as we have e.g. the gtk4 upgrade waiting or the MSRV policy issue that's getting more annoying by the day. |
|
dynamic dispatch is really complicated btw.. i hit all sorts of object safety issues with the traits :/ |
yeah I know v3 shouldn't be tied to CEF at all.. I'm just lazy to port some of the breaking changes to a separate branch - but I will :( |
Runtime & feature flag changes
Runtime
tauri::Wryremoved. Use an explicit runtime type, e.g.tauri_runtime_wry::Wry<tauri::EventLoopMessage>(or CEF), and build withtauri::Builder::<YourRuntime>::new().Feature flag
tauricrate no longer haswryorceffeatures. You choose the runtime by adding the runtime crate to your dependencies (e.g.tauri-runtime-wryortauri-runtime-cef), not by enabling a feature ontauriBreaking changes
tauri::Wryremoved. Replacetauri::Builder::<tauri::Wry>::new()withtauri::Builder::<tauri_runtime_wry::Wry<tauri::EventLoopMessage>>::new()(or your chosen runtime). A type alias is recommended.wry/ceffeatures ontauri. If you relied ontauriwithfeatures = ["wry"](or similar), you now depend ontauri-runtime-wry(ortauri-runtime-cef) and pass that runtime type to the builder.