Software & Apps

We have replaced our reaction frontend to go and webassemblingly

How many weeks ago, we Dagger Cloud V3 launchedA perfect new user interface for Dagger Cloud. One of the main differences between V3 and the V2 is first this is that the new UI has been written to Webassembly (WASM) using go. At first sight, this is probably a strange choice – going usually is not the first language you think when deciding to programming a web UI – but we have good reasons. This blog post, I’ll explain why we chose Webassembly, some of our enforcement challenges (and how we work around), and the results.

Two Codebases = additional jobs, fewer features

The dagger acts by strengthening a tag of operations and evaluating them, often equal. In nature, it is a hard thing to show. To help users understand this, we offer Two interpaces of visualization: The Dagger Terminal UI (Tui), attached to the Dagger Cli, and Dagger Cloud, an online web dashboard. The Dagger Tui was executed to go, and the Dagger Cloud (pre-v3) was written by the reaction.

Obviously, we want user interfaces to be close to each other as possible. But the actual act of interpreting the stream of the Dagger’s Daggers in real-time and creating UI is well involved. Some of the more complex streams of the event we’ve seen with hundreds of thousands of open openetelemetries, and the management of data structures in their surroundings are very complex, very quickly. Web UI often cannot proceed with large number of data that should be processed and it can be luggy and slow; To fix this performance bottleneck, we are forced by a different implementation model for application application.

So, we ended up with two interfaces trying to fulfill the same thing, one of them in a language and ecosygn / type), the other in a different language logic between them. As a small team, we need to send immediately. It has to re-execute each part twice a large tax on our speed.

We started to think about a new method of Dagger Cloud, with two main goals:

  • Merge of cenerebases, to eliminate duplicate and make more efficient to send new features

  • Deliver to the promise of a fresh, snappy web UI, equivalent to the speed and performance of the terminal UI

Selecting Go + Webassembling

Our starting goal is to re-create a codebase for two straw clouds and tui. We have decided to be early enough to make it a go codebase. Technically, we can go to another way and used TUI TYPE. But we mainly go to a team of GO engineers, so choose to go easier for others to contribute, to add a part or drop some time to help -Debug with an issue. In addition to standardized a language, it gives flexibility and broke the silos in our team.

Once we decided to run the code straight to the browser, Webassembling is the logical next step. But there are still another couple of challenges:

  • GO + Webassemblly combination is not yet mature as reaction and other JavaScript frames. There are no prepared components of ingredient libraries to get from, developing development is not as rich, etc. We know we need to build most of our UI components from the beginning.

  • There is a hard 2 GB memory limit for webassembly applications in most browsers. We look forward to this is a problem when looking at a lot of traces, and we know we need to do a lot of optimization to minimize the use of memory and keep UI stable. It’s not very bad either; The silver lining here is that any improvements in using the memory webassembly UI can benefit the TUI users too, because it is a shared cenerebase.

The project is dangerous

When we made a decision, the next question is, “How do we build it?” We decided to build new edassembly-based UI to Go-app framework. Go-app is a high-level framework specifically for Progressive Web Apps (PWAs) to webassembly. It offers the benefits of going, such as fast accumulating and native static type, and it also follows a UI-based model, such as reaction.

Since the GO + Webassemblly combination is not mainstream, there are some healthy doubts within the dagger team about the possibility of it. For example, there is no real ecosystem for the go-app UI components and we know we need to write ourselves, but we’re not sure how easy it is or so hard. We also have concerns with other services (topwind, auth0, intercom, posthog), and about several hundred updates of components of similar updates at the same time.

To answer these questions and jeopardize the project, I am almost a moon prototyping, with the intention to re-enforce the more current UI as possible on the go-app. As it turned out, no many blockers: Webassembling is already well documented basis And most other questions are answered by The go-app documentation. The biggest challenge, as expected, is the limit of memory use, which requires the design and optimization.

From prototype to make

Once we have a working proof of the concept, the team’s comfort level increases and we prevent the project “awesome wasm” to provide a production implementation. Here are some notes from the journey:

  • Using memory is easy with a great deal of danger in project success. I think a lot of time on how to give year 200k + lines of log output without crashing. This is the reason for optimizing our Virtual Terminal Rendering Libraryhave reduced the use of the TUI memory at the same time (as mentioned, the concept of condebases means that important optimization of an interface “is” free “

  • Going to Wasm is slow to parse many JSON, which leads to changes to dramatic architecture and the production of a “Smart Backend” for the arrival of websofets The encoding / gob format.

  • At first, the Womm file is about 32 MB. By applying Brotli compressionWe send it up to 4.6 MB. We try to make the brotli compression of-the-fly on our CDN but the file is very large, so we finally included the process of compressing our construction process.

  • Besides the challenges of memory, most of our other first concerns have become no basis. UI components are not very difficult to write, compatible with other services are frankly, and I find good ways for updating real-time updates.

  • There are many useful NPM packages I’ve found, so I’m thinking if I can use it. Webassembling has a straightforward interface with two to go and javascript, so I built a Dagger module that uses browser to load a NPM package. This module allows us to create a JavaScript file that can be included in a Go Application. This means we can work first to go and then, if needed, there is a way to load assistants with native javascript.

  • DISCLAIMER: I’m not a professional reaction to the mind if that in mind … as the reaction of my reaction is a strict way of implementing substances, while the go-app is easier. At the go-app, you can have a component update whenever you want, giving you many many freedom recognition for optimization. For example, I need to optimize a substance that will provide 150,000+ output lines. Having the ability to try different ways and then select the one that works best, made the whole exercise easier!

  • Although the go-app does not react to the browser-built reaction, I have used its own goes to use it is very useful to inspect calls of tasks, tracking the use of CPU and memory, and weighing -Dimit the effectiveness of different methods of optimization using memory.

  • I have discovered a partly benefits to using Go-App: because the Dagger Cloud is built as a PWA, it can be installed as a desktop or a mobile application. It is possible to launch the Dagger Cloud like a native application and get a perfect experience that doesn’t have to open a browser first, or have a dedicated icon on the taskbar / dock.

We slowly launched Dagger Cloud V3 in our Dagger Commanders A few weeks ago to collect feedback and made it available to everyone soon after.

Benefits

Our switch from the WASM reaction resulted in a more consistent user experience across the dagger interfaces and higher healing and withdrawing of many traces.

From an engineering view, our team’s benefits are important. Optimizations often involve just like, otherwise more, work than real implementation. So it’s good that it doesn’t have to spend time optimizing Web UI, and then many hours optimizing TUI, and in exchange for true focus on new features.

Do you need to do this?

Dagger Cloud V3 The Dagger Community Buzzing and one of the most common questions we’re referring to just the new one is: Who should think to do it and who is not appropriate?

We want to clearly we don’t usually recommend making paths ahead. We have some great reasons to make it: a team of strong go-to-go; a complex UI that the typocript script / reaction is not good for; a requirement for standardizing and using between two cenerebases; and a mandate of the company to increase our velocity. That is a specified set of circumstances. If you have the same circumstances, it is certainly a choice that is worth checking; If not, there are other tools and patterns you need to think about.

The Dagger Cloud V3 is still in beta and we’re eager for you Try this. If you want to know more about our implementation or have simple feedback to share with the new UI, join our conflict and Let’s find out What do you think!


https://framerusercontent.com/images/rpEQqTKSeayyQu6gE5juicjnz4.png

2025-02-11 05:13:00

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button