[DEV] Wails 찍먹하기
wails (웨일즈) / 울부짓다
wails 소개
대부분 electron (nodejs) 을 많이 사용하지만, 높은 메모리 점유 등의 문제가 있어 대안으로 나온 것 중 나름 괘않은 것이 tauri (rust) / wails (golang) 이 아닐까 개인적으로 생각함
v2.7.0
Wails는 Go 및 웹 기술을 사용하여 데스크톱 앱을 작성할 수 있게 해주는 프로젝트입니다.
Go를 위한 가볍고 빠른 Electron 대안이라고 생각해보세요. 풍부하고 현대적인 프런트엔드와 결합된 Go의 유연성과 강력한 기능을 사용하여 애플리케이션을 쉽게 구축할 수 있습니다.
설치
의존성
- go 1.18+ : golang : 1.21.6
- npm node 15+ : node : v20.11.0
# 설치 확인
go version
node --version
기타 의존성
# windows installer program
# cmd 관리자 권한으로 실행
choco install nsis
wails 설치
# wails 설치 전 go 1.18+ 여부 확인
# cmd 관리자 버전에서 수행
go install github.com/wailsapp/wails/v2/cmd/wails@latest
wails 설치 정보 확인
# success 라는 문구가 출력되면 ok, 아니라면 출력되는 문구를 참조
wails doctor
프로젝트 만들기
# react + typescript
wails init -n dev-wails -t react-ts
프로젝트 폴더 구조
.
├── build/
│ ├── appicon.png
│ ├── darwin/
│ └── windows/
├── frontend/
├── go.mod
├── go.sum
├── main.go
└── wails.json
실행
wails dev
를 실행하면, vite 를 사용하여 로컬웹 서버가 기동되는 것을 확인할 수 있다.
화면 부분인 tsx
파일이 수정되면 거의 즉시 반영됨, interface 부분인 go
파일이 수정되면 약간의 시간이 걸린 후 application 자체가 재 기동됨
참조링크
- wails : docs - introduction
- webview2 : Evergreen Standalone Installer / 이미 설치 된 경우가 많음
- upx - 압축 : release 다운로드 시 upx.exe 생성, path설정 하여 사용
- nsis - win installer
맺음말
빠르게 찍먹 해봤는데, 아직까진 electron 이 느리지만 좋은 것 같다는 생각이 들었음. golang 의 러닝커브랄까 그리고 reference 또한 electron이 많은지라 빠른 개발을 위해서는 아직까진 electron 만한것이 없지 않을까 생각 해봤다. tauri 또한 예전에 함 찍먹 해봤지만 비슷한 느낌.
rust 나 golang 을 잘 하는 분이 있다면 바꿔봄도 좋겠지만 그것이 아니라면 아직까진 electron 만한것이 없지 않나 생각 해본다.
장점
- electron 대비 빠름
단점
- golang 배워야 됨
참조
wails 개발 관련 vscode 한 장면
[광고] STEEM 개발자 커뮤니티에 참여 하시면, 다양한 혜택을 받을 수 있습니다.
뭐가 가장 좋은가요? 요즘 나오는 오픈소스를 보면 tauri 를 많이 사용하는 것 같던데여.
커뮤니티/레퍼런스 : electron >>> tauri > wails
메모리 사용량 : tauri > wails >>>> electron
단순하게 web ui 만 조작하는 것이라면 tauri나 wails 를 써도 무방하나
native ( desktop ) 기능을 좀 더 다양하게 쓰고 싶다면, 레퍼런스가 많은 electron이 아직까진 훨 좋아 보이네요
짧은 시간에 후딱 완성시켜야 되니 ... 메모리 최적화 경량화는 ... don care 급이라 ㅜㅜ
그렇군요. 레퍼런스 많은걸 사용하는게 베스트네여
!ask Make a table comparing electron vs tauri vs wails.
| Feature | Electron | Tauri | Wails |
| ------- | -------- | ------ | ----- |
| Programming Language | JavaScript, TypeScript, HTML, CSS | Rust, JavaScript, HTML, CSS | Go |
| Cross-Platform Development | Yes (Windows, macOS, Linux) | Yes (Windows, macOS, Linux) | Yes (Windows, macOS) |
| Build System | Webpack or Rollup.js with plugins for native code integration | Cargo and Node.js for bundling and packaging with plugins for native code integration | Go compiler and Node.js for bundling and packaging with plugins for native code integration |
| Native Code Integration | Yes (via plugins or APIs) | Yes (Rust-based APIs) | Yes (Go-based APIs) |
| User Interface Frameworks Supported | React, Vue.js, AngularJS and others | React and Vue.js with Rust-generated bindings
command: !ask is powered by witness @justyy and his contributions are: https://steemyy.com
More commands are coming!.
!ask is currently based on ChatGPT-3.5
!ask Make a table comparing electron vs tauri vs wails.
| Feature | Electron | Tauri | Wails |
| --- | --- | --- | --- |
| Language | JavaScript, TypeScript, Rust | Rust, JavaScript, Python, Go | JavaScript, TypeScript |
| Framework | Cross-platform desktop apps and web apps | Cross-platform desktop apps and web apps | Cross-platform desktop apps and web apps |
| GUI Frameworks used | React, Vue, Angular, Svelte | React, Vue, Angular, Svelte | React, Vue |
| Size of Bundled App | Large (due to bundled Chromium) | Smaller than Electron (due to using native OS components)
command: !ask is powered by witness @justyy and his contributions are: https://steemyy.com
More commands are coming!.
!ask is currently based on ChatGPT-3.5