Skip to content

Commit f87dce1

Browse files
committed
Merge branch 'v3-alpha' into fork/fbbdev/v3-alpha-feature/service-api
# Conflicts: # docs/src/content/docs/changelog.mdx # v3/examples/services/assets/bindings/github.com/wailsapp/wails/v3/pkg/services/kvstore/keyvaluestore.js # v3/examples/services/assets/bindings/github.com/wailsapp/wails/v3/pkg/services/log/loggerservice.js # v3/examples/services/assets/bindings/github.com/wailsapp/wails/v3/pkg/services/sqlite/service.js
2 parents 82ed0e6 + d130544 commit f87dce1

File tree

747 files changed

+19780
-10997
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

747 files changed

+19780
-10997
lines changed

.github/workflows/build-and-test-v3.yml

+98-30
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ name: Build + Test v3
33
on:
44
pull_request:
55
types: [opened, synchronize, reopened, ready_for_review]
6+
branches:
7+
- v3-alpha
68
pull_request_review:
79
types: [submitted]
10+
branches:
11+
- v3-alpha
812

913
jobs:
1014
check_approval:
@@ -22,14 +26,72 @@ jobs:
2226
echo "approved=false" >> $GITHUB_OUTPUT
2327
fi
2428
25-
test_go:
26-
name: Run Go Tests
29+
test_js:
30+
name: Run JS Tests
2731
needs: check_approval
32+
runs-on: ubuntu-latest
33+
strategy:
34+
matrix:
35+
node-version: [20.x]
36+
37+
steps:
38+
- name: Checkout code
39+
uses: actions/checkout@v4
40+
41+
- name: Use Node.js ${{ matrix.node-version }}
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version: ${{ matrix.node-version }}
45+
46+
- name: Install Task
47+
uses: arduino/setup-task@v2
48+
with:
49+
version: 3.x
50+
repo-token: ${{ secrets.GITHUB_TOKEN }}
51+
52+
- name: Install dependencies
53+
working-directory: v3/internal/runtime/desktop/@wailsio/runtime
54+
run: |
55+
npm ci
56+
npx --yes esbuild@latest --version
57+
58+
- name: Clean build artifacts
59+
working-directory: v3/internal/runtime/desktop/@wailsio/runtime
60+
run: npm run clean
61+
62+
- name: Type-check runtime
63+
working-directory: v3
64+
run: task runtime:check
65+
66+
- name: Test runtime
67+
working-directory: v3
68+
run: task runtime:test
69+
70+
- name: Check that the bundled runtime builds
71+
working-directory: v3
72+
run: task runtime:build
73+
74+
- name: Check that the npm package builds
75+
working-directory: v3/internal/runtime/desktop/@wailsio/runtime
76+
run: npm run build
77+
78+
- name: Store runtime build artifacts
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: runtime-build-artifacts
82+
path: |
83+
v3/internal/runtime/desktop/@wailsio/runtime/dist/
84+
v3/internal/runtime/desktop/@wailsio/runtime/types/
85+
v3/internal/runtime/desktop/@wailsio/runtime/tsconfig.tsbuildinfo
86+
87+
test_go:
88+
name: Run Go Tests v3
89+
needs: [check_approval, test_js]
2890
runs-on: ${{ matrix.os }}
2991
strategy:
3092
fail-fast: false
3193
matrix:
32-
os: [windows-latest, macos-latest, ubuntu-latest]
94+
os: [warp-windows-latest-x64-2x, warp-macos-15-arm64-6x, warp-ubuntu-latest-x64-2x]
3395
go-version: [1.24]
3496

3597
steps:
@@ -55,25 +117,31 @@ jobs:
55117
version: 3.x
56118
repo-token: ${{ secrets.GITHUB_TOKEN }}
57119

120+
- name: Retrieve runtime build artifacts
121+
uses: actions/download-artifact@v4
122+
with:
123+
name: runtime-build-artifacts
124+
path: v3/internal/runtime/desktop/@wailsio/runtime/
125+
58126
- name: Build Examples
59-
working-directory: ./v3
127+
working-directory: v3
60128
run: task test:examples
61129

62130
- name: Run tests (mac)
63131
if: matrix.os == 'macos-latest'
64132
env:
65133
CGO_LDFLAGS: -framework UniformTypeIdentifiers -mmacosx-version-min=10.13
66-
working-directory: ./v3
134+
working-directory: v3
67135
run: go test -v ./...
68136

69137
- name: Run tests (windows)
70138
if: matrix.os == 'windows-latest'
71-
working-directory: ./v3
139+
working-directory: v3
72140
run: go test -v ./...
73141

74142
- name: Run tests (ubuntu)
75143
if: matrix.os == 'ubuntu-latest'
76-
working-directory: ./v3
144+
working-directory: v3
77145
run: >
78146
xvfb-run --auto-servernum
79147
sh -c '
@@ -82,33 +150,19 @@ jobs:
82150
'
83151
84152
- name: Typecheck binding generator output
85-
working-directory: ./v3
153+
working-directory: v3
86154
run: task generator:test:check
87155

88-
test_js:
89-
name: Run JS Tests
90-
needs: check_approval
156+
cleanup:
157+
name: Cleanup build artifacts
158+
if: always()
159+
needs: [test_js, test_go]
91160
runs-on: ubuntu-latest
92-
strategy:
93-
matrix:
94-
node-version: [20.x]
95-
96161
steps:
97-
- name: Checkout code
98-
uses: actions/checkout@v4
99-
100-
- name: Use Node.js ${{ matrix.node-version }}
101-
uses: actions/setup-node@v4
162+
- uses: geekyeggo/delete-artifact@v5
102163
with:
103-
node-version: ${{ matrix.node-version }}
104-
105-
- name: Install dependencies
106-
run: npm install
107-
working-directory: v2/internal/frontend/runtime
108-
109-
- name: Run tests
110-
run: npm test
111-
working-directory: v2/internal/frontend/runtime
164+
name: runtime-build-artifacts
165+
failOnError: false
112166

113167
test_templates:
114168
name: Test Templates
@@ -156,7 +210,7 @@ jobs:
156210
repo-token: ${{ secrets.GITHUB_TOKEN }}
157211

158212
- name: Build Wails3 CLI
159-
working-directory: ./v3
213+
working-directory: v3
160214
run: |
161215
task install
162216
wails3 doctor
@@ -168,3 +222,17 @@ jobs:
168222
wails3 init -n ${{ matrix.template }} -t ${{ matrix.template }}
169223
cd ${{ matrix.template }}
170224
wails3 build
225+
226+
results:
227+
if: ${{ always() }}
228+
runs-on: ubuntu-latest
229+
name: v3 Build Results
230+
needs: [test_go, test_js, test_templates]
231+
steps:
232+
- run: |
233+
result="${{ needs.build.result }}"
234+
if [[ $result == "success" || $result == "skipped" ]]; then
235+
exit 0
236+
else
237+
exit 1
238+
fi

.github/workflows/pr.yml

+4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ name: PR Checks
22

33
on:
44
pull_request:
5+
branches:
6+
- master
57
pull_request_review:
68
types: [submitted]
9+
branches:
10+
- master
711

812
jobs:
913
check_docs:

.github/workflows/publish-npm.yml

+80-29
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,113 @@
11
on:
22
push:
33
branches: ['v3-alpha']
4+
workflow_dispatch:
5+
6+
concurrency:
7+
group: publish-npm-v3
8+
cancel-in-progress: true
49

510
jobs:
6-
publish:
11+
detect:
12+
name: Detect committed changes
13+
if: github.event_name != 'workflow_dispatch'
14+
outputs:
15+
changed: ${{ steps.package-json-changes.outputs.any_modified == 'true' || steps.source-changes.outputs.any_modified == 'true' }}
716
runs-on: ubuntu-latest
817
steps:
9-
- uses: actions/checkout@v4
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
with:
21+
ref: ${{ github.sha }}
22+
persist-credentials: 'true'
23+
24+
- name: Detect committed package.json changes
25+
id: package-json-changes
26+
uses: tj-actions/changed-files@v45
27+
with:
28+
files: |
29+
v3/internal/runtime/desktop/@wailsio/runtime/package.json
30+
31+
- name: Detect committed source changes
32+
if: >-
33+
steps.package-json-changes.outputs.any_modified != 'true'
34+
id: source-changes
35+
uses: tj-actions/changed-files@v45
36+
with:
37+
files: |
38+
v3/internal/runtime/Taskfile.yaml
39+
v3/internal/runtime/desktop/@wailsio/compiled/main.js
40+
v3/internal/runtime/desktop/@wailsio/runtime/tsconfig.json
41+
v3/internal/runtime/desktop/@wailsio/runtime/src/**
42+
v3/pkg/events/events.txt
43+
v3/tasks/events/**
44+
45+
rebuild_and_publish:
46+
name: Rebuild and publish
47+
needs: [detect]
48+
if: >-
49+
!failure() && !cancelled()
50+
&& (github.event_name == 'workflow_dispatch' || needs.detect.outputs.changed == 'true')
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Checkout code
54+
uses: actions/checkout@v4
1055
with:
1156
fetch-depth: 0
1257
ref: 'v3-alpha'
1358
ssh-key: ${{ secrets.DEPLOY_KEY }}
1459

15-
1660
- name: Configure git
1761
run: |
1862
git config --local user.email "[email protected]"
1963
git config --local user.name "GitHub Actions"
2064
21-
- name: Setup go-task
22-
uses: pnorton5432/setup-task@v1
65+
- name: Install Task
66+
uses: arduino/setup-task@v2
2367
with:
24-
task-version: 3.29.1
68+
version: 3.x
69+
repo-token: ${{ secrets.GITHUB_TOKEN }}
2570

26-
- uses: actions/setup-node@v3
71+
- name: Use Node.js 20
72+
uses: actions/setup-node@v4
2773
with:
2874
node-version: "20"
29-
- run: |
75+
76+
- name: Install dependencies
77+
working-directory: v3/internal/runtime/desktop/@wailsio/runtime
78+
run: |
3079
npm ci
31-
npm run build:types
32-
npm run build:docs
80+
npx --yes esbuild@latest --version
81+
82+
- name: Clean build artifacts
3383
working-directory: v3/internal/runtime/desktop/@wailsio/runtime
84+
run: npm run clean
3485

35-
- name: Verify Changed files
36-
uses: tj-actions/verify-changed-files@v20
37-
id: verify-changed-files
38-
with:
39-
files: |
40-
v3/internal/runtime/desktop/@wailsio/runtime/src/*.js
41-
v3/internal/runtime/desktop/@wailsio/runtime/types/*.d.ts
42-
v3/internal/runtime/desktop/@wailsio/runtime/docs/**/*.*
43-
44-
- name: test action
45-
if: steps.verify-changed-files.outputs.files_changed == 'true'
46-
id: get-version
47-
uses: beaconbrigade/[email protected]
48-
with:
49-
path: v3/internal/runtime/desktop/@wailsio/runtime
86+
- name: Build bundled runtime
87+
working-directory: v3
88+
run: task runtime:build
89+
90+
- name: Test+Build npm package
91+
working-directory: v3/internal/runtime/desktop/@wailsio/runtime
92+
run: |
93+
npm test
94+
npm run build
95+
96+
- name: Bump version
97+
id: bump-version
98+
working-directory: v3/internal/runtime/desktop/@wailsio/runtime
99+
run: |
100+
echo "version=$(npm --no-git-tag-version --force version prerelease)" >> "$GITHUB_OUTPUT"
50101
51102
- name: Commit changes
52-
if: steps.verify-changed-files.outputs.files_changed == 'true'
53103
run: |
54104
git add .
55-
git commit -m "[skip ci] Publish @wailsio/runtime ${{ steps.get-version.outputs.version }}"
105+
git commit -m "[skip ci] Publish @wailsio/runtime ${{ steps.bump-version.outputs.version }}"
56106
git push
107+
fi
57108
58-
- uses: JS-DevTools/npm-publish@v3
59-
if: steps.verify-changed-files.outputs.files_changed == 'true'
109+
- name: Publish npm package
110+
uses: JS-DevTools/npm-publish@v3
60111
with:
61112
package: v3/internal/runtime/desktop/@wailsio/runtime
62113
access: public

docs/src/content/docs/changelog.mdx

+12
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5353
- Add `//wails:ignore` directive to prevent binding generation for chosen service methods by [@fbbdev](https://github.com/fbbdev) in [#4045](https://github.com/wailsapp/wails/pull/4045)
5454
- Add `//wails:internal` directive on services and models to allow for types that are exported in Go but not in JS/TS by [@fbbdev](https://github.com/fbbdev) in [#4045](https://github.com/wailsapp/wails/pull/4045)
5555
- Add binding generator support for constants of alias type to allow for weakly typed enums by [@fbbdev](https://github.com/fbbdev) in [#4045](https://github.com/wailsapp/wails/pull/4045)
56+
- Add binding generator tests for Go 1.24 features by [@fbbdev](https://github.com/fbbdev) in [#4068](https://github.com/wailsapp/wails/pull/4068)
5657
- Add support for macOS 15 "Sequoia" to `OSInfo.Branding` for improved OS version detection in [#4065](https://github.com/wailsapp/wails/pull/4065)
5758
- Add `PostShutdown` hook for running custom code after the shutdown process completes by [@fbbdev](https://github.com/fbbdev) in [#4066](https://github.com/wailsapp/wails/pull/4066)
5859
- Add `FatalError` struct to support detection of fatal errors in custom error handlers by [@fbbdev](https://github.com/fbbdev) in [#4066](https://github.com/wailsapp/wails/pull/4066)
5960
- Standardise and document service startup and shutdown order by [@fbbdev](https://github.com/fbbdev) in [#4066](https://github.com/wailsapp/wails/pull/4066)
6061
- Add test harness for application startup/shutdown sequence and service startup/shutdown tests by [@fbbdev](https://github.com/fbbdev) in [#4066](https://github.com/wailsapp/wails/pull/4066)
6162
- Add `RegisterService` method for registering services after the application has been created by [@fbbdev](https://github.com/fbbdev) in [#4066](https://github.com/wailsapp/wails/pull/4066)
6263
- Add `MarshalError` field in application and service options for custom error handling in binding calls by [@fbbdev](https://github.com/fbbdev) in [#4066](https://github.com/wailsapp/wails/pull/4066)
64+
- Add cancellable promise wrapper that propagates cancellation requests through promise chains by [@fbbdev](https://github.com/fbbdev) in [#4100](https://github.com/wailsapp/wails/pull/4100)
65+
- Add the ability to tie binding call cancellation to an `AbortSignal` by [@fbbdev](https://github.com/fbbdev) in [#4100](https://github.com/wailsapp/wails/pull/4100)
66+
- Support `data-wml-*` attributes for WML alongside the usual `wml-*` attributes by [@leaanthony](https://github.com/leaanthony)
6367
- Add `Configure` method on all services for late configuration/dynamic reconfiguration by [@fbbdev](https://github.com/fbbdev) in [#4067](https://github.com/wailsapp/wails/pull/4067)
6468
- `fileserver` service sends a 503 Service Unavailable response when unconfigured by [@fbbdev](https://github.com/fbbdev) in [#4067](https://github.com/wailsapp/wails/pull/4067)
6569
- `kvstore` service provides an in-memory key-value store by default when unconfigured by [@fbbdev](https://github.com/fbbdev) in [#4067](https://github.com/wailsapp/wails/pull/4067)
@@ -100,6 +104,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
100104
- Fixed hidden menu items on macOS by [@leaanthony](https://github.com/leaanthony)
101105
- Fixed handling and formatting of errors in message processors by [@fbbdev](https://github.com/fbbdev) in [#4066](https://github.com/wailsapp/wails/pull/4066)
102106
-  Fixed skipped service shutdown when quitting application by [@fbbdev](https://github.com/fbbdev) in [#4066](https://github.com/wailsapp/wails/pull/4066)
107+
-  Ensure menu updates occur on the main thread by [@leaanthony](https://github.com/leaanthony)
108+
- The dragging and resizing mechanism is now more robust and matches expected platform behaviour more closely by [@fbbdev](https://github.com/fbbdev) in [#4100](https://github.com/wailsapp/wails/pull/4100)
109+
- Fixed [#4097](https://github.com/wailsapp/wails/issues/4097) Webpack/angular discards runtime init code by [@fbbdev](https://github.com/fbbdev) in [#4100](https://github.com/wailsapp/wails/pull/4100)
103110

104111
### Changed
105112

@@ -120,6 +127,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
120127
- `ServiceStartup` hooks are now invoked when `App.Run` is called, not in `application.New` by [@fbbdev](https://github.com/fbbdev) in [#4066](https://github.com/wailsapp/wails/pull/4066)
121128
- `ServiceStartup` errors are now returned from `App.Run` instead of terminating the process by [@fbbdev](https://github.com/fbbdev) in [#4066](https://github.com/wailsapp/wails/pull/4066)
122129
- Binding and dialog calls from JS now reject with error objects instead of strings by [@fbbdev](https://github.com/fbbdev) in [#4066](https://github.com/wailsapp/wails/pull/4066)
130+
- Improved systray menu positioning on Windows by [@leaanthony](https://github.com/leaanthony)
131+
- The JS runtime has been ported to TypeScript by [@fbbdev](https://github.com/fbbdev) in [#4100](https://github.com/wailsapp/wails/pull/4100)
132+
- The runtime initialises as soon as it is imported, no need to wait for the window to load by [@fbbdev](https://github.com/fbbdev) in [#4100](https://github.com/wailsapp/wails/pull/4100)
133+
- The runtime does not export an init method anymore. A side effects import can be used to initialise it by [@fbbdev](https://github.com/fbbdev) in [#4100](https://github.com/wailsapp/wails/pull/4100)
134+
- Bound methods now return a `CancellablePromise` that rejects with a `CancelError` if cancelled. The actual result of the call is discarded by [@fbbdev](https://github.com/fbbdev) in [#4100](https://github.com/wailsapp/wails/pull/4100)
123135
- Built-in service types are now consistently called `Service` by [@fbbdev](https://github.com/fbbdev) in [#4067](https://github.com/wailsapp/wails/pull/4067)
124136
- Built-in service creation functions with options are now consistently called `NewWithConfig` by [@fbbdev](https://github.com/fbbdev) in [#4067](https://github.com/wailsapp/wails/pull/4067)
125137
- `Select` method on `sqlite` service is now named `Query` for consistency with Go APIs by [@fbbdev](https://github.com/fbbdev) in [#4067](https://github.com/wailsapp/wails/pull/4067)

0 commit comments

Comments
 (0)