Tauri Tutorial: 1. Introduction and Comparison with Electron

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video I'm excited to introduce you to Tori a Cutting Edge cross platform desktop application framework that empowers programmers to easily create desktop applications using familiar web Technologies such as HTML CSS and JavaScript along with popular Frameworks like react View and svelte Taurus versatility makes it ideal for any web developer looking to dive into desktop application development without a steep learning curve web technology has emerged as one of the most robust UI Technologies functioning seamlessly across various platforms that support web browsers with story developers have the freedom to design their UI exactly how they Envision it on the web this means you can create stunning and user-friendly interfaces with the same skills you use for web development however there are certain scenarios where desktop applications outperform web apps one of the key reasons for choosing a desktop application is the access to Native apis web apps confined within browsers face limitations and interacting with the operating system for instance accessing the file system or reading clipboard data in the background is not possible with a web app desktop applications on the other hand enjoy greater access to Native apis allowing software to achieve Superior performance using languages faster than JavaScript so it would be perfect if a desktop framework can leverage the flexible UI and huge ecosystems of web apps and also provide access to Native apis Tori consists of two primary components a front-end built using web Technologies and a backend known as story core developed in the rust programming language communicate using inter-process communication the front end empowers you to craft flexible and Visually appealing uis using your preferred web Technologies like react view was felt meanwhile the rustspace backend opens the door to accessing native apis such as clipboard and file system operations enabling your application to perform efficiently and smoothly even for computationally intensive tasks when we talk about building cross-platform desktop apps using web Technologies we have to mention electron electron is probably the most popular cross-platform framework out there today electron has demonstrated its worth by being the foundation for numerous renowned applications a brief Glimpse at the list of successful electron powered apps include slack Discord twitch notion and visual studio code each of these widely used applications attest to electrons capabilities and popularity within the development Community with the recognition of electrons achievements let's embark on a comparative Journey between electron and Tori to help you make an informed decision about which framework best suits your needs before going into any technical details let's first look at what developers think about them the state of JS survey provides valuable insights into how developers perceive JavaScript related Frameworks including Frameworks within the context of mobile and desktop development this survey categorizes Frameworks based on factors like satisfaction retention rate interest usage and awareness among developers in 2020 Torah is not even on the ranking electron wings with a 89 satisfaction rate 2021 is the first year Tory gets on the stage and Tori won the first placing retention rate by one percent if we look at usage Tori is only two percent electron is still the winner in 2022 Tory wins again with a huge margin but leads the second place by 13 and electron by 17 this result has proven Tori's Excellence now let's compare them in more detail the electron itself is more like a bare bone framework lacking a predefined template to Kickstart a project effect as evident in his documentation and quick start guide developers are guided to build an electron project from the ground up beginning with initializing an npm project and employing pure JavaScript and HTML while learning the fundamentals from scratch can be beneficial the process of setting up everything manually can be time consuming and complex in today's development landscape relying solely on vanilla JavaScript is becoming less common especially when dealing with intricate applications instead developers often prefer starting with a pre-configured UI framework scaffold accompanied by typescript support unit testing e2e testing and other essential features even packaging an electron app demands additional dependencies like electron Builder and electron Forge which must be installed separately here Tory shines as a more developer friendly option it offers a variety of official templates that works out of the box and seamlessly integrates with modern framework scaffolds converting a web app into a desktop application becomes a breeze with just a few clicks eliminating the need for manual file additions Tori streamlines the entire process out of the box sparing developers the hassle of connecting backhand and front end becomes equipped with features that cannot updater and app builder covering all aspects of the development and production build workflow to me the way Tory works is just more elegant and convenient electron has many Community maintained boilerplates in fact I believe most people will pick a template rather than build everything from scratch the maintainers are doing a great job maintaining these border plates but I personally prefer official boilerplates for their Superior stability reliability and up-to-date nature I encountered an issue with an electron plus view boilerplate that I won't name here despite the development server functioning I face difficulties in creating a production build due to certain bugs such instances can be frustrating and lead to unnecessary time wastage to avoid such roadblocks I find that official boilerplates are a more dependable choice being curated and maintained by the Frameworks core team they undergo rigorous testing and updates ensuring a smoother development experience ultimately utilizing boilerplates provided by the framework's official sources not only saves time but also inspires confidence in the stability and reliability of the development process bundle size is a prominent concern that many people have with electron but Tory emerges as a clear winner in this aspect according to benchmarks electron consumes around 160 megabytes while Tori impressively uses less than 10 megabytes the Stark difference in bundle size is attributed to electrons inclusion of a note.js runtime and a Chromium browser within the app resulting in a significant package size even an empty electron boilerplate can easily reach 200 megabytes each installation of an electron app means installing a browser and no.js runtime on the user's computer leading to substantial space wastage Tori on the other hand takes a more efficient approach it abstains from bundling node.js runtime for a browser instead fully compiles the backend code written in Rust into a binary and leverages the existing browsers on the operating system to display the front end discover design significantly reduces bundle size Tori uses webview 2 on Windows and webkit on Mac and Linux with more in the documentation if you are interested the main difference is these webview browsers are shared across the system installing new Tory apps doesn't duplicate the browsers this is similar to the difference between Dynamic and static libraries if you know what I am talking about the execution time difference between Tory and electron is not significant for regular tasks however when it comes to heavy computations in the background Tory gains an advantage Tori spectant is written in Rust a language known for its speed of Performing JavaScript using electron while you can improve electron's performance with Native add-ons it introduces complexity to your app if you are willing to learn rust Tory becomes a straightforward Choice as it works seamlessly without additional modifications but note that you do not need to know rust to get started JavaScript is enough to get you started moreover Tory boasts smaller memory consumption fewer threat usage and fewer system costs compared to electron leading to better performance overall although I haven't conducted an in-depth experiment it is likely that Tory apps consume less battery than electron due to its efficiency and resource optimization indeed electron being a more mature framework currently offers a broader range of native apis compared to Tori for instance Tori currently supports only reading and writing text on the clipboard whereas electron extends support to various data formats including text image HTML RTF bookmark and buffer before opting for Tory is essential to carefully assess your application's requirements and the necessity of specific apis if your application heavily relies on apis not currently supported by Tory it might be prudent to consider electron or explore other Alternatives so if some of these are necessary for your application think carefully before choosing Tori you can still use Tor if you have the ability to write your own API plugin in Rust for example I need my app to read screenshot images from clipboard while Tori doesn't support it I build my own clipboard plugin in another video we will talk about how to make a plugin before deciding on the framework I highly recommend conducting several research on the specific native apis you require and outlining your software's expectations including considerations like memory consumption and performance requirements understanding your Project's needs will help you make an informed choice that best aligns with your goals a significant advantage of totally comparing to Frameworks like flutter and QT is that you don't need prior knowledge of rust to use it effectively the UI coding in Tor is exactly the same as building a web app or native apis are accessible directly in typescript and JavaScript so Tory should be the best choice most of the time unless you have any special needs Tori has a big Community where you can seek support the official documentation is the first place you can look for help before asking read the documentations and search with keywords if you're getting to any trouble you can solve go to tourist GitHub issues and discussions you may not be the only one with such issues and it's very likely you can find an answer there another excellent resource is the awesome Tory GitHub repository which showcases numerous apps built with story many of these apps are open source allowing you to gain insight into the capabilities of Tory and learn from their implementation if there's a specific feature you wish to implement but are unsure how to go about it studying the source code of these apps can be enlightening you can also join Tori's Discord server to seek help while Tori is a promising framework its community and online resources are not as extensive as electrons the documentation is comprehensive but lacks in-depth coverage for certain aspects and may be challenging to find some resources to bridge this Gap I will create a tutorial series sharing techniques and tips I've learned while using Tori the tutorials will demonstrate building desktop applications with story from scratch helping others navigate the framework more effectively thank you for watching and see you next time
Info
Channel: Huakun
Views: 3,636
Rating: undefined out of 5
Keywords: Descript
Id: pwAl1E7knXA
Channel Id: undefined
Length: 8min 58sec (538 seconds)
Published: Fri Aug 04 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.