This is pretty interesting. I have some questions. Since I don't know the product, I don't understand why doing all of this data crunching on the frontend. Seems like the same motivation could be applied to moving more of the heavy work to the backend before sending results to the frontend. Making the app more of a thin client. Am I missing something, is there a reason to keeping the work on FE?
We replaced our React front end with Go and WebAssembly
141–150 of 242 posts
Re: We replaced our React front end with Go and WebAssembly
#142Earlier quoted context omitted.
In my experience, I've seen no benefits (and sizable downsides) to using Python on the backend when the front end is React vs. using Node. There are tons of robust API frameworks for Node, a huge ecosystem, etc. So with Node and Python it's more potayto-potahto, and if that's the case, there are benefits to having everything in Typescript for standard server/client cases. Note I'm not saying do this everywhere if the…
I think you feel that way because you're comparing Node to Python. Neither of them are particularly good languages for servers. Languages like Go and Java/Kotlin are much better when you're building complicated systems that need to be performant and reliable.
Re: We replaced our React front end with Go and WebAssembly
#143Earlier quoted context omitted.
I think a lot of frontend engineers can do backend work and vice versa, but it takes a lot to be very good at both. It's not impossible but also I think it's rare that a backend engineer would voluntarily decide to also become a frontend expert instead of leveling up their backend skills. Fullstack in my experience arises out of a need by companies and startups to cut costs by having a single engineer do both.
A true fullstack developer is a jack of all trades. The adage being "A jack of all trades is a master of none, but oftentimes better than a master of one ." A fullstack developer is not two developers in one. A dedicated backend or frontend dev will always overperform a fullstack dev in their side of the stack. But while a good fullstack dev is not useful to a more mature company, they are invaluable to a startup, ea…
Consider two examples: sending an email, which requires typical frontend skills but is by nature in the backend code; and configuring invisible backoff and retries in the frontend, which is the opposite.
I call myself a full stack engineer even though my ability to do design-adjacent work is pretty bad because I've spent a lot of time working in this middle ground. When you want to e.g. move PDF generation from the server to the client, or you want to untangle the horrible Redux caching layer that doesn't invalidate things properly, that's a specific blend of skills that's neither fully one nor fully the other. This is less about cost and more about a niche between the two fields.
Consider also data engineers, or teams with a technical lead rather than an EM, or any other role that sits between worlds.
Re: We replaced our React front end with Go and WebAssembly
#144Will just comment that I think there is huge value on having all pieces (front end/back end/apps) on the same language if at all possible, especially for small teams. I've gone the other direction, which is basically "Typescript everywhere", or at least as much as possible, i.e. React on the front end, NodeJS on the backend, and Capacitor for apps (note Capacitor may not be appropriate for all types of apps but in ou…
Hard disagree. Just as I disagree about "full stack" developers. People that call themselves "full stack"are a backend developer that dabbles in frontend or a front end developer that can dabble on the backend. Almost never have a met a person who was equally good at both. Just the same Languages have their strengths. Using a backend language to write your frontend is more or less a waste of developer resources. Chan…
Full stack developer here who disagrees. Most web apps are not that complicated and if there are the term 'backend developer' will be replaced with something more specialised as well.
> the backend story for me is still weaker than using Python or elixir, etc simply serving an API
That is a very odd statement, Python has a lot of issues that NodeJS never had, in terms of developer experience I believe NodeJS is superior just based on the fact that I don't need to know what a virtual environment is and I don't need to choose between different incompatible package managers before I even write my first line of code.
> if you are building a company, 9 times out of 10 you are going to have to have an API anyways. I like to have the boundary of that API explicit.
If the only consumer of the API is your frontend, why would you want to have such a strong boundary?
> the only exception to the above is if you aren't building a company and instead working on a small personal or group project.
This statement can easily be hard countered by the rise of full stack frameworks like NextJS and the fact that the whole backend-frontend separation didn't always exist, it mainly happened because of SPAs.
Re: We replaced our React front end with Go and WebAssembly
#145Will just comment that I think there is huge value on having all pieces (front end/back end/apps) on the same language if at all possible, especially for small teams. I've gone the other direction, which is basically "Typescript everywhere", or at least as much as possible, i.e. React on the front end, NodeJS on the backend, and Capacitor for apps (note Capacitor may not be appropriate for all types of apps but in ou…
Re: We replaced our React front end with Go and WebAssembly
#146Early in the post: > As a small team, we need to ship fast. So they chose a solution that required them to: > Spent almost a month prototyping > there was no real ecosystem for Go-app UI components and we knew we’d have to write our own > Go WASM is slow at parsing large amounts of JSON, which led to dramatic architecture Not sure what their definition of shipping fast is, since this just sounds like resume oriented…
> I spent a lot of time figuring out how to render 200k+ lines of log output without crashing. This led to optimizations deep in our virtual terminal rendering library... Interesting. I have two wildly different takes on this. 1) Dagger is such an interesting company that they let developers do whatever they want, as long as it works and works well. A good mix of pragmatism and fun. 2) Holy crap, it's a real company…
Re: We replaced our React front end with Go and WebAssembly
#147They've decided to create their front end using https://go-app.dev/ . From that page: "Go-app is a package for building progressive web apps (PWA) with the Go programming language (Golang) and WebAssembly (Wasm)."
Re: We replaced our React front end with Go and WebAssembly
#148From the webpage: "Go WASM is slow at parsing large amounts of JSON, which led to dramatic architecture changes and the creation of a “smart backend” for incremental data loading over WebSockets, using Go's rarely-used encoding/gob format." From https://pkg.go.dev/encoding/gob "This package is not designed to be hardened against adversarial inputs, and is outside the scope of https://go.dev/security/policy . In parti…
>from untrusted sources if you can't trust your own backend, step one is reevaluating your life choices
After years of experience I question everything ;-)
Re: We replaced our React front end with Go and WebAssembly
#149Will just comment that I think there is huge value on having all pieces (front end/back end/apps) on the same language if at all possible, especially for small teams. I've gone the other direction, which is basically "Typescript everywhere", or at least as much as possible, i.e. React on the front end, NodeJS on the backend, and Capacitor for apps (note Capacitor may not be appropriate for all types of apps but in ou…
No disrespect to you but I'm constantly reminded of this quote: "Consistency is the hobgoblin of little minds" -- Ralph Waldo Emerson It's this same idea that led Google down the garden path that was (is?) GWT: Java everywhere. It seems like a good idea but for every platform you add, you reduce the total the lowest common denominator between them. You add transliteration bugs and issues. Google also trie to do this…
Re: We replaced our React front end with Go and WebAssembly
#150Hey, I’m the creator of go-app. What a surprise to come across this post on HN! I’m really happy to see you folks built something that fits your needs with it. Wishing you continued success with your product!
1. With go-app
func (h *hello) Render() app.UI {
return app.Div().Body(app.Text(fmt.Sprintf("Hello %s", h.name)))
}
2. Compared to using templ templ Hello(name string) {
Hello, { name }
}
For me personally, the latter seems nicer- I can see at a glance the structure of the HTML
- Completion on the HTML tags, attributes, etc
- Completion on CSS (TailwindCSS LSP for VSCode)
- Logic can still be shared with other types of UIs (e.g. CLI, Native Apps, Webkit, gRPC)
If what you want is option 1, isn't this solution incomplete. That is, the fully realised vision would be a native component / widgets API (e.g. Fyne, QT, GTK), and then generate HTML from the components?
However, "since Dagger Cloud is built as a PWA, it can be installed as a desktop or a mobile application. This makes it possible to launch Dagger Cloud like a native application and get a full-screen experience without needing to open a browser first, or just have a dedicated icon in your desktop taskbar/dock", so it sounds like the "Native App" is using a Webkit (e.g. Wails, Tauri, Electron)
Anyway, congrats on having commercial users building stuff with your project!