wailsapp / wails

Create beautiful applications using Go
https://wails.io
MIT License
25.34k stars 1.22k forks source link

I have some ideas and requirements, and I hope to get help. #2336

Closed geekroscom closed 1 year ago

geekroscom commented 1 year ago

Is your feature request related to a problem? Please describe.

I am trying to migrate an existing Electron project to Wails. I hope to package some of the dependencies in node_modules, such as serialport and usb-detection. The two dependencies I have mentioned have limited resources in GoLang, which is causing me a lot of distress! This will benefit us by allowing direct reuse of some of the Node ecosystem. Additionally, is it possible to use a WebView to embed an external webpage in Vue within Wails?

Describe the solution you'd like

I hope to have support for this, or to be guided on some available methods.

In Electron, this can be done by:

webPreferences: {
          webviewTag: true,
          webSecurity: false,
          nodeIntegration: true,
          contextIsolation: false,
          preload: path.join(__dirname, "../preload/index.cjs"),
      },

Describe alternatives you've considered

I have not found an appropriate solution yet.

Additional context

This is the tool we are developing.

This is an image

It is used for the development of robot hardware.

Development environment: Vue3 Vite TypeScript, from Wails' documentation.

leaanthony commented 1 year ago

Thanks for trying Wails! It's likely those modules are designed for node and not plain old JavaScript so they're unlikely to work. However if you look at https://github.com/zsa/wally you will find some usage of Go USB libraries. Hope that helps

geekroscom commented 1 year ago

I have come across the library "github.com/google/gousb", but it requires specifying information on the USB device. I hope to be able to obtain a list of all available devices for the user to choose from, which would be much more convenient. Thank you for your response. I am still looking for a solution.