Skip to content

Commit 1ec3b4e

Browse files
committed
v3.0.0-alpha.4
1 parent 6e2bbe3 commit 1ec3b4e

File tree

8 files changed

+109
-26
lines changed

8 files changed

+109
-26
lines changed
+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Runtime
2+
3+
The Wails runtime is the standard library for Wails applications. It provides a number of features that may
4+
be used in your applications, including:
5+
6+
- Window management
7+
- Dialogs
8+
- Browser integration
9+
- Clipboard
10+
- Frameless dragging
11+
- Tray icons
12+
- Menu management
13+
- System information
14+
- Events
15+
- Calling Go code
16+
- Context Menus
17+
- Screens
18+
- WML (Wails Markup Language)
19+
20+
The runtime is required for integration between Go and the frontend. There are 2 ways to integrate the runtime:
21+
22+
- Using the `@wailsio/runtime` package
23+
- Using a pre-built version of the runtime
24+
25+
## Using the `@wailsio/runtime` package
26+
27+
The `@wailsio/runtime` package is a JavaScript package that provides access to the Wails runtime. It is used in by all
28+
the standard templates and is the recommended way to integrate the runtime into your application. By using the package,
29+
you will only include the parts of the runtime that you use.
30+
31+
The package is available on npm and can be installed using:
32+
33+
```shell
34+
npm install --save @wailsio/runtime
35+
```
36+
37+
## Using a pre-built version of the runtime
38+
39+
Some projects will not use a Javascript bundler and may prefer to use a pre-built version of the runtime. This is
40+
the default for the examples in `v3/examples`. The pre-built version of the runtime can be generated using the
41+
following command:
42+
43+
```shell
44+
wails3 generate runtime
45+
```
46+
47+
This will generate a `runtime.js` (and `runtime.debug.js`) file in the `frontend` directory of your project.
48+
This file can be included in your assets directory and used in your application by adding it to your assets
49+
directory (normally `frontend/dist`) and then including it in your HTML:
50+
51+
```html
52+
<html>
53+
<head>
54+
<script src="/runtime.js"></script>
55+
</head>
56+
<!--- ... -->
57+
</>
58+
```

mkdocs-website/docs/en/roadmap.md

+17-19
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,23 @@ we are aiming to achieve. These are subject to change.
1010

1111
## Alpha milestones
1212

13-
### Current: Alpha 4
13+
### Current: Alpha 5
14+
15+
#### Goals
16+
17+
- [ ] Get Linux to Alpha 4 parity
18+
- [ ] Keyboard shortcuts
19+
- Window Level shortcuts
20+
- Application Level shortcuts (applies to all windows)
21+
- Ensure Keydown/Keyup events are sent to JS if not handled by Go
22+
23+
## Upcoming milestones
24+
25+
## Alpha 6
26+
27+
## Previous milestones
28+
29+
### Alpha 4 - Completed 2024-02-01
1430

1531
#### Goals
1632

@@ -135,24 +151,6 @@ Examples:
135151

136152
- [ ] All examples working on Linux
137153

138-
## Upcoming milestones
139-
140-
### Alpha 4
141-
142-
#### Goals
143-
144-
145-
### Alpha 5
146-
147-
#### Goals
148-
149-
- [ ] Keyboard shortcuts
150-
- Window Level shortcuts
151-
- Application Level shortcuts (applies to all windows)
152-
- Ensure Keydown/Keyup events are sent to JS if not handled by Go
153-
154-
## Previous milestones
155-
156154
### Alpha 2
157155

158156
#### Goals

mkdocs-website/mkdocs.yml

+2
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ nav:
150150
# - Links: community/links.md
151151
- Your First Application: getting-started/your-first-app.md
152152
- Next Steps: getting-started/next-steps.md
153+
- Learn More:
154+
- Runtime: getting-started/learn.md
153155
- Feedback: getting-started/feedback.md
154156
- Feedback: getting-started/feedback.md
155157
- What's New in v3?: whats-new.md

mkdocs-website/shared/alpha3-bindings-callbyname.csv

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Scenario,Windows,Mac,Linux
2-
Same package,:material-check-bold:,:material-check-bold:,:material-check-bold:
2+
Same package,: clipboardLock.RLock()
3+
defer clipboardLock.RUnlock()
4+
clipboardText := C.getClipboardText()
5+
result := C.GoString(clipboardText)
6+
return result, true:,:material-check-bold:,:material-check-bold:
37
Different package,:material-check-bold:,:material-check-bold:,:material-check-bold:
48
Different package with same name,"on hold","on hold","on hold"
59
Containing another struct from same package,:material-check-bold:,:material-check-bold:,:material-check-bold:
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
" ",Mac,Windows,Linux
2-
Standard Executable," "," "," "
3-
macOS Application Bundle," ",:material-cancel:,:material-cancel:
4-
NSIS," "," "," "
5-
macOS DMG," ",:material-cancel:,:material-cancel:
2+
Standard Executable,:material-check-bold:,:material-check-bold:,:material-check-bold:
3+
macOS Application Bundle,:material-check-bold:,:material-cancel:,:material-cancel:
4+
NSIS,:material-cancel:,:material-check-bold:,:material-cancel:

v3/cmd/wails3/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func main() {
4646
generate.NewSubCommandFunction("constants", "Generate JS constants from Go", commands.GenerateConstants)
4747
generate.NewSubCommandFunction(".desktop", "Generate .desktop file", commands.GenerateDotDesktop)
4848
generate.NewSubCommandFunction("appimage", "Generate Linux AppImage", commands.GenerateAppImage)
49+
generate.NewSubCommandFunction("runtime", "Generate the latest compiled runtime", commands.GenerateRuntime)
4950

5051
plugin := app.NewSubCommand("plugin", "Plugin tools")
5152
//plugin.NewSubCommandFunction("list", "List plugins", commands.PluginList)

v3/internal/commands/build_assets/runtime/compiled.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package runtime
33
import _ "embed"
44

55
//go:embed runtime.js
6-
var runtimeJS []byte
6+
var RuntimeJS []byte
77

88
//go:embed runtime.debug.js
9-
var runtimeDebugJS []byte
9+
var RuntimeDebugJS []byte

v3/internal/commands/runtime.go

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package commands
2+
3+
import (
4+
"github.com/wailsapp/wails/v3/internal/commands/build_assets/runtime"
5+
"os"
6+
)
7+
8+
type GenerateRuntimeOptions struct {
9+
}
10+
11+
func GenerateRuntime(options *GenerateRuntimeOptions) error {
12+
err := os.WriteFile("runtime.js", runtime.RuntimeJS, 0644)
13+
if err != nil {
14+
return err
15+
}
16+
err = os.WriteFile("runtime.debug.js", runtime.RuntimeDebugJS, 0644)
17+
if err != nil {
18+
return err
19+
}
20+
return nil
21+
}

0 commit comments

Comments
 (0)