-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v3] Notifications API #4098
base: v3-alpha
Are you sure you want to change the base?
[v3] Notifications API #4098
Changes from 88 commits
32839bd
274511c
f694ad2
cc524d7
87f15ce
91f1704
01fa307
c7d54e2
7757eae
9f39577
47a0977
6d44068
ab9c460
27e512d
f8647ff
c1230d4
9eab58f
cc760a1
978a982
bf4222c
c904433
983c25f
1e3511c
3dbf058
be716fc
8da9981
e8ad42a
8bbe381
67adc45
253f672
135defc
7bbc275
fa498f1
050e4ef
60c1a86
10ae1f6
a4c4ab6
acad85e
60ae0c1
47e5b10
5ad3d73
e86cf68
db2cab7
e216b3e
207b162
3bdb3dd
a807c26
ad74972
d9af6de
833d8ec
e4ec06a
1e67e94
1fa6894
e46abdc
2cb0dac
6d15f08
e810d6a
e4e24a0
b60ef77
ee885fe
4af058b
58b5c10
25256f7
d98f528
bd85738
c58709c
b1db2bb
88f1336
94f245f
e55bf8d
9adeef2
5dc7bd9
be1da68
ef3b7d2
81b40d2
f6a5bed
b2b8f14
f870dcc
9948cee
ace4f70
448c78b
5ddb27f
a683918
9a45423
7f496c9
1f82166
b102279
d25f923
276c653
7d0f7f4
af5abda
1db65a8
743882a
1022f47
bd5c82e
b313f2c
9a41b0c
75dbe85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Welcome to Your New Wails3 Project! | ||
|
||
Congratulations on generating your Wails3 application! This README will guide you through the next steps to get your project up and running. | ||
|
||
## Getting Started | ||
|
||
1. Navigate to your project directory in the terminal. | ||
|
||
2. To run your application in development mode, use the following command: | ||
|
||
``` | ||
wails3 dev | ||
``` | ||
|
||
This will start your application and enable hot-reloading for both frontend and backend changes. | ||
|
||
3. To build your application for production, use: | ||
|
||
``` | ||
wails3 build | ||
``` | ||
|
||
This will create a production-ready executable in the `build` directory. | ||
|
||
## Exploring Wails3 Features | ||
|
||
Now that you have your project set up, it's time to explore the features that Wails3 offers: | ||
|
||
1. **Check out the examples**: The best way to learn is by example. Visit the `examples` directory in the `v3/examples` directory to see various sample applications. | ||
|
||
2. **Run an example**: To run any of the examples, navigate to the example's directory and use: | ||
|
||
``` | ||
go run . | ||
``` | ||
|
||
Note: Some examples may be under development during the alpha phase. | ||
|
||
3. **Explore the documentation**: Visit the [Wails3 documentation](https://v3.wails.io/) for in-depth guides and API references. | ||
|
||
4. **Join the community**: Have questions or want to share your progress? Join the [Wails Discord](https://discord.gg/JDdSxwjhGf) or visit the [Wails discussions on GitHub](https://github.com/wailsapp/wails/discussions). | ||
|
||
## Project Structure | ||
|
||
Take a moment to familiarize yourself with your project structure: | ||
|
||
- `frontend/`: Contains your frontend code (HTML, CSS, JavaScript/TypeScript) | ||
- `main.go`: The entry point of your Go backend | ||
- `app.go`: Define your application structure and methods here | ||
- `wails.json`: Configuration file for your Wails project | ||
|
||
## Next Steps | ||
|
||
1. Modify the frontend in the `frontend/` directory to create your desired UI. | ||
2. Add backend functionality in `main.go`. | ||
3. Use `wails3 dev` to see your changes in real-time. | ||
4. When ready, build your application with `wails3 build`. | ||
|
||
Happy coding with Wails3! If you encounter any issues or have questions, don't hesitate to consult the documentation or reach out to the Wails community. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
version: '3' | ||
|
||
includes: | ||
common: ./build/Taskfile.yml | ||
windows: ./build/windows/Taskfile.yml | ||
darwin: ./build/darwin/Taskfile.yml | ||
linux: ./build/linux/Taskfile.yml | ||
|
||
vars: | ||
APP_NAME: "Notifications\\ Demo" | ||
BIN_DIR: "bin" | ||
VITE_PORT: '{{.WAILS_VITE_PORT | default 9245}}' | ||
|
||
tasks: | ||
build: | ||
summary: Builds the application | ||
cmds: | ||
- task: "{{OS}}:build" | ||
|
||
package: | ||
summary: Packages a production build of the application | ||
cmds: | ||
- task: "{{OS}}:package" | ||
|
||
run: | ||
summary: Runs the application | ||
cmds: | ||
- task: "{{OS}}:run" | ||
|
||
dev: | ||
summary: Runs the application in development mode | ||
cmds: | ||
- wails3 dev -config ./build/config.yml -port {{.VITE_PORT}} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
version: '3' | ||
|
||
tasks: | ||
go:mod:tidy: | ||
summary: Runs `go mod tidy` | ||
internal: true | ||
cmds: | ||
- go mod tidy | ||
|
||
install:frontend:deps: | ||
summary: Install frontend dependencies | ||
dir: frontend | ||
sources: | ||
- package.json | ||
- package-lock.json | ||
generates: | ||
- node_modules/* | ||
preconditions: | ||
- sh: npm version | ||
msg: "Looks like npm isn't installed. Npm is part of the Node installer: https://nodejs.org/en/download/" | ||
cmds: | ||
- npm install | ||
|
||
build:frontend: | ||
label: build:frontend (PRODUCTION={{.PRODUCTION}}) | ||
summary: Build the frontend project | ||
dir: frontend | ||
sources: | ||
- "**/*" | ||
generates: | ||
- dist/**/* | ||
deps: | ||
- task: install:frontend:deps | ||
- task: generate:bindings | ||
vars: | ||
BUILD_FLAGS: | ||
ref: .BUILD_FLAGS | ||
cmds: | ||
- npm run {{.BUILD_COMMAND}} -q | ||
env: | ||
PRODUCTION: '{{.PRODUCTION | default "false"}}' | ||
vars: | ||
BUILD_COMMAND: '{{if eq .PRODUCTION "true"}}build{{else}}build:dev{{end}}' | ||
|
||
|
||
generate:bindings: | ||
label: generate:bindings (BUILD_FLAGS={{.BUILD_FLAGS}}) | ||
summary: Generates bindings for the frontend | ||
deps: | ||
- task: go:mod:tidy | ||
sources: | ||
- "**/*.[jt]s" | ||
- exclude: frontend/**/* | ||
- frontend/bindings/**/* # Rerun when switching between dev/production mode causes changes in output | ||
- "**/*.go" | ||
- go.mod | ||
- go.sum | ||
generates: | ||
- frontend/bindings/**/* | ||
cmds: | ||
- wails3 generate bindings -f '{{.BUILD_FLAGS}}' -clean=true -ts | ||
|
||
generate:icons: | ||
summary: Generates Windows `.ico` and Mac `.icns` files from an image | ||
dir: build | ||
sources: | ||
- "appicon.png" | ||
generates: | ||
- "darwin/icons.icns" | ||
- "windows/icon.ico" | ||
cmds: | ||
- wails3 generate icons -input appicon.png -macfilename darwin/icons.icns -windowsfilename windows/icon.ico | ||
|
||
dev:frontend: | ||
summary: Runs the frontend in development mode | ||
dir: frontend | ||
deps: | ||
- task: install:frontend:deps | ||
cmds: | ||
- npm run dev -- --port {{.VITE_PORT}} --strictPort | ||
|
||
update:build-assets: | ||
summary: Updates the build assets | ||
dir: build | ||
cmds: | ||
- wails3 update build-assets -name "{{.APP_NAME}}" -binaryname "{{.APP_NAME}}" -config config.yml -dir . |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# This file contains the configuration for this project. | ||
# When you update `info` or `fileAssociations`, run `wails3 task common:update:build-assets` to update the assets. | ||
# Note that this will overwrite any changes you have made to the assets. | ||
version: '3' | ||
|
||
# This information is used to generate the build assets. | ||
info: | ||
companyName: "My Company" # The name of the company | ||
productName: "My Product" # The name of the application | ||
productIdentifier: "com.mycompany.myproduct" # The unique product identifier | ||
description: "A program that does X" # The application description | ||
copyright: "(c) 2025, My Company" # Copyright text | ||
comments: "Some Product Comments" # Comments | ||
version: "v0.0.1" # The application version | ||
|
||
# Dev mode configuration | ||
dev_mode: | ||
root_path: . | ||
log_level: warn | ||
debounce: 1000 | ||
ignore: | ||
dir: | ||
- .git | ||
- node_modules | ||
- frontend | ||
- bin | ||
file: | ||
- .DS_Store | ||
- .gitignore | ||
- .gitkeep | ||
watched_extension: | ||
- "*.go" | ||
git_ignore: true | ||
executes: | ||
- cmd: wails3 task common:install:frontend:deps | ||
type: once | ||
- cmd: wails3 task common:dev:frontend | ||
type: background | ||
- cmd: go mod tidy | ||
type: blocking | ||
- cmd: wails3 task build | ||
type: blocking | ||
- cmd: wails3 task run | ||
type: primary | ||
|
||
# File Associations | ||
# More information at: https://v3.wails.io/noit/done/yet | ||
fileAssociations: | ||
# - ext: wails | ||
# name: Wails | ||
# description: Wails Application File | ||
# iconName: wailsFileIcon | ||
# role: Editor | ||
# - ext: jpg | ||
# name: JPEG | ||
# description: Image File | ||
# iconName: jpegFileIcon | ||
# role: Editor | ||
|
||
# Other data | ||
other: | ||
- name: My Other Data |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleName</key> | ||
<string>My Product</string> | ||
<key>CFBundleExecutable</key> | ||
<string>Notifications Demo</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.wails.notifications-demo</string> | ||
<key>CFBundleVersion</key> | ||
<string>0.1.0</string> | ||
<key>CFBundleGetInfoString</key> | ||
<string>This is a comment</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>0.1.0</string> | ||
<key>CFBundleIconFile</key> | ||
<string>icons</string> | ||
<key>LSMinimumSystemVersion</key> | ||
<string>10.15.0</string> | ||
<key>NSHighResolutionCapable</key> | ||
<string>true</string> | ||
<key>NSHumanReadableCopyright</key> | ||
<string>© now, My Company</string> | ||
<key>NSAppTransportSecurity</key> | ||
<dict> | ||
<key>NSAllowsLocalNetworking</key> | ||
<true/> | ||
</dict> | ||
</dict> | ||
</plist> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleName</key> | ||
<string>My Product</string> | ||
<key>CFBundleExecutable</key> | ||
<string>Notifications Demo</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.wails.notifications-demo</string> | ||
<key>CFBundleVersion</key> | ||
<string>0.1.0</string> | ||
<key>CFBundleGetInfoString</key> | ||
<string>This is a comment</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>0.1.0</string> | ||
<key>CFBundleIconFile</key> | ||
<string>icons</string> | ||
<key>LSMinimumSystemVersion</key> | ||
<string>10.15.0</string> | ||
<key>NSHighResolutionCapable</key> | ||
<string>true</string> | ||
<key>NSHumanReadableCopyright</key> | ||
<string>© now, My Company</string> | ||
</dict> | ||
</plist> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
version: '3' | ||
|
||
includes: | ||
common: ../Taskfile.yml | ||
|
||
tasks: | ||
build: | ||
summary: Creates a production build of the application | ||
deps: | ||
- task: common:go:mod:tidy | ||
- task: common:build:frontend | ||
vars: | ||
BUILD_FLAGS: | ||
ref: .BUILD_FLAGS | ||
PRODUCTION: | ||
ref: .PRODUCTION | ||
- task: common:generate:icons | ||
cmds: | ||
- go build {{.BUILD_FLAGS}} -o {{.OUTPUT}} | ||
vars: | ||
BUILD_FLAGS: '{{if eq .PRODUCTION "true"}}-tags production -trimpath -buildvcs=false -ldflags="-w -s"{{else}}-buildvcs=false -gcflags=all="-l"{{end}}' | ||
DEFAULT_OUTPUT: '{{.BIN_DIR}}/{{.APP_NAME}}' | ||
OUTPUT: '{{ .OUTPUT | default .DEFAULT_OUTPUT }}' | ||
env: | ||
GOOS: darwin | ||
CGO_ENABLED: 1 | ||
GOARCH: '{{.ARCH | default ARCH}}' | ||
CGO_CFLAGS: "-mmacosx-version-min=10.15" | ||
CGO_LDFLAGS: "-mmacosx-version-min=10.15" | ||
MACOSX_DEPLOYMENT_TARGET: "10.15" | ||
PRODUCTION: '{{.PRODUCTION | default "false"}}' | ||
Comment on lines
+25
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainVerify macOS version compatibility with notifications API There's a potential version mismatch. The PR objectives state that macOS 11.0 is the minimum required version for notifications, but the build settings target macOS 10.15. 🏁 Script executed: #!/bin/bash
# Check if notifications API requires macOS 11.0 as stated in PR objectives
echo "Checking if UNNotification API requires macOS 11.0"
find . -type f -name "*.go" | xargs grep -l "UNNotification" | xargs grep -A 5 -B 5 "darwin" Length of output: 6136 Action Required: Update macOS Deployment Target in Taskfile.yml The build configuration in
|
||
|
||
build:universal: | ||
summary: Builds darwin universal binary (arm64 + amd64) | ||
deps: | ||
- task: build | ||
vars: | ||
ARCH: amd64 | ||
OUTPUT: "{{.BIN_DIR}}/{{.APP_NAME}}-amd64" | ||
- task: build | ||
vars: | ||
ARCH: arm64 | ||
OUTPUT: "{{.BIN_DIR}}/{{.APP_NAME}}-arm64" | ||
cmds: | ||
- lipo -create -output "{{.BIN_DIR}}/{{.APP_NAME}}" "{{.BIN_DIR}}/{{.APP_NAME}}-amd64" "{{.BIN_DIR}}/{{.APP_NAME}}-arm64" | ||
- rm "{{.BIN_DIR}}/{{.APP_NAME}}-amd64" "{{.BIN_DIR}}/{{.APP_NAME}}-arm64" | ||
|
||
package: | ||
summary: Packages a production build of the application into a `.app` bundle | ||
deps: | ||
- task: build | ||
vars: | ||
PRODUCTION: "true" | ||
cmds: | ||
- task: create:app:bundle | ||
|
||
package:universal: | ||
summary: Packages darwin universal binary (arm64 + amd64) | ||
deps: | ||
- task: build:universal | ||
cmds: | ||
- task: create:app:bundle | ||
|
||
|
||
create:app:bundle: | ||
summary: Creates an `.app` bundle | ||
cmds: | ||
- mkdir -p {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents/{MacOS,Resources} | ||
- cp build/darwin/icons.icns {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents/Resources | ||
- cp {{.BIN_DIR}}/{{.APP_NAME}} {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents/MacOS | ||
- cp build/darwin/Info.plist {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents | ||
|
||
run: | ||
cmds: | ||
- mkdir -p {{.BIN_DIR}}/dev/{{.APP_NAME}}.app/Contents/{MacOS,Resources} | ||
- cp build/darwin/icons.icns {{.BIN_DIR}}/dev/{{.APP_NAME}}.app/Contents/Resources | ||
- cp {{.BIN_DIR}}/{{.APP_NAME}} {{.BIN_DIR}}/dev/{{.APP_NAME}}.app/Contents/MacOS | ||
- cp build/darwin/Info.dev.plist {{.BIN_DIR}}/dev/{{.APP_NAME}}.app/Contents/Info.plist | ||
- codesign --force --deep --sign - {{.BIN_DIR}}/dev/{{.APP_NAME}}.app | ||
- '{{.BIN_DIR}}/dev/{{.APP_NAME}}.app/Contents/MacOS/{{.APP_NAME}}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Double-check documentation URL.
The URL points to the Wails3 documentation which is still in development. Verify that this URL will be valid when the PR is merged.
🌐 Web query:
💡 Result:
The URL https://v3.wails.io/ does not appear to be valid or referenced in the official Wails v3 documentation. Based on search results, the correct URL for Wails v3 documentation is https://v3alpha.wails.io/, which is actively maintained and referenced in multiple guides and release notes[1][4][7][10][13].
This distinction is important because:
v3alpha
subdomain[1][4][7]v3alpha
prefix reflects the alpha status of the current v3 release[1][6]v3alpha
URLs[16][17]For developers working with Wails v3, the valid documentation URL is https://v3alpha.wails.io/. This aligns with the project's current pre-release status and matches all official references in March 2025 documentation[1][4][13].
Citations:
Update Documentation URL
The documentation link in
v3/examples/notifications/README.md
(line 39) currently points tohttps://v3.wails.io/
, which is not valid for Wails v3. Please update it tohttps://v3alpha.wails.io/
to align with the official, maintained documentation references.