maxence-charriere / go-app

A package to build progressive web apps with Go programming language and WebAssembly.

Home Page:https://go-app.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for React?

Scusemua opened this issue · comments

Is it possible to use React with this project at all? It would be helpful to be able to include React script files so I could use those such components and whatnot with the rest of the go-app system.

I've tried to use React with this myself, but I've not been successful, so I'm wondering if there's a way to do it.

I'm curious to understand what aspects of Go-App have caught your attention. Given that Go-App, originally influenced by React, is a comprehensive Go framework for both backend and frontend development, its compatibility with React might present some challenges. Go-App, which compiles the frontend to WebAssembly (WASM), assumes extensive control over the application, particularly in its interaction with the DOM. This could potentially complicate its integration with React, as both frameworks are designed to manipulate the DOM directly.

It's worth noting, though, that incorporating certain JavaScript frameworks might be feasible, especially those that don't directly modify the DOM. For instance, you can safely invoke JavaScript for specific tasks, such as adding unique event handlers or generating audio, as long as these actions are not DOM-centric. Ideally, these JavaScript functions should be either called from the Go code or designed to call back into Go. This approach allows you to leverage the strengths of both languages while maintaining a stable and efficient application structure.

P.S.: I asked Chat-GPT to reformulate my original text to be less "negative" about the idea with me not being a native English speaker :)

Well, I'm more familiar with Golang than I am with JavaScript/traditional web development at this point, so a system which allowed me to rapidly prototype a web interface using Golang was appealing in and of itself. The PWA aspect of go-app is also appealing, although it isn't a requirement for my use-case by any means.

There are just certain UI components that would be significantly easier to enable if I could drop-in an existing React/JavaScript component. I've had some success embedded small amounts of JS into my go-app application, but once dependencies/JS modules are involved, it becomes tricky...

Hello.
Support for React might be off since React directly deals with HTML nodes.
It would probably creates some conflicts.