随着Web技术的不断发展和Rust语言的流行,Tauri框架提供了一种新的方法,将JavaScript与Rust混用于构建GUI桌面应用程序。这项技术允许开发者利用Rust的安全性和Web开发的灵活性,创建出可以在多种平台上运行的优化和独立的应用程序。
David Eastman在InfoQ上撰文表示,Tauri自2022年首次评测以来,随着Rust的流行,其受欢迎程度显著提高。最近推出的Tauri 2版本,进一步增强了其跨平台部署的能力。Tauri被誉为“工具箱”,它能够与Rust crates和系统的原生Web视图相结合,输出一个大小适中的可执行应用程序。
在评测过程中,Eastman注意到Tauri的入门路径变得更加友好,这可能是由于Rust的流行所致。他使用单行代码启动了Tauri,并选择了JavaScript作为前端开发语言,尽管Rust也是可选的。Eastman构建了一个能够在Mac上完全打包运行的UI应用程序,并且发现其代码结构与Web应用程序类似。
在开发环境中,Eastman运行了模板,这需要几分钟的时间来构建所需的包。最终,应用程序以标准Mac应用程序的形式出现在屏幕托盘中。用户可以通过点击图标来打开一个浏览器页面,并通过输入姓名并按下按钮来查看问候语,这有助于了解Rust代码的工作原理。
总体而言,Tauri提供了一种结合Web技术和Rust安全性的新途径,使得开发者能够更高效地创建跨平台的桌面应用程序。随着Rust和Web技术的不断进步,Tauri有望在未来的应用程序开发中扮演更加重要的角色。
英语如下:
News Title: “Tauri Innovation: Blending Rust and JavaScript to Create a New Paradigm for Cross-Platform Desktop Applications”
Keywords: Tauri, Rust, Multi-platform Applications
News Content:
As web technologies continue to evolve and Rust gains popularity, the Tauri framework offers a new approach to combining JavaScript with Rust for building graphical user interface (GUI) desktop applications. This technology allows developers to leverage the security of Rust and the flexibility of web development to create optimized and standalone applications that can run on multiple platforms.
David Eastman, writing on InfoQ, noted that since its initial review in 2022, Tauri has seen a significant increase in popularity with the rise of Rust. The recently released Tauri 2 version further enhances its cross-platform deployment capabilities. Tauri is hailed as a “toolbox” that can combine with Rust crates and system native web views to output a compact executable application.
During the review process, Eastman observed that Tauri’s entry path has become more friendly, possibly due to the popularity of Rust. He started Tauri with a single line of code and chose JavaScript as the front-end development language, although Rust was also an option. Eastman built an UI application that could be fully packed and run on Mac, and found that its code structure was similar to that of web applications.
In the development environment, Eastman ran templates that took a few minutes to build the necessary packages. Ultimately, the application appeared on the screen as a standard Mac application in the dock. Users can open a browser tab by clicking on the icon and view a greeting message by entering their name and pressing a button, which helps understand how Rust code works.
Overall, Tauri provides a new avenue for developers to create cross-platform desktop applications more efficiently by combining web technology with Rust’s security. With the ongoing progress of Rust and web technologies, Tauri is expected to play a more significant role in future application development.
【来源】https://mp.weixin.qq.com/s/zSnEwnwt7NKPVfzDGO0R9w
Views: 3