From b15d98b555a08db8579439cdfc8c5be6089bd376 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Mon, 4 Oct 2021 16:53:27 +1100 Subject: [PATCH] [v2] Rename noautoinjectbindings -> noautoinjectipc --- .../assetserver/assetserver_browser_dev.go | 2 +- .../frontend/assetserver/assetserver_desktop.go | 2 +- v2/internal/frontend/assetserver/common.go | 16 ++++++++-------- v2/internal/frontend/assetserver/common_test.go | 10 +++++----- website/docs/guides/frontend.mdx | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/v2/internal/frontend/assetserver/assetserver_browser_dev.go b/v2/internal/frontend/assetserver/assetserver_browser_dev.go index ffe758c49..eda7626db 100644 --- a/v2/internal/frontend/assetserver/assetserver_browser_dev.go +++ b/v2/internal/frontend/assetserver/assetserver_browser_dev.go @@ -63,7 +63,7 @@ func (a *BrowserAssetServer) processIndexHTML() ([]byte, error) { return nil, err } } - if wailsOptions.disableBindingsInjection == false { + if wailsOptions.disableIPCInjection == false { indexHTML, err = injectHTML(string(indexHTML), ``) if err != nil { return nil, err diff --git a/v2/internal/frontend/assetserver/assetserver_desktop.go b/v2/internal/frontend/assetserver/assetserver_desktop.go index 2127e767b..1ec4a7532 100644 --- a/v2/internal/frontend/assetserver/assetserver_desktop.go +++ b/v2/internal/frontend/assetserver/assetserver_desktop.go @@ -125,7 +125,7 @@ func (a *DesktopAssetServer) processIndexHTML() ([]byte, error) { return nil, err } } - if wailsOptions.disableBindingsInjection == false { + if wailsOptions.disableIPCInjection == false { indexHTML, err = injectHTML(string(indexHTML), ``) if err != nil { return nil, err diff --git a/v2/internal/frontend/assetserver/common.go b/v2/internal/frontend/assetserver/common.go index 1d9c270ef..abc30b7c1 100644 --- a/v2/internal/frontend/assetserver/common.go +++ b/v2/internal/frontend/assetserver/common.go @@ -10,14 +10,14 @@ import ( type optionType string const ( - noAutoInject optionType = "noautoinject" - noAutoInjectRuntime optionType = "noautoinjectruntime" - noAutoInjectBindings optionType = "noautoinjectbindings" + noAutoInject optionType = "noautoinject" + noAutoInjectRuntime optionType = "noautoinjectruntime" + noautoinjectipc optionType = "noautoinjectipc" ) type Options struct { - disableRuntimeInjection bool - disableBindingsInjection bool + disableRuntimeInjection bool + disableIPCInjection bool } func newOptions(optionString string) *Options { @@ -28,9 +28,9 @@ func newOptions(optionString string) *Options { switch optionType(strings.TrimSpace(option)) { case noAutoInject: result.disableRuntimeInjection = true - result.disableBindingsInjection = true - case noAutoInjectBindings: - result.disableBindingsInjection = true + result.disableIPCInjection = true + case noautoinjectipc: + result.disableIPCInjection = true case noAutoInjectRuntime: result.disableRuntimeInjection = true } diff --git a/v2/internal/frontend/assetserver/common_test.go b/v2/internal/frontend/assetserver/common_test.go index 2c20b672e..a60e1e12f 100644 --- a/v2/internal/frontend/assetserver/common_test.go +++ b/v2/internal/frontend/assetserver/common_test.go @@ -33,8 +33,8 @@ func genMeta(content string) []byte { func genOptions(runtime bool, bindings bool) *Options { return &Options{ - disableRuntimeInjection: runtime, - disableBindingsInjection: bindings, + disableRuntimeInjection: runtime, + disableIPCInjection: bindings, } } @@ -50,11 +50,11 @@ func Test_extractOptions(t *testing.T) { {"bad options", genMeta("noauto"), genOptions(false, false), false}, {"realhtml", []byte(realHTML), genOptions(true, true), false}, {"noautoinject", genMeta("noautoinject"), genOptions(true, true), false}, - {"noautoinjectbindings", genMeta("noautoinjectbindings"), genOptions(false, true), false}, + {"noautoinjectipc", genMeta("noautoinjectipc"), genOptions(false, true), false}, {"noautoinjectruntime", genMeta("noautoinjectruntime"), genOptions(true, false), false}, {"spaces", genMeta(" noautoinjectruntime "), genOptions(true, false), false}, - {"multiple", genMeta("noautoinjectruntime,noautoinjectbindings"), genOptions(true, true), false}, - {"multiple spaces", genMeta(" noautoinjectruntime, noautoinjectbindings "), genOptions(true, true), false}, + {"multiple", genMeta("noautoinjectruntime,noautoinjectipc"), genOptions(true, true), false}, + {"multiple spaces", genMeta(" noautoinjectruntime, noautoinjectipc "), genOptions(true, true), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/website/docs/guides/frontend.mdx b/website/docs/guides/frontend.mdx index e2ef31194..84489cd99 100644 --- a/website/docs/guides/frontend.mdx +++ b/website/docs/guides/frontend.mdx @@ -44,7 +44,7 @@ The options are as follows: | Value | Description | | -------------------- | ------------------------------------------------- | | noautoinjectruntime | Disable the autoinjection of `/wails/runtime.js` | -| noautoinjectbindings | Disable the autoinjection of `/wails/bindings.js` | +| noautoinjectipc | Disable the autoinjection of `/wails/ipc.js` | | noautoinject | Disable all autoinjection of scripts | Multiple options may be used provided they are comma seperated.