Merge branch 'v2-alpha' into 796-support-browseropenurl

This commit is contained in:
Lea Anthony
2021-09-13 20:21:59 +10:00
committed by GitHub
10 changed files with 38 additions and 36 deletions
+9 -5
View File
@@ -1,6 +1,6 @@
name: Runtime
on:
pull_request:
push:
branches:
- v2-alpha
paths:
@@ -14,14 +14,18 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: 14.17.6
# cache: 'npm'
# cache-dependency-path: v2/internal/frontend/runtime/package-lock.json
cache: 'npm'
cache-dependency-path: v2/internal/frontend/runtime/package-lock.json
- run: npm install
working-directory: v2/internal/frontend/runtime
- run: npm run build
working-directory: v2/internal/frontend/runtime
- name: Commit changes
uses: elstudio/actions-js-build/commit@v4
uses: devops-infra/action-commit-push@master
with:
commitMessage: Rebuild runtime
github_token: "${{ secrets.GITHUB_TOKEN }}"
add_timestamp: true
commit_prefix: "[AUTO]"
commit_message: "The runtime was rebuilt"
target_branch: v2-alpha
+2 -1
View File
@@ -2,4 +2,5 @@
This branch contains WORK IN PROGRESS! There are no guarantees. Use at your peril!
This document will be updated as progress is made.
This document will be updated as progress is made.
@@ -38,6 +38,9 @@ func (d *Dispatcher) ProcessMessage(message string, sender frontend.Frontend) (s
return d.processWindowMessage(message, sender)
case 'B':
return d.processBrowserMessage(message, sender)
case 'Q':
sender.Quit()
return "", nil
default:
return "", errors.New("Unknown message from front end: " + message)
}
@@ -71,8 +71,6 @@ func (d *Dispatcher) processWindowMessage(message string, sender frontend.Fronte
w := d.mustAtoI(parts[0])
h := d.mustAtoI(parts[1])
go sender.WindowSetMinSize(w, h)
case 'C':
sender.Quit()
default:
d.log.Error("unknown Window message: %s", message)
}
@@ -15,6 +15,11 @@ import { SetBindings } from "./bindings";
import * as Window from "./window";
import * as Browser from "./browser";
export function Quit() {
window.WailsInvoke('Q');
}
// The JS runtime
window.runtime = {
...Log,
@@ -25,6 +30,7 @@ window.runtime = {
EventsOnMultiple,
EventsEmit,
EventsOff,
Quit
};
// Internal wails endpoints
@@ -185,12 +185,3 @@ export function WindowSetRGBA(RGBA) {
window.WailsInvoke('Wr:' + rgba);
}
/**
* Close the Window
*
* @export
*/
export function WindowClose() {
window.WailsInvoke('WC');
}
File diff suppressed because one or more lines are too long
+7 -1
View File
@@ -14,9 +14,15 @@ import * as Events from './events';
import * as Window from './window';
import * as Browser from './browser';
export function Quit() {
window.runtime.Quit();
}
export default {
...Log,
...Events,
...Window,
...Browser
...Browser,
Quit
};
+3 -3
View File
@@ -71,11 +71,11 @@ interface runtime {
WindowUnminimise(): void
WindowSetRGBA(rgba: RGBA): void;
WindowClose(): void
WindowSetRGBA(rgba: RGBA): void
BrowserOpenURL(): void
Quit(): void
}
declare global {
@@ -185,12 +185,3 @@ export function WindowUnminimise() {
export function WindowSetRGBA(RGBA) {
window.runtime.WindowSetRGBA(RGBA);
}
/**
* Close the Window
*
* @export
*/
export function WindowClose() {
window.runtime.WindowClose();
}