You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ARCHITECTURE.md
+31-37Lines changed: 31 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,9 +17,9 @@ Be very mindful about state managment; violating these principles will lead to b
17
17
18
18
### Bundling
19
19
20
-
Each webview is bundled into a single file to speed up load times as well as isolate the 'web' modules from the 'node' modules. Webview bundles are automatically generated on compilation by targeting `entry.ts` files when located under a `vue` directory. All bundles are placed directly under `dist`.
20
+
Each webview is bundled into a single file to speed up load times as well as isolate the 'web' modules from the 'node' modules. Webview bundles are automatically generated on compilation by targeting `index.ts` files when located under a `vue` directory. All bundles are placed under `dist` in the same relative location.
21
21
22
-
Generated bundle names map based off their path relative to `src`: `src/foo/vue/bar/entry.ts` -> `fooBarVue.js`
22
+
Generated bundle names map based off their path relative to `src`: `src/foo/vue/bar/index.ts` -> `dist/src/foo/vue/bar/index.js`
23
23
24
24
Running the extension in development mode (e.g. via the `Extension` launch task) starts a local server to automatically rebuild and serve webviews in real-time via hot-module reloading. It's assumed that the server runs on port `8080`, so make sure that nothing is already using that port. Otherwise webviews will not be displayed during development.
25
25
@@ -29,37 +29,41 @@ The VS Code API restricts our Webviews to a single `postMessage` function. To si
29
29
30
30
Webview (frontend) clients can be created via `WebviewClientFactory`. This generates a simple Proxy to send messages to the extension, mapping the function name to the command name. Unique IDs are also generated to stop requests from receiving extraneous responses. It is **highly** recommended to use the [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) extension for syntax highlighting and type-checking when working with SFCs. Keep in mind that this is purely a development tool: users of the toolkits do not require Volar to view webviews.
31
31
32
-
Commands and events are defined on the backend via `compileVueWebview` or `compileVueWebviewView` for the special 'view' case. This takes a configuration object that contains information about the webview, such as the name of the main script, the panel id, and the commands/events that the backend provides. This returns a class that can be instantiated into the webview. Webviews can then be executed by calling `start` with any initial data (if applicable). Webviews can be cleared of their internal state without reloading the HTML by calling `clear` with any re-initialization data (if applicable).
32
+
Commands and events are defined on the backend via sub-classes of `VueWebview`. Classes define all the functions and events that will be available to the frontend. These sub-classes can be turned into a fully-resolved class by using either `VueWeview.compilePanel` or `VueWebview.compileView`. The resulting classes can finally be used to instantiate webview panels or view. Panels are shown by calling `show`, while views must be registered before they can be seen.
33
33
34
34
### Examples
35
35
36
36
- Creating and executing a webview:
37
37
38
38
```ts
39
-
const VueWebview =compileVueWebview({
40
-
id: 'my.view',
41
-
title: 'A title',
42
-
webviewJs: 'myView.js',
43
-
start: (param?:string) =>param??'foo',
44
-
events: {
45
-
onBar: newvscode.EventEmitter<number>(),
46
-
},
47
-
commands: {
48
-
foo: () =>'hello!',
49
-
bar() {
50
-
// All commands have access to `WebviewServer` via `this`
51
-
this.emiters.onBar.fire(0)
52
-
},
53
-
},
54
-
})
39
+
// Export the class so the frontend code can use it for types
Currentlyonlymanualtestingisdone. Futureworkwillincludesettingupsomebasicunittestingcapacityvia`JSDOM`and`Vue Testing Library`. Stricttype-checkingmayalsobeenforcedonSFCs; currentlythetype-checkingonlyexistslocallyduetogapsinthetypedefinitions for the DOM provided by Vue/TypeScript.
Copy file name to clipboardExpand all lines: resources/markdown/samReadme.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ ${COMPANYNAME} Lambda functions not defined in the [`template.yaml`](./template.
19
19
20
20
## Deploying Serverless Applications
21
21
22
-
You can deploy a serverless application by invoking the `AWS: Deploy SAM application` command through the Command Palette or by right-clicking the Lambda node in the ${COMPANYNAME} Explorer and entering the deployment region, a valid S3 bucket from the region, and the name of a CloudFormation stack to deploy to. You can monitor your deployment's progress through the **${COMPANYNAME} Toolkit** Output Channel.
22
+
You can deploy a serverless application by invoking the `AWS: Deploy SAM application` command through the Command Palette or by right-clicking the Lambda node in the ${COMPANYNAME} Explorer and entering the deployment region, a valid S3 bucket from the region, and the name of a CloudFormation stack to deploy to. You can monitor your deployment's progress through the `${COMPANYNAME} Toolkit` Output Channel.
23
23
24
24
## Interacting With Deployed Serverless Applications
0 commit comments