@yourrealm/sdk 0.0.0-alpha.1409.295057bf → 0.0.0-alpha.1414.ca4ff83e
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yourrealm/sdk",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.1414.ca4ff83e",
|
|
4
4
|
"description": "The Realm SDK: createApp, the r.* permission factories, the ui surface, the realm-sdk CLI and test harness.",
|
|
5
5
|
"license": "AGPL-3.0-only WITH Classpath-exception-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -102,8 +102,8 @@
|
|
|
102
102
|
"@std/path": "npm:@jsr/std__path@^1",
|
|
103
103
|
"@std/tar": "npm:@jsr/std__tar@^0.1",
|
|
104
104
|
"@std/testing": "npm:@jsr/std__testing@^1",
|
|
105
|
-
"@local/docker": "0.1.0",
|
|
106
105
|
"@local/logger": "0.1.0",
|
|
106
|
+
"@local/docker": "0.1.0",
|
|
107
107
|
"@yourrealm/noise": "0.1.0"
|
|
108
108
|
},
|
|
109
109
|
"scripts": {
|
|
@@ -61,8 +61,11 @@ export const TAR_PATH = `${OUTPUT_MOUNT}/${TAR_NAME}`;
|
|
|
61
61
|
* kaniko executor flags for `recipe`. The context is the broker's fixed
|
|
62
62
|
* `/workspace` mount; `recipe.context` selects a sub-path within it.
|
|
63
63
|
*
|
|
64
|
-
* Always `--no-push` — the box never reaches a registry
|
|
65
|
-
*
|
|
64
|
+
* Always `--no-push` — the box never reaches a registry — and
|
|
65
|
+
* `--compressed-caching=false`: the compressed layer copy kaniko holds in
|
|
66
|
+
* memory shares the box's memcg with the build, and a large node_modules
|
|
67
|
+
* layer leaves the `RUN` step too little to finish. It only serves kaniko's
|
|
68
|
+
* own `--cache`, which no build here passes. With `output` it also emits `--tar-path=${TAR_PATH}`, so kaniko writes the built image as an
|
|
66
69
|
* OCI tarball to the broker's RW output mount for the caller to read back and
|
|
67
70
|
* push.
|
|
68
71
|
*/
|
|
@@ -70,7 +73,8 @@ export function kanikoArgv(recipe: BuildRecipe, output?: boolean): string[] {
|
|
|
70
73
|
const contextDir = recipe.context ? `${CONTEXT_MOUNT}/${recipe.context}` : CONTEXT_MOUNT;
|
|
71
74
|
// Build-only just compile-checks; an output run also tars the result for
|
|
72
75
|
// the caller to push. Either way the box never pushes (`--no-push`).
|
|
73
|
-
const argv =
|
|
76
|
+
const argv = ["--no-push", "--compressed-caching=false"];
|
|
77
|
+
if (output) argv.push(`--tar-path=${TAR_PATH}`);
|
|
74
78
|
argv.push(`--context=dir://${contextDir}`, `--dockerfile=${recipe.dockerfile ?? "Dockerfile"}`);
|
|
75
79
|
for (const [key, value] of Object.entries(recipe.buildArgs ?? {})) {
|
|
76
80
|
argv.push(`--build-arg=${key}=${value}`);
|
package/src/ui-runtime/mount.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// carry `data` on first paint.
|
|
15
15
|
|
|
16
16
|
import { type ComponentChildren, h, render } from "preact";
|
|
17
|
-
import { useState } from "preact/hooks";
|
|
17
|
+
import { useRef, useState } from "preact/hooks";
|
|
18
18
|
import {
|
|
19
19
|
QueryClient,
|
|
20
20
|
QueryClientProvider,
|
|
@@ -260,6 +260,10 @@ export function mount(opts: MountOpts): void {
|
|
|
260
260
|
function SurfaceRoot() {
|
|
261
261
|
// ONE state object for the whole widget — shared across its loaders.
|
|
262
262
|
const [state, setState] = useState<unknown>(seedState);
|
|
263
|
+
// Set once the surface first renders live. After that the boot state never
|
|
264
|
+
// comes back: a setState re-keys a loader to a query with no data yet, and
|
|
265
|
+
// the surface shows its own loading state for that, not a blank screen.
|
|
266
|
+
const booted = useRef(false);
|
|
263
267
|
|
|
264
268
|
const loaders: Record<string, UseQueryResult<unknown, Error>> = {};
|
|
265
269
|
for (const [name, loader] of loaderSetup) {
|
|
@@ -309,7 +313,8 @@ export function mount(opts: MountOpts): void {
|
|
|
309
313
|
// `data === undefined`) or a raw error string. `data === undefined` is
|
|
310
314
|
// what keeps this to the *initial* load — once a loader has succeeded its
|
|
311
315
|
// data stays set, so a later background refetch shows stale data rather
|
|
312
|
-
// than flipping back to a spinner
|
|
316
|
+
// than flipping back to a spinner, and `booted` keeps a re-keyed loader
|
|
317
|
+
// (new state, new query, no data yet) from doing the same. Two flavors:
|
|
313
318
|
// - first fetch in flight (`isFetching`, no data, no error) → "Loading…"
|
|
314
319
|
// - first fetch failed with a transient UiError (CONTAINER_STARTING) →
|
|
315
320
|
// "Container starting…"
|
|
@@ -326,7 +331,7 @@ export function mount(opts: MountOpts): void {
|
|
|
326
331
|
// loader with no active poll falls through to the author's branch instead
|
|
327
332
|
// of promising a recovery nothing delivers. (The in-flight case clears on
|
|
328
333
|
// the in-flight fetch itself, so it needs no poll.)
|
|
329
|
-
for (const [name, def] of loaderSetup) {
|
|
334
|
+
for (const [name, def] of booted.current ? [] : loaderSetup) {
|
|
330
335
|
const loader = loaders[name]!;
|
|
331
336
|
if (loader.data !== undefined) continue;
|
|
332
337
|
const polls = def.refetchInterval !== undefined && def.refetchInterval !== false;
|
|
@@ -346,6 +351,7 @@ export function mount(opts: MountOpts): void {
|
|
|
346
351
|
}
|
|
347
352
|
}
|
|
348
353
|
|
|
354
|
+
booted.current = true;
|
|
349
355
|
return opts.surface.render(
|
|
350
356
|
renderApi({
|
|
351
357
|
loaders,
|