Skip to content
Tauri 中文网

迁移到 Linux 端口的 webkit2gtk-4.1

大家好!我们最近刚刚发布了 Tauri v2.0.0-alpha3。虽然它没有带来任何重大功能,但它对 Linux 端口产生了一些巨大的影响。 从现在开始,我们将在 2.0 中使用 WebKit2GTK–4.1

🌐 Hello everybody! We just released Tauri v2.0.0-alpha3 recently. While it doesn’t bring any major feature, it does bring some huge impacts on Linux port. We will use WebKit2GTK–4.1 in 2.0 from now on.

🌐 What does this mean?

如果你使用的是 Tauri 1.x 版本,不用担心。你所需的一切依然保持不变。 但是,如果你使用的是从 alpha.3 开始的 Tauri 2.0 alpha 版本,你将需要安装带有 API 版本 4.1 的新 WebKit2GTK 包。 我们将很快在网站上更新先决条件。但如果你想了解如何安装此版本,这里有一些来自 wry 的说明:

🌐 If you are using Tauri version 1.x, there’s nothing to worry about. Everything you need is still the same. But if you are using Tauri version 2.0 alpha version starting from alpha.3, you will need to install the new WebKit2GTK package with API version 4.1. We will update the prerequisites in our site soon. But if you want to know how to install such version, here are some instructions from wry:

Terminal window
# On Arch Linux / Manjaro:
sudo pacman -S webkit2gtk-4.1
# On Debian / Ubuntu:
sudo apt install libwebkit2gtk-4.1-dev
# On Fedora:
sudo dnf install webkit2gtk4.1-devel

🌐 Will this bring breaking changes to my code?

版本 4.0 和 4.1 之间的主要区别是 soup 库。WebKit2GTK-4.0 使用 soup2,而 WebKit2GTK-4.1 使用 soup3。 所以如果你没有使用任何 soup2 特定的 API,你的应用应该可以继续正常工作。

🌐 The main difference between version 4.0 and 4.1 are the soup library. WebKit2GTK-4.0 uses soup2 and WebKit2GTK-4.1 uses soup3. So if you didn’t use any soup2-specific APIs, your applications should continue to work fine.

这一变化的原因是因为我们旨在增加 flatpak 支持,但 Gnome 运行时 使用的是 webkit2gtk-4.1。 还有一些微妙的错误,比如 这个,它们只会在 soup2 中发生,并且可以通过升级到 soup3 来修复。

🌐 The reason behind this change is because we aim to add flatpak support, but Gnome runtime uses webkit2gtk-4.1. There are also some subtle bugs like this that only happen in soup2 and they can be fixed by upgrading to soup3.

🌐 What other breaking changes we are going to expect?

主要的是 MSRV。随着 Tauri v2.0.0-alpha.3 的发布,MSRV 提升到了 1.64。我们也将在未来更新 windows-rs。 这个 Rust 版本应该能满足最新版本的 windows-rs。 我们确实计划在 2.0 之后通过小版本更新我们的 MSRV。这可以在更新依赖时减少坚持固定 Rust 版本的摩擦。

🌐 The major one will be the MSRV. With Tauri v2.0.0-alpha.3 released, MSRV is bumped to 1.64. We will also update windows-rs in the future. This Rust version should satisfy the latest version of windows-rs. We do plan to update our MSRV with minor releases after 2.0. This could ease the friction to stick to any fixed Rust version while updating dependencies.


Tauri 中文网 - 粤ICP备13048890号
Nodejs.cn 旗下网站