create-gesso-app 0.6.3 → 0.6.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # create-gesso-app
2
2
 
3
+ ## 0.6.17
4
+
5
+ ## 0.6.16
6
+
7
+ ### Patch Changes
8
+
9
+ - 1f60081: A channel's view may hold a `SharedArrayBuffer`. It is a handle on memory, so reference equality is the right comparison for it, and posted to another thread it is shared rather than copied: the app worker and the render worker can read one large document without sending it, and what changes is a small plain value saying which version to read. It needs a cross-origin isolated page. A desktop window's channels refuse it by name rather than sending `{}`, an agent is shown its size, and `gesso-vite-plugin` describes it in a view's schema instead of warning. A command still may not take one from an agent.
10
+
11
+ ## 0.6.15
12
+
13
+ ### Patch Changes
14
+
15
+ - 2cc396a: `standardMenu(appName)` in `gesso-electrobun/desktop`: the application, Edit and Window menus every Mac application has, for `ApplicationMenu.setApplicationMenu`. Without an Edit menu macOS sends ⌘V and ⌘C nowhere, so text fields in a desktop window could not be pasted into or copied from. The Electrobun template installs it.
16
+
17
+ ## 0.6.14
18
+
19
+ ## 0.6.13
20
+
21
+ ## 0.6.12
22
+
23
+ ## 0.6.11
24
+
25
+ ## 0.6.10
26
+
27
+ ## 0.6.9
28
+
29
+ ## 0.6.8
30
+
31
+ ## 0.6.7
32
+
33
+ ## 0.6.6
34
+
35
+ ## 0.6.5
36
+
37
+ ### Patch Changes
38
+
39
+ - e93e0ee: A `Link` can now name an in-app destination with `to`, and a Cmd-click opens it somewhere new, the way a browser treats an anchor. `to` takes one of the application's own urls (`/epic/BUD-12?story=BUD-13`) or a `RouteTarget` from `to(route, params)`. A plain click, Enter or Space runs `onPress` and then navigates the router in place. A click with Command or Control held (either one, on any platform), a middle click, or Cmd-Enter / Ctrl-Enter runs `onPress` and then asks the shell to open the app at that url somewhere new, leaving the current screen where it is. An `href` link is unchanged: it opens through `openUrl` however it is clicked. When a link has both, `to` wins. `Breadcrumb` items take the same `to`.
40
+
41
+ The request is the new `ShellService.openRoute(url)`, and what "somewhere new" means is the shell's decision. `createApp` and `GessoApp` take an `onOpenRoute(url)` for a host with its own idea of a new tab, such as an app inside Jira opening one through Forge's `router.open`. Without one, a browser shell opens a tab at the app's own address for that url: the path on the same origin in `path` mode, the same page with the fragment set in `hash` mode. In `memory` mode there is no address, so the link is followed in place. A handed-in `ShellHistory` can answer the new optional `href(url)` to give the address itself; without it, such a link is also followed in place.
42
+
43
+ In `gesso-electrobun`, the view bridge has `openRoute(url)` to pass as `onOpenRoute`, and `createDesktopApp` answers it by opening a new window of the application at that route: `openWindow({ route })`, and an `onOpenRoute(url, window)` option to do something else. A window learns its route from the page it loads: `open` reads `window.route`, `withWindowRoute` puts it in the view url's fragment, and `windowRoute()` reads it back as the window's starting url. An `open` that ignores it keeps working. The Electrobun template does all three.
44
+
45
+ ## 0.6.4
46
+
3
47
  ## 0.6.3
4
48
 
5
49
  ## 0.6.2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-gesso-app",
3
- "version": "0.6.3",
3
+ "version": "0.6.17",
4
4
  "description": "Scaffolds a Gesso app: a native-grade web application built from declarative components, with its interface in a render worker.",
5
5
  "license": "MIT",
6
6
  "author": "Kevin Baker",
@@ -110,7 +110,8 @@ export const Notes = defineChannel('notes', {
110
110
 
111
111
  - Only **plain data** crosses: primitives, arrays and plain objects.
112
112
  No `Date`, `Map`, `Set` or class instances. Flatten them where they
113
- are made.
113
+ are made. The one exception is a `SharedArrayBuffer`, which both
114
+ threads read without copying (the page must be cross-origin isolated).
114
115
  - Commands return `void`. The effect comes back as a change to the view,
115
116
  never as a return value.
116
117
  - A component reads `ctx.channel(Notes).view.rows` like any other cell
@@ -5,16 +5,16 @@
5
5
  "type": "module",
6
6
  "description": "A Gesso application in a native Electrobun window.",
7
7
  "dependencies": {
8
- "gesso-components": "^0.6.3",
9
- "gesso-core": "^0.6.3",
10
- "gesso-electrobun": "^0.6.3",
11
- "gesso-framework": "^0.6.3",
8
+ "gesso-components": "^0.6.17",
9
+ "gesso-core": "^0.6.17",
10
+ "gesso-electrobun": "^0.6.17",
11
+ "gesso-framework": "^0.6.17",
12
12
  "rxjs": "^7.8.2"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@types/bun": "latest",
16
16
  "concurrently": "^9.1.0",
17
- "gesso-vite-plugin": "^0.6.3",
17
+ "gesso-vite-plugin": "^0.6.17",
18
18
  "typescript": "~7.0.2",
19
19
  "vite": "^8.2.0"
20
20
  }
@@ -11,11 +11,18 @@
11
11
  * what that window has already seen, so two windows agree by
12
12
  * construction rather than by synchronising.
13
13
  */
14
- import { BrowserView, BrowserWindow, Utils } from 'electrobun/main';
14
+ import { ApplicationMenu, BrowserView, BrowserWindow, Utils } from 'electrobun/main';
15
15
  import { BehaviorSubject, map } from 'rxjs';
16
16
 
17
17
  import type { GessoFrame } from 'gesso-electrobun';
18
- import { createDesktopApp, messageBoxConfirm, serveDesktopAgent, windowsChannel } from 'gesso-electrobun/desktop';
18
+ import {
19
+ createDesktopApp,
20
+ messageBoxConfirm,
21
+ serveDesktopAgent,
22
+ standardMenu,
23
+ windowsChannel,
24
+ withWindowRoute
25
+ } from 'gesso-electrobun/desktop';
19
26
  import { serve } from 'gesso-framework';
20
27
 
21
28
  import { Counter } from '../shared/Counter';
@@ -23,6 +30,9 @@ import { Counter } from '../shared/Counter';
23
30
  import '../shared/channels.described';
24
31
  import type { GessoWindowRPC } from '../shared/rpc';
25
32
 
33
+ // Without an Edit menu, macOS sends ⌘V and ⌘C nowhere, and text fields cannot be pasted into.
34
+ ApplicationMenu.setApplicationMenu(standardMenu('Gesso app'));
35
+
26
36
  /** The application's whole state, in the process that owns it. */
27
37
  const count = new BehaviorSubject(0);
28
38
 
@@ -65,7 +75,9 @@ const app = createDesktopApp({
65
75
  });
66
76
  const window = new BrowserWindow({
67
77
  title: '{{name}}',
68
- url: 'views://mainview/index.html',
78
+ // The route a Cmd-click asked for, if any, for the window to
79
+ // start at; see `windowRoute` in the view.
80
+ url: withWindowRoute('views://mainview/index.html', handle.route),
69
81
  frame: { width: 460, height: 360, x: 100 + handle.id * 60, y: 120 + handle.id * 40 },
70
82
  rpc
71
83
  });
@@ -8,7 +8,7 @@
8
8
  * a transport rather than a router.
9
9
  */
10
10
  import type { GessoFrame } from 'gesso-electrobun';
11
- import { createElectrobunBridge } from 'gesso-electrobun/view';
11
+ import { createElectrobunBridge, windowRoute } from 'gesso-electrobun/view';
12
12
  import { createApp } from 'gesso-framework';
13
13
  import { Electroview } from 'electrobun/view';
14
14
 
@@ -43,11 +43,15 @@ const shell = createApp({
43
43
  // The application layer is in another process, so this is the bridge
44
44
  // rather than a data worker. The render worker cannot tell.
45
45
  appLogicWorker: bridge.endpoint,
46
- // A window has no address bar, so its routes are its own.
47
- history: { mode: 'memory' },
46
+ // A window has no address bar, so its routes are its own. It starts
47
+ // at the route the main process opened it at, if it was given one.
48
+ history: { mode: 'memory', initialUrl: windowRoute() },
48
49
  // A link in a desktop application belongs in the person's browser,
49
50
  // which only the process outside this window can reach.
50
51
  onOpenUrl: url => bridge.openUrl(url),
52
+ // A Cmd-click on an in-app link opens another window of this
53
+ // application, at that route.
54
+ onOpenRoute: url => bridge.openRoute(url),
51
55
  // The window is all app: a key pressed before anything is clicked is its.
52
56
  pageKeys: true,
53
57
  onError: (message, stack, source) => console.error(`[gesso ${source}] ${message}`, stack)
@@ -10,14 +10,14 @@
10
10
  "typecheck": "tsc --noEmit"
11
11
  },
12
12
  "dependencies": {
13
- "gesso-components": "^0.6.3",
14
- "gesso-core": "^0.6.3",
15
- "gesso-framework": "^0.6.3",
13
+ "gesso-components": "^0.6.17",
14
+ "gesso-core": "^0.6.17",
15
+ "gesso-framework": "^0.6.17",
16
16
  "rxjs": "^7.8.2"
17
17
  },
18
18
  "devDependencies": {
19
- "gesso-devtools": "^0.6.3",
20
- "gesso-vite-plugin": "^0.6.3",
19
+ "gesso-devtools": "^0.6.17",
20
+ "gesso-vite-plugin": "^0.6.17",
21
21
  "typescript": "~7.0.2",
22
22
  "vite": "^8.2.0"
23
23
  }