@akanjs/devkit 3.3.0-rc.5 → 3.3.0-rc.51
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 +686 -0
- package/DEV_RUNTIME_KNOBS.md +1 -1
- package/README.ko.md +3 -2
- package/README.md +3 -3
- package/akanApp/akanApp.host.test.ts +1 -1
- package/akanApp/akanApp.host.ts +11 -0
- package/akanConfig/akanBin.ts +4 -0
- package/akanConfig/akanConfig.test.ts +70 -10
- package/akanConfig/akanConfig.ts +71 -206
- package/akanConfig/akanWorkers.test.ts +73 -0
- package/akanConfig/akanWorkers.ts +61 -0
- package/akanConfig/desktopServerConfig.ts +96 -0
- package/akanConfig/dockerImage.ts +39 -0
- package/akanConfig/index.ts +1 -0
- package/akanConfig/nativeKeys.ts +52 -0
- package/akanConfig/types.ts +1 -0
- package/app/appBin.test.ts +63 -0
- package/app/appBin.ts +50 -0
- package/app/applicationBuildReporter.test.ts +49 -0
- package/app/applicationBuildReporter.ts +5 -0
- package/app/applicationBuildRunner.test.ts +279 -4
- package/app/applicationBuildRunner.ts +147 -12
- package/app/dictionarySizes.ts +91 -0
- package/app/routeFilesReport.test.ts +59 -0
- package/app/routeFilesReport.ts +46 -0
- package/app/routeJsBudget.ts +18 -4
- package/artifact/implicitRootLayout.test.ts +19 -0
- package/artifact/implicitRootLayout.ts +16 -2
- package/artifact/implicitRootLayoutRender.test.tsx +4 -1
- package/artifact/storeBootstrap.test.ts +28 -0
- package/artifact/storeBootstrap.ts +64 -8
- package/biome.base.json +7 -5
- package/codeAgent/agent/CodeAgent.ts +36 -16
- package/codeAgent/agent/CodeAgentAllowed.ts +35 -0
- package/codeAgent/agent/CodeAgentCommandLine.ts +372 -0
- package/codeAgent/agent/CodeAgentGate.ts +23 -4
- package/codeAgent/agent/CodeAgentRpcHost.ts +1 -1
- package/codeAgent/agent/codeAgent.test.ts +62 -0
- package/codeAgent/agent/codeAgentCommandLine.test.ts +212 -0
- package/codeAgent/agent/codeAgentContract.test.ts +117 -5
- package/codeAgent/skills/akan-agent/SKILL.md +8 -1
- package/codeAgent/skills/akan-code/SKILL.md +38 -3
- package/codeAgent/skills/akan-deps/SKILL.md +3 -2
- package/codeAgent/skills/akan-err/SKILL.md +13 -8
- package/codeAgent/skills/akan-mcp/SKILL.md +1 -1
- package/codeAgent/skills/akan-module/SKILL.md +2 -2
- package/codeAgent/skills/akan-page/SKILL.md +34 -26
- package/codeAgent/skills/akan-query/SKILL.md +13 -20
- package/codeAgent/skills/akan-runtime/SKILL.md +20 -0
- package/codeAgent/skills/akan-service/SKILL.md +10 -11
- package/codeAgent/skills/akan-transport/SKILL.md +5 -14
- package/codeAgent/skills/akan-ui/SKILL.md +2 -5
- package/context/akanContext.ts +2 -0
- package/csrE2e/devHmrLatency.e2e.test.ts +1 -1
- package/docs/apiReference.test.ts +9 -0
- package/docs/apiReference.ts +14 -0
- package/executors/appExecutor.ts +10 -5
- package/executors/clientRuntimeKeyOrder.fixture.json +682 -0
- package/executors/clientRuntimeKeys.fixture.json +393 -0
- package/executors/clientRuntimeKeys.test.ts +1690 -0
- package/executors/executor.ts +12 -4
- package/executors/executors.test.ts +24 -0
- package/executors/sysExecutor.ts +80 -5
- package/executors/workspaceExecutor.ts +7 -4
- package/frontendBuild/allRoutesBuilder.ts +99 -7
- package/frontendBuild/autoImportSync.ts +3 -2
- package/frontendBuild/buildRouteClient.test.ts +686 -13
- package/frontendBuild/clientBuildTypes.ts +26 -0
- package/frontendBuild/clientEntriesBundler.ts +49 -1
- package/frontendBuild/clientEntryDiscovery.test.ts +308 -1
- package/frontendBuild/clientEntryDiscovery.ts +136 -14
- package/frontendBuild/clientEntryGroups.test.ts +77 -0
- package/frontendBuild/clientEntryGroups.ts +61 -0
- package/frontendBuild/csrDevArtifactWriter.ts +2 -2
- package/frontendBuild/csrDevModuleCompiler.test.ts +86 -0
- package/frontendBuild/csrDevModuleCompiler.ts +44 -8
- package/frontendBuild/csrDevPatcher.test.ts +1 -1
- package/frontendBuild/csrDevPatcher.ts +33 -7
- package/frontendBuild/csrDevTypes.ts +9 -0
- package/frontendBuild/devBarrelImports.test.ts +154 -0
- package/frontendBuild/devBarrelImports.ts +83 -23
- package/frontendBuild/devRegistryBundler.ts +4 -2
- package/frontendBuild/devRouteRuntime.test.ts +492 -0
- package/frontendBuild/devRouteRuntime.ts +167 -0
- package/frontendBuild/dictionaryAssetBuilder.test.ts +329 -0
- package/frontendBuild/dictionaryAssetBuilder.ts +165 -16
- package/frontendBuild/dictionaryConstants.ts +136 -0
- package/frontendBuild/dictionaryPacking.test.ts +142 -0
- package/frontendBuild/dictionaryPacking.ts +135 -0
- package/frontendBuild/dictionaryRoutes.test.ts +251 -0
- package/frontendBuild/dictionaryRoutes.ts +227 -0
- package/frontendBuild/pagesBundleBuilder.test.ts +84 -0
- package/frontendBuild/pagesBundleBuilder.ts +81 -3
- package/frontendBuild/precompressArtifacts.test.ts +22 -0
- package/frontendBuild/precompressArtifacts.ts +22 -8
- package/frontendBuild/registryMetadataFingerprint.ts +3 -3
- package/frontendBuild/renderedEntries.ts +144 -0
- package/frontendBuild/routeClientBuilder.ts +407 -43
- package/frontendBuild/routeHandoffs.test.ts +155 -0
- package/frontendBuild/routeHandoffs.ts +117 -0
- package/frontendBuild/routeModulePreloads.test.ts +32 -0
- package/frontendBuild/routeModulePreloads.ts +20 -11
- package/frontendBuild/routeRuntimeCheck.test.ts +280 -0
- package/frontendBuild/routeRuntimeCheck.ts +248 -0
- package/frontendBuild/routeRuntimePays.test.ts +143 -0
- package/frontendBuild/routeRuntimePays.ts +117 -0
- package/frontendBuild/rscServerRendererGuard.test.ts +60 -0
- package/frontendBuild/rscServerRendererGuard.ts +68 -0
- package/frontendBuild/ssrBaseArtifactBuilder.ts +24 -34
- package/frontendBuild/ssrDevBundler.test.ts +150 -1
- package/frontendBuild/ssrDevBundler.ts +66 -11
- package/frontendBuild/vendorFileImports.test.ts +254 -0
- package/frontendBuild/vendorFileImports.ts +163 -0
- package/frontendBuild/vendorNarrowing.ts +28 -0
- package/frontendBuild/vendorSpecifiers.ts +2 -0
- package/incrementalBuilder/buildBatch.proc.ts +9 -9
- package/incrementalBuilder/buildBatchProtocol.ts +1 -1
- package/incrementalBuilder/builderBoot.ts +5 -5
- package/incrementalBuilder/builderGraphPayloads.ts +4 -4
- package/incrementalBuilder/builderLanes.ts +2 -2
- package/incrementalBuilder/builderWatch.ts +8 -8
- package/incrementalBuilder/csrRegistry.ts +4 -4
- package/incrementalBuilder/incrementalBuilder.proc.test.ts +79 -0
- package/incrementalBuilder/incrementalBuilder.proc.ts +27 -8
- package/incrementalBuilder/ssrRegistry.ts +6 -6
- package/index.ts +1 -1
- package/integration/renderAdmissionSoak.test.ts +99 -0
- package/integration/renderAdmissionSoak.ts +609 -0
- package/lint/__fixtures__/no-arbitrary-color/every-color-function/bad.tsx +11 -0
- package/lint/__fixtures__/no-arbitrary-color/every-color-function/good.tsx +2 -0
- package/lint/__fixtures__/no-daisyui-legacy-class/every-class/bad.tsx +34 -0
- package/lint/__fixtures__/no-daisyui-legacy-class/every-class/good.tsx +2 -0
- package/lint/__fixtures__/no-inline-color/every-color-function/bad.tsx +10 -0
- package/lint/__fixtures__/no-inline-color/every-color-function/good.tsx +2 -0
- package/lint/__fixtures__/no-raw-palette-class/every-palette/bad.tsx +22 -0
- package/lint/__fixtures__/no-raw-palette-class/every-palette/good.tsx +2 -0
- package/lint/biomeBase.test.ts +50 -3
- package/lint/biomeBase.ts +1 -1
- package/lint/biomeCheck.test.ts +162 -0
- package/lint/biomeCheck.ts +131 -0
- package/lint/linter.test.ts +16 -11
- package/lint/no-arbitrary-color.grit +5 -0
- package/lint/no-conditional-st-hook.grit +5 -1
- package/lint/no-daisyui-legacy-class.grit +8 -0
- package/lint/no-document-cookie.grit +3 -0
- package/lint/no-inline-color.grit +10 -2
- package/lint/no-oversized-list-limit.grit +2 -0
- package/lint/no-raw-palette-class.grit +7 -0
- package/lint/no-unpublished-form-setter.grit +2 -0
- package/lint/no-web-only-api-outside-webkit.grit +5 -0
- package/lint/no-web-storage.grit +3 -0
- package/lint/withheldEnvFile.ts +17 -0
- package/mobile/desktopBin.ts +2 -2
- package/mobile/desktopServerStage.test.ts +9 -2
- package/mobile/desktopServerStage.ts +1 -0
- package/mobile/nativeApp.test.ts +7 -5
- package/mobile/nativeApp.ts +2 -2
- package/mobile/nativeConfig.test.ts +96 -1
- package/mobile/nativeConfig.ts +46 -12
- package/mobile/nativePublicEnv.ts +1 -1
- package/mobile/serverBundleSecrets.ts +43 -0
- package/package.json +15 -169
- package/packageExports.test.ts +38 -24
- package/quality/dictionaryKeys.test.ts +356 -0
- package/quality/dictionaryKeys.ts +488 -0
- package/quality/objectImportReport.test.ts +36 -0
- package/quality/objectImportReport.ts +105 -0
- package/quality/qualityScanner.ts +1 -1
- package/quality/routeRuntimeReport.test.ts +91 -0
- package/quality/routeRuntimeReport.ts +121 -0
- package/quality/runtimeConstantFacts.ts +71 -0
- package/quality/runtimeConstantGraph.ts +123 -0
- package/quality/runtimeConstantReads.ts +116 -0
- package/quality/runtimeImports.test.ts +190 -0
- package/quality/runtimeImports.ts +233 -0
- package/quality/runtimeKeyNames.ts +46 -0
- package/quality/runtimeLexicalScope.ts +132 -0
- package/quality/runtimeMarkerReach.test.ts +84 -0
- package/quality/runtimeMarkerReach.ts +255 -0
- package/quality/runtimeModuleFacts.ts +290 -0
- package/quality/runtimeNameTable.test.ts +172 -0
- package/quality/runtimeNameTable.ts +477 -0
- package/quality/runtimeScopeReport.test.ts +123 -0
- package/quality/runtimeScopeReport.ts +167 -0
- package/quality/runtimeSliceKey.ts +269 -0
- package/quality/runtimeSyntax.ts +133 -0
- package/quality/runtimeTable.fixture.ts +189 -0
- package/quality/runtimeUse.test.ts +737 -0
- package/quality/runtimeUse.ts +696 -0
- package/quality/runtimeUseReadable.test.ts +393 -0
- package/quality/ssrScanner.test.ts +13 -0
- package/quality/ssrScanner.ts +1 -1
- package/quality/translatorBindings.ts +187 -0
- package/test/secretEnvFixture.ts +134 -0
- package/test/testHelpers.ts +11 -0
- package/transforms/barrelAnalyzer.ts +26 -4
- package/transforms/barrelImportsPlugin.ts +121 -32
- package/transforms/exportReach.test.ts +162 -0
- package/transforms/exportReach.ts +308 -0
- package/transforms/frameworkObjects.fixture.tsx +58 -0
- package/transforms/frameworkObjects.test.ts +54 -0
- package/transforms/modelReference.test.ts +196 -0
- package/transforms/modelReference.ts +39 -0
- package/transforms/moduleParts.test.ts +225 -0
- package/transforms/moduleParts.ts +418 -0
- package/transforms/objectImportEdits.ts +150 -0
- package/transforms/objectMemberImports.test.ts +633 -0
- package/transforms/objectMemberImports.ts +571 -0
- package/transforms/objectMemberLookup.ts +150 -0
- package/transforms/objectModule.test.ts +307 -0
- package/transforms/objectModule.ts +482 -0
- package/transforms/objectModuleAnalyzer.ts +104 -0
- package/transforms/partImports.test.ts +76 -0
- package/transforms/partImports.ts +110 -0
- package/transforms/partModules.test.ts +187 -0
- package/transforms/partModules.ts +90 -0
- package/transforms/partPurity.ts +124 -0
- package/transforms/reactIconImports.test.ts +231 -0
- package/transforms/reactIconImports.ts +325 -0
- package/transforms/routeConstants.ts +122 -0
- package/transforms/routeRuntime.test.ts +835 -0
- package/transforms/routeRuntime.ts +703 -0
- package/transforms/routeRuntimeEdits.ts +92 -0
- package/transforms/routeRuntimeGraph.ts +66 -0
- package/transforms/routeRuntimePlan.ts +244 -0
- package/transforms/secretEnvDeclaration.test.ts +208 -0
- package/transforms/secretEnvDeclaration.ts +213 -0
- package/transforms/secretEnvFile.test.ts +117 -0
- package/transforms/secretEnvFile.ts +113 -0
- package/transforms/secretEnvName.test.ts +54 -0
- package/transforms/secretEnvName.ts +29 -0
- package/transforms/secretEnvSource.test.ts +148 -0
- package/transforms/secretEnvSource.ts +166 -0
- package/transforms/serverEnvEvaluationError.ts +11 -0
- package/transforms/serverEnvPlugin.test.ts +2 -1
- package/transforms/serverEnvPlugin.ts +13 -0
- package/transforms/serverEnvProfile.test.ts +115 -2
- package/transforms/serverEnvProfile.ts +117 -40
- package/transforms/serverEnvSecrets.test.ts +292 -0
- package/transforms/signalDescriptors.test.ts +280 -0
- package/transforms/signalDescriptors.ts +227 -0
- package/transforms/thisFreeExports.ts +87 -0
- package/transforms/transforms.test.ts +180 -3
- package/transforms/tsconfigPackageResolver.test.ts +1 -0
- package/tunnel/createTunnel.test.ts +29 -8
- package/tunnel/createTunnel.ts +18 -11
- package/typecheck/projectTypecheck.test.ts +32 -1
- package/typecheck/projectTypecheck.ts +3 -3
- package/typecheck/typeChecker.test.ts +49 -0
- package/typecheck/typeChecker.ts +9 -7
- package/typecheck/withheldDiagnostics.ts +41 -0
- package/util/fileEditor.ts +1 -0
- package/util/selectModel.ts +1 -0
- package/workflow/executor.ts +6 -2
- package/workflow/index.ts +1 -0
- package/workflow/plan.ts +36 -7
- package/workflow/types.ts +1 -1
- package/workflow/uiTarget.ts +50 -0
- package/workspace/getRelatedCnsts.ts +7 -0
- package/workspace/scanInfo.test.ts +39 -0
- package/workspace/scanInfo.ts +55 -6
- package/workspace/slicePlanner.ts +1 -1
- package/workspace/workspaceLayout.test.ts +5 -1
- package/workspace/workspaceLayout.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,39 +2,725 @@
|
|
|
2
2
|
|
|
3
3
|
## 3.3.0
|
|
4
4
|
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- af57986: An app declares code that runs in a process of its own, and the framework builds, finds and supervises it.
|
|
8
|
+
|
|
9
|
+
`workers` in an app's `akan.config.ts` maps a name to an entry file (`workers: { vision: "srvkit/vision.worker.ts" }`). `akan build` bundles each as its own entry to `workers/<name>.js`, with the server's externals and env handling and never as a chunk of `server.js`, so a native addon the worker imports is not loaded by the server. The image and a desktop app's server carry the folder; `akan start` and `akan test` run the worker from its declared source.
|
|
10
|
+
|
|
11
|
+
`AppWorker.spawn(name, options)` from `akanjs/server` starts it with the Bun that runs the server: stdout and stderr are relayed line by line to the server's logger, a worker that exits with an error or on a signal is started again with a doubling delay (1s to 30s; `restart: false` leaves it down, an exit with code 0 stays down), `onMessage` opens an IPC channel that `worker.send` writes to, `stop()` sends SIGTERM and then SIGKILL, and every running worker gets SIGTERM when the server process exits. The worker gets the variables a process needs to start plus `options.env`, not the server's env, unless `inheritEnv` is set. `AppWorker.pathOf(name)` returns the file for code that spawns by hand. An undeclared name throws `AppWorkerError` with the code `workerNotDeclared`, and `send` without a channel `workerNotConnected`.
|
|
12
|
+
|
|
13
|
+
The runtime guideline documents the section, and its reference files are larger: `runtimeRule-2.md` by 3430 bytes and `akanApi-app-config.md` by 138.
|
|
14
|
+
|
|
15
|
+
No upgrade step for an app. `AppConfigResult` gains a required `workers`, so code that builds one by hand adds `workers: {}`; `akanjs/server/appWorkerPath` is a new entry point the build tooling reads.
|
|
16
|
+
|
|
17
|
+
- e3f405f: A page whose server component hands a model to a framework component (`Load.Units`, `Load.View`, `Model.New`, `Model.Edit`, `Data.CardList` and the others) now loads that model's store and descriptors, not every module of the app. Before, those components loaded the whole client runtime wherever they rendered.
|
|
18
|
+
|
|
19
|
+
- `akan sync` writes `lib/__client/<model>.ref.ts` for each model with a signal and `lib/__client/refs.ts` for the app. The generated root layout imports `refs.ts`, and the server then adds the model's client reference to every slice, init, view and edit it hands to a client component, as the optional `_runtime` field of `SliceMeta`, `ServerInit`, `ServerView` and `ServerEdit`. The browser loads the reference, and with it the model's store and descriptors, before the component receiving the object renders: on the first page, inside a streamed part of it, and after a client navigation. A model the app extends loads through the app's store, which loads the lib's first. A reference loads what a client file reading `st.use.<model>` loads: the stores the model's store names come with it, and where that store picks a name at run time, the whole client runtime. On a page that already holds the whole runtime the model's store stays the one store, with its state and subscribers.
|
|
20
|
+
- `FetchClient.setModelRuntimes(references)` is the one new static. Only the generated `refs.ts` needs it.
|
|
21
|
+
- The framework components that reach a model only through such an object no longer load the whole runtime. `Data.ListContainer`, `Data.QueryMaker`, `Data.RefPicker`, the `Signal` API explorer and `Constant.Doc` still do: they follow a model named by a field or a filter argument, which no object brought. They are loaded on demand, so a page pays for them only where one renders.
|
|
22
|
+
- A relation field (`Field.Relation` and the others taking a `slice`) loads the related model through the slice it is given, not the whole runtime.
|
|
23
|
+
- A `resets` name on `Model.New`, `Model.Edit` or `Model.View` whose store the page has not loaded is passed over, since there is no state to reset.
|
|
24
|
+
- The route table of `akan build` counts, for each route, the reference files of the models its server modules hand over. Where a server module picks a `fetch` name at run time, or takes `fetch` from the `server` barrel, the route counts every model's runtime and the build names the file and the line once.
|
|
25
|
+
- A handoff object that carries no reference works as before, wherever the page already holds the model's runtime.
|
|
26
|
+
|
|
27
|
+
**Upgrading.**
|
|
28
|
+
|
|
29
|
+
Until `lib/__client/refs.ts` exists (an `akan build` or `akan sync <app>` writes it) the app builds and serves with the whole client runtime and says so once, naming the sync. A spread (`{ ...init }`) or an `Object.assign` of what `fetch` returned keeps the reference; a deep copy (`JSON.parse(JSON.stringify(init))`, `structuredClone(init)`, a cache that stores the object as JSON) leaves `_runtime` an empty object. What that means for a page that builds or copies such an object by hand is in the upgrade note of the entry that makes every app load per route.
|
|
30
|
+
|
|
31
|
+
- edf14fd: A page registers the constants of the models its client code names, not every model's. A page that keeps the whole runtime still loads `lib/cnst.ts`; the one change there is that a registered model no longer carries its type-only `_`-prefixed members as `null` values.
|
|
32
|
+
|
|
33
|
+
- `akan sync` writes one registration piece per model and scalar, `lib/__client/<model>.cnst.ts`, which imports that module's constant file and the pieces of the models the file names, then registers the model. `lib/cnst.ts` keeps its shape and exports. A model's `.fetch` and `.st` pieces load its registration piece first, and so does a handoff reference (`<model>.ref.ts`), which loads one of them. A `.fetch` piece names the pieces it needs first in its own `FetchClient.build` call, so loading them first adds no statement to a page. A registration piece that no page loading only pieces reaches (only pages that also load the whole runtime, or only a handoff) takes its model from `lib/cnst.ts` instead, so those pages keep every constant in the one chunk they already share.
|
|
34
|
+
- The build rewrites `cnst.Memo`, `cnst.memo`, `cnst.MemoStatus`, a lib's `cnst.util.File` and `const { MemoStatus } = cnst` to imports of those names from the file declaring each; a type-only use loads nothing. A file keeps the whole `lib/cnst.ts` when it passes `cnst` on (as an argument, a spread, `Object.keys(cnst)` or another variable), picks a member with a computed key, names something `cnst` does not hand out, or hides names behind a rest or nested destructuring, and so does a constant file that reads its own app's or lib's `cnst`.
|
|
35
|
+
- A framework component that walks every registered model (the API explorer, the schema page, relation pickers, query makers) loads the whole runtime, `lib/cnst.ts` included, so it sees every model on any page. So does `Data.Dashboard`, whose tiles read their filters from a model a prop names: the server registers every model, so with fewer in the browser the tiles would render differently after hydration.
|
|
36
|
+
- Registering the same model or scalar again, from its piece and from `lib/cnst.ts` in one tab, returns the first registration; another class claiming a taken name still fails. A repeat is the same name with the same classes from the same constant file: a file that registers several names registers each, and a name that comes again with other classes registers those.
|
|
37
|
+
- In development, saving a `*.constant.ts` file reloads the tab, which registers the model before its fetch and store pieces run, as a built page does. The names a saved scalar file (`lib/__scalar/<name>/<name>.constant.ts`) declares are read again, as a model's are.
|
|
38
|
+
- The agent's form tools find the setters of a model a page registers after their first lookup.
|
|
39
|
+
- `akan quality runtime` notes each client or constant file that keeps every constant (`akan.runtime.whole-constants`), with its reason, and counts them per app and lib.
|
|
40
|
+
- The build's own check also fails when a registration piece is imported back by a file it loads, or when a page built to load pieces reaches `lib/cnst.ts` other than through a file `akan quality runtime` names or a registration piece answering from it. A page that such a file or piece already makes load every constant may reach them by another path too: a handoff reference no route hands over takes its models from `lib/cnst.ts`, and their constant files stay as written.
|
|
41
|
+
|
|
42
|
+
In the sample apps the memo pages of `apps/minimal` went from 263.5 KB to 262.3 KB and from 236.1 KB to 234.8 KB (brotli); every other route stays within 0.2 KB of before.
|
|
43
|
+
|
|
44
|
+
**Upgrading.**
|
|
45
|
+
|
|
46
|
+
Until the pieces exist (an `akan build` or `akan sync <app>` writes them) the build keeps the whole `lib/cnst.ts`. `akan quality runtime` lists the files that keep every constant and why; rewriting one to `cnst.<Name>` or `const { … } = cnst` lets its pages load fewer constants. What changes for code that looks a model up by name is in the upgrade note of the entry that makes every app load per route.
|
|
47
|
+
|
|
48
|
+
- 0a2f6dd: `akan sync` also writes each app's and lib's client runtime as one generated piece per module under `lib/__client/`, ready for a later release that loads a model's endpoint descriptors and store only on the routes that use them. Nothing imports the pieces yet: `lib/useClient.ts`, `lib/st.ts` and `lib/usePage.ts` are unchanged, and every route loads exactly what it loaded before.
|
|
49
|
+
|
|
50
|
+
- `<module>.fetch.ts` applies that module's endpoint descriptors onto the tab's fetch client, after the same module's piece of each lib it extends; `_base.fetch.ts` applies the descriptors every scope inherits from `akanjs/signal` itself.
|
|
51
|
+
- `<module>.st.ts` registers and builds that module's store alone, after the extended lib store's own piece.
|
|
52
|
+
- `_useClient.ts` imports every fetch piece of the scope and its libs and exports what `lib/useClient.ts` exports; `_st.ts` imports every store piece and exports `st`, `RootStore` and each store, as `lib/st.ts` does.
|
|
53
|
+
- `lib/sig.ts` exports one more build-time macro, `getSerializedSignalOf(name)`, which answers the descriptors one module brings, or with `"base"` the ones from `akanjs/signal`.
|
|
54
|
+
- `lib/__lib/lib.store.ts` imports each extended lib store from its own file instead of the lib's `client` barrel, and registers it when the lib's runtime has not yet, so an app store file imported on its own still has the lib store's actions.
|
|
55
|
+
- A server render reads a fetch piece's descriptors from the live server signal, as it does for `lib/useClient.ts`.
|
|
56
|
+
- `akan sync` removes the pieces of a module that was deleted or renamed.
|
|
57
|
+
- Adding a store root to a running store does work in proportion to the keys that root brings, not to every key already in the store, so building one root per module stays linear. A computed key that a later root adds now starts from the state as it is, so with a lib store's `count: 1` in place, an app store overriding `count: 10` and adding `tripled = computed(["count"], …)` starts at `tripled: 3` rather than 30.
|
|
58
|
+
- `lib/__client/` is listed with the other generated files: in the agent guide, the agent hook that stops hand edits, the Biome overrides, the code graph, and the `.gitignore` of a new workspace.
|
|
59
|
+
|
|
60
|
+
**Upgrading.**
|
|
61
|
+
|
|
62
|
+
Nothing to change in app code. The `.gitignore` lines for the new files are in the upgrade note of the entry that makes every app load per route.
|
|
63
|
+
|
|
64
|
+
- b5b4834: A production page now loads the endpoint descriptors and stores of only the modules its client code names. Before, a client module importing `fetch` or `st` from a `client` barrel brought every module of that app or lib.
|
|
65
|
+
|
|
66
|
+
- `akan build` reads each client file of the app and its libs. Where every `st.use.<key>()`, `st.do.<action>()`, `st.slice.<name>`, `fetch.<endpoint>()` and `sig.<module>` names something it can tell at build time, the file takes `fetch` and `sig` from `lib/usePage.ts`, `st` from `akanjs/store` (the tab's one store, the object a scope's `lib/st.ts` exports), and imports the `lib/__client/` pieces of the modules those names belong to, each by a name it hands to `loadedAfter` from `akanjs/base`, so the piece's chunk loads first however the build splits the code. A `*.store.ts` file gets its own module's descriptors and those of the modules its model depends on, and no store piece: a file naming a store loads the stores that store's file names.
|
|
67
|
+
- A file that picks a name at run time (`st.do[name]()`), or names something no generated piece answers, imports the app's whole runtime instead, as do the framework components that reach a model by a computed name (`Load`, `Model`, `Data` and the others importing `akanjs/ui/modelRuntime`). In development the whole runtime is assembled from the same pieces (`lib/__client/_useClient.ts`, `lib/__client/_st.ts`); in a build a client entry that needs every module keeps `lib/useClient.ts` and `lib/st.ts` as before, and the files only such entries reach are left as written. A `*.store.ts` file that picks a name at run time (spreading into the object given to its own `this.set` is not one) makes every file naming its store load the whole runtime.
|
|
68
|
+
- A lib file naming a lib module loads the app's piece of it, so a store the app extends arrives with the app's additions. The lib's own store file of that model is the exception: the app's piece is what loads it.
|
|
69
|
+
- A store piece whose model holds a file loads the upload module's descriptors first, so the piece alone has its upload action (`st.do.upload<Field>On<Model>`).
|
|
70
|
+
- An app store that extends a lib store and has no signal of its own loads the upload module's descriptors first too.
|
|
71
|
+
- An import that also takes a `client` barrel's default export (`import Kit, { st } from "@apps/<app>/client"`) is left as written and loads the whole runtime.
|
|
72
|
+
- An app store that extends a lib store answers what it answered before, whichever pieces a page loads and in whatever order: a default both declare is the lib's, an action or a `set<Key>` both declare is the app's. The store runtime itself is unchanged.
|
|
73
|
+
- The development server loads what a production page loads: a client module takes the pieces of the modules it names there too, so a name a route misses shows while you work, and the error for a store key the page has not loaded names the module whose store declares it.
|
|
74
|
+
- An app not yet synced to `lib/__client/_useClient.ts` and `_st.ts`, or whose module names cannot be read from source, builds with the whole runtime on every page, and the build says which of the two happened and names the sync to run. `akan sync` warns when it cannot read a scope's modules, and `akan build --write false` warns that it uses the `lib/__client/` files as they were last written.
|
|
75
|
+
|
|
76
|
+
**Upgrading.**
|
|
77
|
+
|
|
78
|
+
The `lib/__client/` files an earlier release wrote are written again by the sync `akan build` runs. A client module importing `fetch` or `st` no longer brings its whole app or lib; what to check for is in the upgrade note of the entry that makes every app load per route.
|
|
79
|
+
|
|
80
|
+
- ecb18a9: A page loads only the parts of an object it names: `Memo.Zone.View` brings `Memo.Zone.tsx` and not the model's other part files, and `Layout.Navbar` brings the navbar and not every layout part.
|
|
81
|
+
|
|
82
|
+
- In a build and in the development server alike, an import of an object whose file only gathers imports is rewritten to imports of the members the importing file writes out: `Memo.Zone.View`, `<Field.Text />`, `const { Util } = Memo`, and a member one level down such as `Constant.Doc.Zone`. Server rendering and the browser load the same part file.
|
|
83
|
+
- An object's file qualifies when, while it loads, it only declares names (imports, types, functions, `const` values, export lists) and puts members on objects it created above (`X.member = …`, `Object.assign(X, …)`), and nothing it evaluates calls a function, assigns or awaits. A file that imports a module only for its effect (`import "./x"`, `import {} from "./x"`), re-exports from another module, runs any other statement, calls a function such as `memo(…)`, or puts a member on an import or on a name it did not create keeps the whole object. So does an importing file that passes the object on, spreads it, reads a member with a computed key, renders or calls the object itself, writes to a member (an assignment, `++`, `delete`, a `for … of` target or a destructuring assignment), or calls a member through it (`Obj.run()`) that may read `this`: only an arrow function, or a function with no `this` outside its nested functions, is called on its own.
|
|
84
|
+
- A member of a `"use client"` object reached from a server file is narrowed only when the member's own file is `"use client"`, so the server still meets a client reference where it met one before.
|
|
85
|
+
- `export { a, b as c } from "<barrel>"` in an app or lib is narrowed to the files that declare those names, and a name a barrel's entry re-exports from a package resolves to that package.
|
|
86
|
+
- In development, saving a part file updates the page in place, adding an export to a part file and naming it from a page works without a restart, and pointing an object's member at another file rereads every page that reached it.
|
|
87
|
+
- `akan quality runtime` prints, per app and lib, how many object imports load only the members they name and how many load the whole object, by reason; `--format json` lists each of the latter with its file and line.
|
|
88
|
+
|
|
89
|
+
In the sample apps every route got smaller: the largest route of `apps/minimal` went from 469 KB to 319 KB, and the median route of `apps/akan` from 535 KB to 304 KB (brotli).
|
|
90
|
+
|
|
91
|
+
**Upgrading.**
|
|
92
|
+
|
|
93
|
+
A part file a page does not name no longer runs its top-level code on that page; what that can break is in the upgrade note of the entry that makes every app load per route. `akan quality runtime` shows what kept an object whole: per app and lib it counts the imports that load the whole object by reason (`call`, `reexport`, `method-call`, `written`, `passed-on`, …), and `--format json` lists each one with its file, line, object and reason. An object kept whole for a `call` loads every part, so moving the call (`memo(…)`) into the member's own file lets pages load parts again.
|
|
94
|
+
|
|
95
|
+
- 8720b88: `akan sync` writes one more generated file in every app and lib, `lib/usePage.ts`: the page runtime (`usePage`, `msg`, `Err`) and the tab's one fetch client, built with no endpoint descriptor, constant or store. `lib/useClient.ts` keeps its name and its exports and applies the scope's descriptors onto that client, and `client.ts` exports `usePage`, `msg` and `Err` from `lib/usePage`. This prepares loading a model's descriptors and store only on the routes whose client code imports them; for now every route loads what it loaded before.
|
|
96
|
+
|
|
97
|
+
- A client module that imports only `usePage`, `msg` or `Err` from an app or lib `client` barrel is rewritten to import `lib/usePage` alone, not the barrel's descriptors and stores. A module that imports anything else from the barrel keeps both, as before. Each client entry still imports the app's whole client runtime, so no page loads less yet.
|
|
98
|
+
- A server render keeps using the live server `fetch` of `lib/sig.ts`: the server bundle hands it to `lib/usePage.ts` as its client.
|
|
99
|
+
- A workspace whose generated files predate `lib/usePage.ts` builds as before until it is synced.
|
|
100
|
+
- `lib/usePage.ts` is listed with the other generated files: in the lib root allowlist, the agent guide, the agent hook that stops hand edits, the Biome overrides, the code graph, and the `.gitignore` of a new workspace.
|
|
101
|
+
|
|
102
|
+
**Upgrading.**
|
|
103
|
+
|
|
104
|
+
Nothing to change in app code. The `.gitignore` lines for the new file are in the upgrade note of the entry that makes every app load per route.
|
|
105
|
+
|
|
106
|
+
- 4ff5d5e: Every app loads its client runtime per route: a server-rendered page loads the stores, endpoint descriptors, constants and dictionary texts of the modules that page uses, not every module's. There is no setting for it, in `akan.config.ts` or anywhere else.
|
|
107
|
+
|
|
108
|
+
- A build or development server that cannot use the per-module files (never synced, written by an earlier release, a mounted lib not synced, a module that cannot be read) loads the whole runtime on every page, as before, and says so with the `akan sync` to run. `akan build --write false`, which skips the sync, says its files may be stale.
|
|
109
|
+
- A build that finds its own output would load a module before the piece it needs warns once, naming the files, builds every page on the whole runtime instead and succeeds. That warning is a bug in akan: report it with its text.
|
|
110
|
+
- `akan quality runtime` lists, after an `akan build`, the routes that load every text of the page dictionary under the file and line that cost it (`[dictionary] <file>:<line> <why>`); `--format json` carries every route. For an app with a build report it no longer prints the `akan.runtime.framework-marker` note, which counted every page importing a framework component that reads models by name; the build's `[reader]` line names the routes that component really holds. The `akan quality` reference page lists every rule the report prints and what to change in app code for each.
|
|
111
|
+
- A model's reference, which `fetch.slice`, `fetch.init<Model>`, `fetch.view<Model>` and `fetch.edit<Model>` hand to client components, loads that model's own store. Before, another module's store with a state field named like the model loaded with it.
|
|
112
|
+
|
|
113
|
+
**Upgrading.**
|
|
114
|
+
|
|
115
|
+
This is the one upgrade note for the per-route client runtime; the other entries of this release say what was built.
|
|
116
|
+
|
|
117
|
+
_With no action._ The first `akan build` or `akan start` after upgrading syncs the app and the libs it mounts, writing `lib/usePage.ts` and `lib/__client/` beside the other generated files, and its pages load per module. Add `apps/*/lib/usePage.ts`, `libs/*/lib/usePage.ts`, `apps/**/lib/__client` and `libs/**/lib/__client` to `.gitignore` beside `lib/useClient.ts` and `lib/__lib`. A build run with `--write false` and a lib no built app mounts need `akan sync <app-or-lib>` once; until then the pages load the whole runtime and the build says so. Server rendering, CSR bundles and native apps load everything, as before, and the development server loads what a production page loads. An app with routes to measure bundles its browser code at least twice, where it bundled once; `akan build --verbose` shows each bundle and its time.
|
|
118
|
+
|
|
119
|
+
_What can break, and how it shows._ A page no longer loads a module that no client file of its route names.
|
|
120
|
+
|
|
121
|
+
- A store or endpoint reached by a computed name without the app's or a lib's `client` barrel (the framework's base `st` or `fetch` with a string, a component library built on `akanjs/store`'s `st`, a file outside `apps/` and `libs/`) is found only on a route where a client file names that module. Outside React, `st.get().<key>` of such a store is `undefined`: a store's initial state and persisted keys appear when its code loads.
|
|
122
|
+
- An app store that extends a lib's store adds its actions, state and slices only on a route that loads the app's runtime, so code using them imports `st` from the app's `client` barrel, not the lib's.
|
|
123
|
+
- Top-level code runs only on the pages that name its file. A side effect other pages relied on because a store or a part file (`Memo.Zone.tsx`) imported it must be named by the pages that need it, or moved to where it is used. A member replaced at run time (`Obj.part = other`) is not seen by files that named the original member; read the object whole (pass it on) in the file that depends on the replacement.
|
|
124
|
+
- A slice, init, view or edit object written by hand (`{ refName, sliceName, … }`) or deep-copied (`JSON.parse(JSON.stringify(init))`, `structuredClone(init)`, a cache that stores it as JSON) carries no reference to its model, and neither does a slice parameter that is reassigned or has a default value. On a route where no client file names the model, the framework list, view or form finds no store: in development the error names the store's module and this cause, and in production the page shows nothing where the slice is read. `akan quality runtime` does not report this. Take the object from `fetch`, hand it over uncopied or spread (`{ ...init }`), or name the model in a client file of the route (`st.use.<key>()`).
|
|
125
|
+
- A model looked up by name (`ConstantRegistry.getDatabase("memo")`) is found only on a page that names it: name it in that file (`cnst.Memo`) or read `cnst` whole there. On every page, a registered model's `_`-prefixed member read as a value is `undefined`, where it was `null`; those members are types.
|
|
126
|
+
- A `"use client"` component that builds an endpoint's description key from data (`` l(`${module}.signal.${endpoint}.desc`) ``) gets the text on the server and the raw key in the browser: React reports a hydration mismatch and the key shows. Write the key out, or read the text in a server component and pass it down. A text shown once outside React, such as a toast that calls `Translator.translateByLocale`, can wait on `Translator.ready(lang, key)` so a late module's text is not shown as its key.
|
|
127
|
+
|
|
128
|
+
_How to check._ Run `akan build <app>`, then `akan quality runtime`: it names each file that keeps a page on the whole runtime or the whole dictionary, the line, the reason and the routes. `akan preview <app>` opens the pages and reports what they throw.
|
|
129
|
+
|
|
130
|
+
_How to keep a page on the whole runtime._ In app code: a route keeps the whole runtime when it renders a client file that exports the store, since any file may then read any module through it.
|
|
131
|
+
|
|
132
|
+
```tsx
|
|
133
|
+
// apps/<app>/ui/WholeRuntime.tsx
|
|
134
|
+
"use client";
|
|
135
|
+
import { st } from "@apps/<app>/client";
|
|
136
|
+
|
|
137
|
+
export const wholeRuntime = st;
|
|
138
|
+
|
|
139
|
+
export const WholeRuntime = () => null;
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Render `<WholeRuntime />` in one page to keep that route, or in the root layout (`page/_layout.tsx`) to keep every route. `akan quality runtime` then lists the file under `[reader]` with the routes it holds. A route kept this way loads more than before, so `akan build --check-budget` may name it; `akan build <app> --raise-budget` raises its entry. Use it to ship while the files `akan quality runtime` names are changed, or for a route that reaches a store, an endpoint or a model by a name the build cannot read.
|
|
143
|
+
|
|
144
|
+
- a708a40: A server-rendered page starts from a small page runtime, the first step toward loading a model's endpoint descriptors and store in the browser only on the routes that use them.
|
|
145
|
+
|
|
146
|
+
- Each client entry of a server-rendered page starts from `lib/usePage.ts` (`usePage`, `msg`, `Err` and a fetch client carrying only the framework's own descriptors, such as `ping`, from `lib/__client/_base.fetch.ts`) instead of `lib/useClient.ts` and `lib/st.ts`. A client module that imports `fetch` or `st` from an app or lib `client` barrel still brings that scope's descriptors and stores, and a lib's barrel brings that lib and the libs under it.
|
|
147
|
+
- The framework components that reach a store, an endpoint or a registered constant by a name they compute (`Load`, `Model`, `Data`, `Signal`, `Constant.Doc` and the relation fields) import an empty module, `akanjs/ui/modelRuntime`. A route build keeps the app's `lib/useClient.ts` and `lib/st.ts` in every client entry reaching it, so a page rendering one of them loads the app's whole runtime before the component runs. A test in `akanjs` fails when a `ui` file reaches a model that way without importing it.
|
|
148
|
+
- Server rendering, CSR bundles (MCP App views included) and native apps keep loading the whole runtime. The development server narrows imports from `akanjs/ui` as a production build does, so a missing import shows there too.
|
|
149
|
+
- An app whose generated files predate `lib/usePage.ts` or `lib/__client/_base.fetch.ts` builds with the whole runtime on every page until it is synced.
|
|
150
|
+
- `StoreBootstrap.importLines` and `StoreBootstrap.source` in `@akanjs/devkit` take an optional scope, `"whole"` (the default) or `"page"`.
|
|
151
|
+
|
|
152
|
+
**Upgrading.**
|
|
153
|
+
|
|
154
|
+
What a page stops loading, and what to check for, is in the upgrade note of the entry that makes every app load per route.
|
|
155
|
+
|
|
156
|
+
- 217b061: `akan code` on the default `local` profile now asks before it runs a shell command, as it already did before reaching an unlisted host. File reads, writes and edits are not asked about.
|
|
157
|
+
|
|
158
|
+
**Upgrading.** An interactive `akan code` session shows `approve? run: <command> [y/n/a]` before each shell command; `a` answers yes and stops asking about that command until the session ends. Pass `--no-ask-commands` to run them unasked as before, or `--no-ask` to stop the network questions as well. A one-shot `akan code "<prompt>"` and a sub-agent have nobody to ask, so their commands run as before. A program that drives `akan code --rpc` on the `local` profile receives an `approval` event for each command and answers it with `approve`, as it does for the `web` profile's writes; `codeAgentPresets.local(root).approval` is now `"commands"`.
|
|
159
|
+
|
|
160
|
+
- e704d16: The Dockerfile `akan build` writes runs the server as oven/bun's `bun` user (uid 1000) on a base image pinned by digest, and the Helm chart in `infra/app` runs the pod as that user with no privilege escalation and holds the Ingress to the app's own body limit and CORS answer.
|
|
161
|
+
|
|
162
|
+
**Image**
|
|
163
|
+
|
|
164
|
+
- The base is `oven/bun:1.4.4-slim@sha256:…`, the multi-arch index's digest, so every build of a release, amd64 and arm64 alike, starts from the same Bun the workspace pins. A test fails when the image tag and the repo's Bun version disagree.
|
|
165
|
+
- `apt-get`, `preRuns`, `bun install` and `postRuns` still run as root, and the app files, `node_modules` included, stay root's and read-only to the server. uid 1000 owns only the directories the server writes: `/workspace/sqlite`, `/workspace/local`, `/workspace/runtime` (the control socket), `/workspace/data` and `/workspace/.akan/artifact/image-cache`. An empty named volume mounted at `/workspace/sqlite` or `/workspace/local` starts out owned by uid 1000.
|
|
166
|
+
|
|
167
|
+
**Chart** (`infra/app`, not an npm package; its defaults now live in `infra/app/values.yaml`)
|
|
168
|
+
|
|
169
|
+
- `podSecurityContext`: `runAsNonRoot: true`, uid and gid 1000, `fsGroup: 1000` with `fsGroupChangePolicy: OnRootMismatch`, and seccomp `RuntimeDefault`.
|
|
170
|
+
- `securityContext` (the container's): `allowPrivilegeEscalation: false` and every capability dropped. `readOnlyRootFilesystem` stays off, because the server writes `/workspace/runtime`, `/workspace/.akan`, `/workspace/data` and `/tmp` inside the image.
|
|
171
|
+
- A values file replaces single keys of either, and `null` on a key drops that key. A block that is left out or `null`, as in a release upgraded with `helm upgrade --reuse-values` from values that predate it, renders these defaults; so do the `ingress` keys below.
|
|
172
|
+
- `volumePermissions.enabled: true`: in single mode, an init container from the app's own image runs as root with only `CHOWN`, `FOWNER` and `DAC_READ_SEARCH` before the app starts, and hands every file on the `sqlite-data` claim that another uid or gid owns to `podSecurityContext`'s `runAsUser:runAsGroup`. Once ownership is right it changes nothing. Cluster mode has no such claim, and a `sharedClaim` is not touched.
|
|
173
|
+
- `ingress.proxyBodySize: 128m`: the Ingress passes a body up to the server's upload limit (`AKAN_MAX_UPLOAD_BODY`, 128 MiB) and answers a larger one 413 itself, as the server would.
|
|
174
|
+
- `ingress.cors.enabled: false`: the app's own CORS answer reaches the browser. Its native shells and the origins in `option.setCrossSite({ allowedOrigins })` get their origin back, a preflight gets every header it asked for (`idempotency-key` and the MCP headers included), and fonts keep `Access-Control-Allow-Origin: *`. Nothing else carries it, since `allowedOrigins` covers `/api` only.
|
|
175
|
+
|
|
176
|
+
**Upgrading.**
|
|
177
|
+
|
|
178
|
+
- A Docker volume or bind mount that an image of 3.2.0 or earlier already wrote is owned by root, so the new image stops at boot with `directoryNotWritable`, which names the directory, its owner and the `chown` that fixes it. Change its owner once, for example `docker run --rm -u 0 -v <volume>:/workspace/sqlite <image> chown -R 1000:1000 /workspace/sqlite`, and the same for a volume at `/workspace/local`. A new named volume mounted anywhere else, such as `/data`, starts out owned by root: mount it at `/workspace/sqlite` or `/workspace/local`, or `chown` it once the same way. To keep running as root, start the container with `--user 0:0` (compose: `user: "0:0"`), or declare `docker` as a whole Dockerfile string.
|
|
179
|
+
- A directory a `postRuns` step creates for the server to write needs `chown 1000:1000` in that step.
|
|
180
|
+
- On the chart, the `volumePermissions` init container hands the `sqlite-data` claim a root image wrote to uid 1000 at the first start, hostPath, NFS and CSI volumes the kubelet's `fsGroup` skips included. A cluster's `sharedClaim` needs the one-time `chown -R 1000:1000`. An image without `sh` and `find` needs `volumePermissions: { enabled: false }`.
|
|
181
|
+
- The chart runs the pod as uid 1000, so it needs an image whose server can run as that user. An image built with akanjs 3.2 or earlier (a rollback to one through `image.tag` included), a declared `docker` Dockerfile string that runs the server as root, or a custom `docker.image` whose files uid 1000 cannot read, needs these lines in the app's values file, which run the pod as root as before:
|
|
182
|
+
|
|
183
|
+
```yaml
|
|
184
|
+
podSecurityContext: { runAsUser: 0, runAsGroup: 0, runAsNonRoot: false }
|
|
185
|
+
securityContext: { capabilities: null }
|
|
186
|
+
volumePermissions: { enabled: false }
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
- A request body over 128 MiB, which the server refused after the Ingress read it, now gets 413 from the Ingress. An app that raised `AKAN_MAX_UPLOAD_BODY` raises `ingress.proxyBodySize` with it; `ingress.proxyBodySize: "0"` passes any size again.
|
|
190
|
+
- The Ingress no longer answers a preflight itself or adds `Access-Control-Allow-Origin: *` to every response. A page on an origin the app does not list could read the app's GET responses through that header, and now cannot: add its origin to `option.setCrossSite({ allowedOrigins })`, or write `ingress: { cors: { enabled: true } }` in the app's values file for the old annotations. `allowedOrigins` covers `/api` only: a page on another origin that `fetch`es a public file, such as a JSON file under `public/`, or draws an `/_akan/image` response onto a canvas, now fails, since only fonts keep `Access-Control-Allow-Origin: *`; for those, `ingress: { cors: { enabled: true } }` is the remedy.
|
|
191
|
+
|
|
192
|
+
- aff1ba2: An external view opens only origins the app's config lists, in `native.desktop.externalView.allowOrigins`: a view's own `allowOrigins` narrow within them, and an origin outside them is `NOT_ALLOWED`, naming that key. `evaluate` and `initScript` need their own permission, granted by `desktop.externalView.evaluate: true`, and `sendKey` its own, granted by `desktop.externalView.sendKey: true`; both are off by default. While a view is open, opening its id again keeps its origins or narrows them, and refuses one it was not opened for; once closed, the id opens again for any origins the config lists, with the same browser profile, which belongs to the id. Origins compare exactly as the URL parser reads them: scheme, host and port, the host in punycode without a trailing dot, the default port left out, and an origin with user info refused; there are no wildcards. A view loads a URL as the URL parser writes it, so the engine never reads the page's text another way. A page opens a view only over its own window. The desktop shell checks all of this itself on macOS, Windows and Linux, and grants nothing when the build carries no permission list; on Windows a view now takes only the two DevTools calls `sendKey` and `capture` make. A top-level navigation or redirect off a view's origins stays refused, as before.
|
|
193
|
+
|
|
194
|
+
A plugin manifest's `scope` can say `required: true`: then every grant of the plugin, not only `<plugin>:default`, is within its `defaultScope` unless the grant gives its own `allow`, and a scope entry naming no field is a build error. `external-view` says so.
|
|
195
|
+
|
|
196
|
+
**Upgrading.** An app that lists `external-view` opens no view until its `akan.config.ts` names the origins, and needs `evaluate` and `sendKey` only for the calls it makes:
|
|
197
|
+
|
|
198
|
+
```ts
|
|
199
|
+
native: {
|
|
200
|
+
plugins: ["external-view"],
|
|
201
|
+
desktop: {
|
|
202
|
+
externalView: {
|
|
203
|
+
allowOrigins: ["https://board.example"], // every origin a view's allowOrigins names
|
|
204
|
+
evaluate: true, // when it calls evaluate or opens with initScript
|
|
205
|
+
sendKey: true, // when it calls sendKey
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
An app built with the akan-native CLI's own config grants the same in its capabilities: `{ identifier: "external-view:default", allow: [{ origin: "https://board.example" }] }`, `"external-view:allow-evaluate"` and `"external-view:allow-sendKey"`. A grant of `external-view:all` or `external-view:allow-open` opens no origin unless its own `allow` lists them. A page that passed `window` to `open` passes its own window or leaves it out.
|
|
212
|
+
|
|
213
|
+
- 1712cf0: The image carries `bin`. `akan build` fetches each `bin` entry's `linux-x64` and `linux-arm64` file into the build's `bin/amd64/` and `bin/arm64/`, and the generated Dockerfile puts the folder its `TARGETARCH` names first on PATH, so an executable the server spawns is declared once for the image and the desktop app. An entry with no Linux file is still left to `docker.preRuns`; one that has both now runs the carried file, which is ahead on PATH. An app that writes its own Dockerfile adds `ENV PATH=/workspace/bin/$TARGETARCH:$PATH` itself, and the build says so. `akan start` warns when a declared executable is not on the computer's PATH. The byte budget of the `akan-runtime` skill's `runtimeRule-3.md` is raised on purpose for the new text.
|
|
214
|
+
- 612f146: The generated image starts the server under an init, and the runtime guide covers a device on a LAN.
|
|
215
|
+
|
|
216
|
+
The Dockerfile `akan build` writes now installs `tini` and ends in `ENTRYPOINT ["tini","-s","--"]` before its `CMD`. With `bun` as PID 1, a process whose parent died first (the `ffmpeg` of a killed `sh -c '… | ffmpeg'`) was re-parented to it and stayed `<defunct>` for the life of the container, because Bun never waits for a child it did not start. tini reaps them, passes signals on to the server and exits with its code; `-s` keeps that working under `docker run --init` or a shared process namespace. `docker.command` is still the `CMD`, and `docker run <image> bun main.js ops …` runs as before. An app whose `docker` is a whole Dockerfile is not changed and adds an init itself.
|
|
217
|
+
|
|
218
|
+
The runtime guide gains two things. The image section says a device node needs its group as well as `--device` (`--group-add` with the host's numeric gid, or `supplementalGroups` in a pod), since the server is uid 1000 with no other group. A new section, "An Image On A Device", is the recipe for a board reached by IP with no domain: build `--env main` rather than `local`, what the serve domain is for when nothing resolves it, `AKAN_PUBLIC_OPERATION_MODE=edge`, the secrets to hand over, the two directories to put on volumes (`/workspace/sqlite`, `/workspace/local`), and that a browser session needs HTTPS outside operation mode `local`.
|
|
219
|
+
|
|
220
|
+
The guide's `runtimeRule-2.md` reference is 3987 bytes larger, and its budget is raised to match.
|
|
221
|
+
|
|
222
|
+
- 95a627a: A lib root takes a `script/` folder, for the tooling that makes the lib's own assets.
|
|
223
|
+
|
|
224
|
+
A lib had no folder that stays out of an image: the root allowlist refused `script/`, so a lib's build-time tooling (a model converter and its Dockerfile, say) could only sit under `private/`, which every app that mounts the lib ships as `private/libs/<lib>/`.
|
|
225
|
+
|
|
226
|
+
- **`libs/<lib>/script/` is allowed** by `akan sync`, `akan doctor` and the layout check. Nothing runs it and nothing copies it into an app, an image or a desktop build.
|
|
227
|
+
- **Its TypeScript is typechecked** with the lib's tests (`akan verify <lib>`, `akan typecheck <lib>`), as an app's `script/` is.
|
|
228
|
+
- **`libs/<lib>/script/migration` is refused** at sync, naming the folder: only an app's migrations are run, so one in a lib would never be applied.
|
|
229
|
+
|
|
230
|
+
The `app.md` agent rule grows by 246 bytes for the sentence that says so, and its budget is raised to match.
|
|
231
|
+
|
|
232
|
+
- 9c2a5d9: A lib's `akan.config.ts` takes `workers`, so a lib that spawns a worker declares it once.
|
|
233
|
+
|
|
234
|
+
Until now only an app's config took `workers`, and a lib whose adapter called `AppWorker.spawn("vision")` made every app that mounts it repeat `workers: { vision: "../../libs/<lib>/…" }`; an app without the line failed at run time with `workerNotDeclared`.
|
|
235
|
+
|
|
236
|
+
- **A lib declares its own workers.** `workers: { vision: "srvkit/vision.worker.ts" }` in `libs/<lib>/akan.config.ts`, the path relative to that config. Every app that depends on the lib builds `workers/vision.js` and resolves the name in `akan start` and `akan test`, with nothing in the app's config.
|
|
237
|
+
- **An app's own entry of the same name wins**, as with `bin`. Two libs an app depends on that name different files for one worker stop the start, the test run or the build, naming both configs, until the app's config picks one.
|
|
238
|
+
- **`akan test <lib>` knows the lib's workers** and those of the libs it depends on. A lib's own test run had no worker sources before.
|
|
239
|
+
- **A build carries only the workers of the libs the app depends on**, not those of every lib in the workspace.
|
|
240
|
+
|
|
241
|
+
Upgrade: an app that repeats a lib's worker can drop the line once the lib declares it; leaving it changes nothing. `LibConfigResult` gains a required `workers` field, which matters only to code that builds that object by hand. In `@akanjs/devkit`, `AkanWorkers.declare` is replaced by `AkanWorkers.select` and `AkanWorkers.publish`. The runtime guide's reference grows to five parts (`runtimeRule-5.md` is new, the budgets of `runtimeRule-4.md` and the `akan-runtime` `SKILL.md` are raised) because the new paragraph moved a part past the 28,000-character split.
|
|
242
|
+
|
|
243
|
+
- 8d75f2b: The public surface 3.2.0 deprecated is removed. `akanjs` and `@akanjs/devkit` publish only the subpaths their `exports` name, with no wildcard, so a file becomes public only when an entry names it.
|
|
244
|
+
|
|
245
|
+
- **`@akanjs/devkit` has no root aliases and no `./*` or `./*.ts`.** It publishes `@akanjs/devkit` (types only), `biome.base.json`, the facets `akanApp`, `akanConfig`, `artifact`, `cloud`, `codeAgent`, `commandDecorators`, `executors`, `frontendBuild`, `incrementalBuilder`, `mobile`, `pipeline`, `preview`, `transforms` and `workflow`, and the files `app/applicationBuildRunner`, `cloud/cloudApi`, `cloud/cloudUpdates`, `commandDecorators/exitCodeError`, `mobile/desktopRelease`, `mobile/serverBundleSecrets` and `transforms/serverEnvProfile`. `util/fileEditor`, `util/selectModel` and `workspace/getRelatedCnsts` are named too, and deprecated: nothing in akanjs uses them.
|
|
246
|
+
- **`akanjs` drops `akanjs/common/*`, `akanjs/server/*`, `akanjs/ui/*`, `akanjs/webkit/*` and `akanjs/client/native/*`.** Every `akanjs/client/native/<plugin>` path still resolves, now as its own entry, and so does `akanjs/webkit/usePurchase`. The layouts `akan` generates import `akanjs/ui/System/index.tsx`, `akanjs/ui/System/SSR.tsx`, `akanjs/ui/UiOverride/UiOverride.tsx` and `akanjs/webkit/RouteLevelBoundary.tsx`, and the `akan` command's bundled `@akanjs/language` imports `akanjs/common/akanNames.ts`, `akanjs/common/facetBarrel.ts` and `akanjs/common/routeConvention.ts`: these stay as named entries. `@akanjs/language`'s declarations now import their types from `akanjs/common`. Barrel imports in an installed workspace's build now resolve to files on disk instead of package subpaths.
|
|
247
|
+
- **The error-constructor plumbing is gone**: `setErrorConstructor` on `FetchClient`, `HttpClient` and `WsClient`, `HttpClientOptions.ErrorCls`, and `FetchClient.build`'s `Err` option. Every restored error is `akanjs/common`'s `Err`, as it already was. `registerClientRuntime` no longer re-points the shared client at the runtime's `Err`.
|
|
248
|
+
- **Thirteen deprecated exports are deleted, and eleven internals are no longer exported.**
|
|
249
|
+
|
|
250
|
+
**Upgrading.**
|
|
251
|
+
|
|
252
|
+
- `@akanjs/devkit/<name>` and `@akanjs/devkit/<name>.ts`, for 81 root names, and `@akanjs/devkit/executors.ts` (`@akanjs/devkit/executors` stays, as a facet):
|
|
253
|
+
- `applicationBuildRunner` → `@akanjs/devkit/app/applicationBuildRunner`, `fileEditor` → `@akanjs/devkit/util/fileEditor`, `selectModel` → `@akanjs/devkit/util/selectModel` and `getRelatedCnsts` → `@akanjs/devkit/workspace/getRelatedCnsts` (the last three are deprecated).
|
|
254
|
+
- Import the types of `akanContext`, `akanMcpContract`, `applicationBuildReporter`, `applicationTestPreload`, `createTunnel`, `dependencyScanner`, `fileSys`, `maintainabilityContract`, `packageExportsMap`, `prompter`, `qualityScanner`, `recipeScanner`, `scanInfo`, `spinner`, `stripAnsi`, `typeChecker` and `types` from `@akanjs/devkit`. Their values have no public entry.
|
|
255
|
+
- `abstractDoc`, `agentAssets`, `agentsIndex`, `akanMcpToolError`, `apiReference`, `appSelectionMemory`, `bareErrorScanner`, `biomeBase`, `codegenLock`, `commentDensityScanner`, `componentSizeScanner`, `componentWriteChainScanner`, `conventionSet`, `declarationReader`, `deprecatedCommentScanner`, `endpointReach`, `envSeed`, `errorCodeReference`, `errorCodeScan`, `formSetterScanner`, `frameworkGraph`, `gitRevision`, `jsonFormatter`, `kindBranchScanner`, `libSource`, `linter`, `maintainabilityBaseline`, `maintainabilityExceptionScanner`, `maintainabilityLimits`, `maintainabilityReport`, `manifestDependencies`, `moduleFieldNames`, `renderMutationScanner`, `repoIdentity`, `routeJsBudget`, `routeSourceValidator`, `semver`, `serviceLoopCallScanner`, `shellOnlyEnv`, `signalMutationIndex`, `slicePlanner`, `sourceComments`, `sshHostKeys`, `sshTunnel`, `ssrScanner`, `storeAccessScanner`, `storeSource`, `storeWriteScanner`, `structureScanner`, `subspace`, `subspaceClone`, `subspaceConfig`, `subspaceReport`, `testHelpers`, `testOnlyExportScanner`, `workspaceGraph`, `workspaceLayout`, `writePath`, `writePlacementScanner` and `writingActionIndex` have no replacement: they are the `akan` command's internals, which its build inlines.
|
|
256
|
+
- Any other `@akanjs/devkit/<dir>/<file>` that only `./*` reached: import its types from `@akanjs/devkit` where that barrel exports them; it is otherwise internal, with no replacement.
|
|
257
|
+
- `akanjs/<common|server|ui|webkit>/<file>`: import from the barrel, `akanjs/common`, `akanjs/server`, `akanjs/ui` or `akanjs/webkit` (`akanjs/server/machine/machineToken` → `akanjs/server`; `akanjs/ui/Constant/schemaDoc` → `akanjs/ui`), or from a named entry such as `akanjs/server/tunnel` for `akanjs/server/tunnel/index.ts`. A file no barrel re-exports is internal, `SignalResolver` and `akanjs/ui/Agent/RichInput` included, with no replacement: check which routes an endpoint serves with a signal test (`akan test <app>`) rather than through `SignalResolver.resolveEndpoint`. These 28 were public only through a wildcard and are internal now: `isIndexable`; `DEFAULT_HTML_CONTENT_SECURITY_POLICY`, `htmlContentSecurityPolicy`, `DEFAULT_STRICT_TRANSPORT_SECURITY`, `CONTENT_ENCODINGS`, `topologicalStages`, `traceCycle`, `getSystemPageErrorDetails`, `SYSTEM_PAGE_STYLE`, `getSameOriginHref`, `carriesCredentials`, `DEFAULT_ROUTE_CACHE_TTL_SECONDS`, `isAkanRouterStateV1`, `countCommonRouteSegments`, `AKAN_RSC_STATE_VERSION`, `decodeAkanRedirectDigest` and `validateRscSegmentPatch` (server); `getKeyboardAccessorySlots`, `blurActiveElement`, `KEYBOARD_SHOW_ANIMATION_DURATION_MS`, `KEYBOARD_HIDE_ANIMATION_DURATION_MS`, `KEYBOARD_SHOW_ANIMATION_EASING`, `KEYBOARD_HIDE_ANIMATION_EASING` and `clonePageState` (webkit); `DefaultPagination`, `DefaultTable`, `DefaultUnauthorized` and `isPublicEndpoint` (ui).
|
|
258
|
+
- `fetch.setErrorConstructor(Err)` in an older `lib/sig.ts`, and `{ Err: pageProto.Err }` passed to `FetchClient.build` in an older `lib/useClient.ts`: run `akan sync`, which rewrites both. Elsewhere, drop the `setErrorConstructor` call, the `ErrorCls` option and the `Err` option. A `FetchClient` constructed with its own error class still restores its WebSocket, bridge, refusal and abort errors into it, but an HTTP response error is always `Err`.
|
|
259
|
+
- `MAX_INT` → `2 ** 31 - 1`. `isFilterModel(ref)` → `getFilterMeta(ref, { allowEmpty: true }) !== undefined`. `setFilterInfoByKey` → declare the query with `from(model, (filter) => …)`. `getDefaultSchemaOptions()` → `new DocumentSchema()`. `runWithTrace` → `runTraced`, only where the caller owns the trace, since it finalizes it. `traceDbQuery(ms)` → `getCurrentTrace()?.countDbQuery(ms)`. `isSitemapPath(pathname, basePaths)` → `getSitemapBasePath(pathname, basePaths, headerBasePath) !== undefined`. `useRscNavigation` → `navigateRsc`, `clearRscNavigationCache` and `isRscNavigationFromCache`. `getSearchParam` and `getBaseSearchParam` → read `searchParams[key]`, taking the first value of an array. `dictionaryContext`, `groupByOwner` and `ServiceRegistry` have no replacement.
|
|
260
|
+
- No longer exported, with no replacement: `setFilterMeta` and `getFilterArgInfo` (`akanjs/document`), `isDebugHeaderAllowed` (`akanjs/signal`), `parseAkanConsoleQuery`, `createAkanConsoleLogCommands` and `createAkanConsoleContext` (`akanjs/server`), `isResponsiveInset`, `getClientRuntime`, `colorTokens` and `radiusTokens` (`akanjs/client`), and `isStateBuilderMarker` (`akanjs/store`).
|
|
261
|
+
|
|
262
|
+
- bfa67d8: The descriptions of API endpoints leave the dictionary file every page loads, and load only on a page that shows them.
|
|
263
|
+
|
|
264
|
+
- `akan build` and the development server write two files per language under `/_akan/dict`: the page dictionary, without the `.desc` and `.arg` texts of each `signal` entry, and an API file holding exactly those. The page file names the API file in an exported `parts` map. The endpoint labels stay in the page file.
|
|
265
|
+
- Each `Signal` component of `akanjs/ui` that shows an endpoint's description or argument texts, `Signal.Arg.Table` rendered on its own included, loads the API file before it shows them: a server-rendered page preloads it and carries its texts in the HTML, and a client navigation into such a page waits for it. A page showing no description never requests it. A file that fails to load is retried once; after a second failure the page shows without descriptions and logs the error, and the next navigation tries again.
|
|
266
|
+
- The server, MCP, the API and schema reference routes and a CSR build keep the whole dictionary.
|
|
267
|
+
- `TranslatorState` merges the files of a language into its dictionary, each file once. A language switch keeps each language's merged files to that language, and a file arriving after its language moved to another build is dropped. A page dictionary asked for before another of the same language but answering after it no longer replaces the newer one.
|
|
268
|
+
- `akan build` prints one line per language with the brotli size of each file: `Dictionary en: 4.9KB brotli on every page, API descriptions 836B where shown`.
|
|
269
|
+
- `DictionaryAssetBuilder.build` in `@akanjs/devkit` takes an option `{ splitApi }`.
|
|
270
|
+
|
|
271
|
+
**Upgrading.**
|
|
272
|
+
|
|
273
|
+
A `"use client"` component of your own that writes an endpoint's description or argument key out (`l("<module>.signal.<endpoint>.desc")`) brings the API file to its route. What happens to one that builds the key from data is in the upgrade note of the entry that makes every app load per route.
|
|
274
|
+
|
|
275
|
+
- 6f8f6aa: A page loads the dictionary texts it can show rather than every module's.
|
|
276
|
+
|
|
277
|
+
- **What a route can show.** `akan build` and the development server read the keys each route's client modules name: a written key, a template whose module name is written, and a key picked from literal values or property names of an object in the same file, from a typed union, or from a template type with a written module name. To those they add the models, scalars and enums whose labels and options the framework's lists, views, forms and remove dialogs build at run time, reached through the module pieces the route loads, and `base`. A route that hands the translator on or keeps it in a variable, or has a key the build cannot follow, such as one read from data, loads the whole page dictionary, and `akan build` warns with its file, line and reason. A route that renders a `Signal` or `Constant` component loads the whole page dictionary too, and so does a route that keeps the whole client runtime, whose files `akan quality runtime` names. Server components need nothing: their texts arrive rendered.
|
|
278
|
+
- **Files.** Each language's dictionary is packed into files by module, sized on the default language, so that a route loads at most four of them besides the API description file. Each file is written to `/_akan/dict` with the table naming the file of every module. A route whose client components name an endpoint's description or argument key loads the API description file with them.
|
|
279
|
+
- **Loading.** A server-rendered page preloads its route's files and merges them before hydration; a client navigation merges the next route's files before the new page commits; a language switch loads that language's files. Each file is requested once per language, and a file that fails is tried again.
|
|
280
|
+
- **Safety net.** A key of a module the route's files leave out loads that module's file, and the page renders again once it merges, so the key shows only until then. A toast from `msg`, an action error or an agent message waits for its text rather than showing the key. Development logs the first such key of each module once; production never throws.
|
|
281
|
+
- **Development.** `akan start` writes one file per module and loads what each route's build counted, so saving a `*.dictionary.ts` file updates the page as in production. The save restarts the backend, and a page open meanwhile now takes the new texts without a reload: `RenderState.dictionaryStamp` names the dictionary files the backend serves, and the development socket's greeting carries it. A route's modules are read when it builds, so a key added to a client file and saved shows as the key, with that log, until the route builds again.
|
|
282
|
+
- **Unchanged.** The server, MCP and the single-file CSR build that native apps load keep the whole dictionary inline.
|
|
283
|
+
- **Size.** In the framework's sample apps, the English dictionary a first visit downloads drops from 4.9 KB (brotli) to 2.5 KB on the median route of `minimal`, and from 5.0 KB to 4.0 KB on `akan`, in one request on the median route and at most two. The loader adds about 1.4 KB to every route's JavaScript.
|
|
284
|
+
- `akan build` prints one line per language: `Dictionary en: first visit 2.5KB / 2.5KB / 3.0KB brotli on the lightest / median / largest route (whole 5.0KB), API descriptions 846B where shown`.
|
|
285
|
+
- `Translator.ready(lang, key)` answers `null` when the key's module is loaded, or a promise settling once it is. `DictionaryAssetBuilder.buildAll` in `@akanjs/devkit` takes `{ routes, everyGroupAlone }` beside `{ splitApi }`.
|
|
286
|
+
|
|
287
|
+
**Upgrading.**
|
|
288
|
+
|
|
289
|
+
A client component whose key the build cannot follow makes its route load the whole dictionary, and `akan build` names it: writing the key out, or picking it from an object or union in the same file, lets the route load only its own files. A text shown outside React is covered in the upgrade note of the entry that makes every app load per route.
|
|
290
|
+
|
|
291
|
+
- ee302c4: A page loads less of the framework's own UI code: the icons its files name rather than whole `react-icons` sets, no agent library unless it has an agent, no spring library for a dialog, and the gesture library only when a sheet is first pressed. This applies to every app; what a page shows and how it behaves do not change.
|
|
292
|
+
|
|
293
|
+
- **Icons.** A production browser build rewrites each named import from a `react-icons/<set>` package to a module written to the app's `.akan/generated/react-icons`, and each icon lives in exactly one such module: the naming file's own when one file names it, the app's shared module for that set when only the app's files name it, or the set's module shared with the workspace's libs and the framework when one of them names it too. A page loads each icon it uses once, and can carry the other icons of a shared module it touches, never more of a set than the whole set held. A name the set does not define as a plain icon, a namespace or default import, and a re-export keep the set. The server bundle keeps the set, and both draw the same markup. The development server already loaded icons per file.
|
|
294
|
+
- **Agent.** A server-rendered page no longer loads `use-agentic` for its page gate, so a page without an agent ships only the part of it that `akanjs/store` uses. `Agent.Chat`, `useAgent` and `SessionContext` work as before.
|
|
295
|
+
- **Dialog.** `Dialog.LegacyModal` loads the first time it renders, behind its own Suspense boundary, so `<Dialog>`, `Dialog.Modal` and `Modal` no longer load it or `@react-spring/web`. `Dialog.LegacyModal` remains a member of `Dialog`.
|
|
296
|
+
- **Drag to dismiss.** `BottomSheet`, `Dialog.Modal` and `Dialog.LegacyModal` load `@use-gesture/react` on the first press of their drag handle; the events that arrive while it loads are replayed into it, so the first drag, its flick speed and a tap land as a later one does.
|
|
297
|
+
- **Field.** `Field.Text` and `Field.TextArea` are memoized in their own file, so `Field`'s file only gathers its members: a page that names `Field.Text` loads that kind's file and not every kind, and a server component that names only members can render it. In a CSR bundle `Field` stays one client module, as before.
|
|
298
|
+
|
|
299
|
+
**Upgrading.**
|
|
300
|
+
|
|
301
|
+
Nothing to do, with one change in timing: `Dialog.LegacyModal`, and the top-level `LegacyModal` that renders through it, load in a chunk of their own, with `@react-spring/web`, the first time they render. A legacy modal mounted only when it opens therefore shows its first open one chunk load later; it then springs in from transparent as a later open does, nothing is drawn in its place meanwhile, and the open is not lost. A test that expects its content in the first render must wait for it.
|
|
302
|
+
|
|
303
|
+
- 62bcf74: A client file that names a store, a slice or an endpoint in one of the common indirect ways now loads only the modules it names, where before it kept the whole client runtime for itself and for every page reaching it.
|
|
304
|
+
|
|
305
|
+
- **A cast hides nothing.** `(st.use as Loose).memoList()`, `const { self } = st.get() as Wide`, `!`, `satisfies` and `<T>value` are read as the name written after them. A name the runtime does not have is reported as an unknown name, a computed key stays computed, and an object handed on stays handed on. `const get = st.get` called later reads the state as `st.get()` does, and the framework's `fetch` cast to the app's is read as the app's.
|
|
306
|
+
- **A key asserted as a name is read as that name.** `st.slice[sliceName as "memo"]`, or `const key = name as "memoList"` followed by `const { [key]: list } = this.get()`, `this.set({ [key]: list })` or `this.pick(key)`. Asserting a key as a name tells the build the value is that name or one owned by the same module. A union of names counts as each of them.
|
|
307
|
+
- **A name built from a slice the function is handed.** `` st.use[`queryArgsOf${capitalize(slice.sliceName)}`] `` loads nothing of its own when `slice` is a parameter or prop typed `SliceMeta` of `akanjs/fetch` and the name is put together from its `sliceName` or `refName` with `capitalize` of `akanjs/common`, a template or `+`: the slice arrived with its model, from `fetch` or `st.slice` in a client file or from the server with the model's reference. Where a name it may stand for belongs to a module that arrival does not load, the file loads that module itself.
|
|
308
|
+
- **A slice written out by hand in a client file loads its model.** `{ refName: "memo", sliceName: "memoInBoard", argLength: 0 }` is read as naming `memoInBoard`; with names that are not written out the file keeps the whole runtime. A `sliceName` copied from a handed `SliceMeta` parameter (`{ refName: slice.refName, sliceName: slice.sliceName }`, or the same names taken out by destructuring) loads nothing, and a server module doing so no longer makes the route count every model's reference.
|
|
309
|
+
- **State handed to a function of the same file** (`MemoStore.announce(this.get())`, a `const` arrow, a function declaration or a static method) is read where that function reads it.
|
|
310
|
+
- **`akanjs/store/agent`.** `ScreenSettle`, `ScreenTarget`, `ScreenReader`, `ScreenFlash`, `ScreenImage`, `AgentCursor`, `AgentVisual` and `AgentPrompts` no longer keep the whole runtime; `AgentBridge` and `AgentContext` hold the root store's registry, `StoreSurfaceSource` reaches it through `AgentBridge` and keeps one surface per page on `globalThis`, and `StoreCatalogue` imports only types of the store but lists every model in the constant registry; those four still keep the whole runtime.
|
|
311
|
+
- The note of `akan quality runtime` for a read that still keeps the whole runtime now ends with what to write instead: assert the key as a name, name the endpoint, take the slice as a parameter, or read the names where the object is. The `cast` reason is gone from its output.
|
|
312
|
+
|
|
313
|
+
**Upgrading.**
|
|
314
|
+
|
|
315
|
+
A client component that builds a store or endpoint name from a slice it was handed now relies on that slice arriving with its model; before, the reading file kept the whole runtime. What that means for a slice written or copied by hand is in the upgrade note of the entry that makes every app load per route.
|
|
316
|
+
|
|
317
|
+
- 6e5da23: `akan build` no longer puts the secret values of `env/env.server.<env>.ts` into the server it builds. The server reads each one from an environment variable when it starts, and says at boot which ones its deployment has not set.
|
|
318
|
+
|
|
319
|
+
- **What counts as a secret.** A string under a secret-sounding key (password, secret, token, apiKey, privateKey, accessKey, webhook, …), at any depth below it, or a URL with a password in it. It is the rule a desktop profile build already applies and the logger masks by, now also for a key named `aesKey`. Numbers, booleans, `null` and every other string stay in the build as before.
|
|
320
|
+
- **Where it is read from.** A variable named after the value's place in the env file, one upper snake case segment per key joined with `__`: `security.sso.google.clientSecret` is read from `SECURITY__SSO__GOOGLE__CLIENT_SECRET`. An array holding a secret is read whole from one variable holding JSON (`discord.tokens` from `DISCORD__TOKENS`). Four settings keep the names the framework already reads: `security.jwtSecret` is `JWT_SECRET`, and `database.postgres.url`, `.password` and `.insightUrl` are `POSTGRES_URL` (or `POSTGRES_URI`), `POSTGRES_PASSWORD` and `POSTGRES_INSIGHT_URL`. In `process.env.MY_VAR ?? "literal"` only the literal is replaced, so your own variable still comes first.
|
|
321
|
+
- **What the build writes.** `akan.env.json` and the Dockerfile gain `AKAN_ENV_NAMES`, the names the server reads (never a value), and the build prints them.
|
|
322
|
+
- **`akan secret-env <app> [--env <env>]`** lists each variable, its kind, its key in the env file and whether the shell sets it. With `--out <file>` it writes the values from the env file: `--format k8s` (the default) a Kubernetes Secret named by `--name` (default `<app>-env`), `--format dotenv` `NAME=value` lines that Bun's loader reads back unchanged. The file is readable by its user alone; a path under `dist/`, a path git would track, and an existing file without `--force` are refused.
|
|
323
|
+
- **At boot** (`AkanApp.start`, before the server is loaded or a replica is spawned) a variable that is not set is one warning naming every such variable. The framework does not stop for them, though whatever reads a value may, as a missing `JWT_SECRET` does. A JSON variable that does not parse is refused with the code `secretEnvInvalid`. A multi-line value that arrives with a backslash and an n in place of its line breaks is warned about by name.
|
|
324
|
+
- **What stops a build.** A secret-named key whose value the env file computes or imports rather than writes as a string stops the build before it writes anything, whatever the value's length, naming the app, the env file and the keys. After the bundles are written, the build looks in them for each secret string it left out: a long mixed one that another key of the env, the app's code or a copied file holds as well stops the build by its keys, and a short or plain one is a warning. No message prints a value.
|
|
325
|
+
- **Your own `process.env` reads stay yours.** A secret-named key the env file reads from `process.env.<NAME>` itself is left as that read: the build does not move it, does not stop at it, and writes no value of it, whether or not the build's shell sets the variable.
|
|
326
|
+
- **How the build finds the secrets.** It loads the env file, first with none of the shell's variables, so the list is the same from any shell, and with them when the file cannot load without (`process.env.HOSTS!.split(",")`). A file that loads neither way stops the build with the error's class and its file and line, never its message. Loading has a 60 second limit.
|
|
327
|
+
- **Unchanged:** your env files, `akan start`, `akan test`, `--profile` builds, and desktop and mobile builds, whose carried server still bundles its env file as written.
|
|
328
|
+
|
|
329
|
+
**Upgrading.** This changes how every app deploys. Before you deploy an image built with this version:
|
|
330
|
+
|
|
331
|
+
1. Run `akan secret-env <app> --env <env>` for each app and environment you deploy. It lists the variables the server now expects. It prints names, never values.
|
|
332
|
+
2. Give the server those variables.
|
|
333
|
+
- Kubernetes: `akan secret-env <app> --env <env> --format k8s --name <secret-name> --out <file>`, `kubectl apply -f <file>` in the app's namespace, reference the Secret from the container with `envFrom: [{ secretRef: { name: <secret-name> } }]`, then delete the file.
|
|
334
|
+
- Docker: `docker run -e NAME=value …`. `docker run --env-file` takes each line as written, so of a `--format dotenv` file it reads the values written without quotes and no quoted or multi-line one: pass those with `-e`.
|
|
335
|
+
- `bun main.js` on a host: `bun --env-file=<file> main.js` with the dotenv file, or set the variables in the service's environment. Keep the file outside `dist/apps/<app>`, which the image copies whole.
|
|
336
|
+
- Another platform: set them in its secret settings.
|
|
337
|
+
3. Deploy. At start the server logs one warning naming any variable it is missing. The framework does not stop for it, though whatever reads the value may. Version 3.5.0 will refuse to start instead.
|
|
338
|
+
4. When the new images are live, rotate those secrets and delete the old image tags. Images built before this version still contain the values.
|
|
339
|
+
5. If you cannot change your deployment yet, build with `akan build <app> --inline-secrets`. The image then carries the values as before, and a variable you set still wins. When the env file cannot be loaded, this build warns and bundles the env files as written, reading no variable. Version 3.5.0 removes the flag.
|
|
340
|
+
6. If a build stops with "holds … this build cannot leave out", each named key is computed or imported in the env file. Write the string at the key, or write `process.env.<NAME>` there and set that variable in the deployment.
|
|
341
|
+
7. If a build stops with "holds secret values the server reads from its process env", a secret string is also somewhere the build keeps as written: the plain key the message names, the app's code, or a copied file. Take it out there, or read it there from the same variable.
|
|
342
|
+
8. If a build stops with "could not be evaluated to check it for secrets", the env file throws at the named line when it is loaded. Set the variable it reads there in the build's shell, or give it a fallback.
|
|
343
|
+
9. If a build stops at a key "a build would read from the environment variable …", two keys map to one variable name, or the name is one the platform or akan owns (`PWD`, `HOSTNAME`, `AKAN_*`, …). Rename the key, or write `process.env.<NAME>` there yourself.
|
|
344
|
+
|
|
345
|
+
A key file an env value points at by path (an Apple sign-in key under `private/`) is not an env value and still ships in the image: mount it instead. A key the rule does not recognise (`stripeKey`, a `salt`) stays in the build; write `process.env.<NAME>` for it.
|
|
346
|
+
|
|
5
347
|
### Patch Changes
|
|
6
348
|
|
|
349
|
+
- 4a568b2: What an agent turn carries beside the conversation reaches the model as marked data in a user turn, outside the system prompt.
|
|
350
|
+
|
|
351
|
+
- **A turn's `context` is no longer written into the system prompt.** `OpenaiDialect` and `AnthropicLlm` send it as a `<turn-context …>` block that ends the turn's last user-role content, after that turn's tool results: a text block on the Messages API, and on the chat-completions wire the end of the user message the turn closes on, or a user message of its own after tool messages. The block closes on a delimiter chosen so that its content cannot contain it, in any case or width or with characters that do not show between its letters. The delimiter is keyed with a secret of the process: the same text gets the same one in every request a process sends, and another process gives it another. The system prompt is the instructions alone, so it is the same text on every turn of a conversation and a provider's prefix cache keeps it.
|
|
352
|
+
- **A compaction summary is history in a user turn on both dialects.** It is sent as a `<conversation-summary …>` block. The chat-completions dialect used to send it with the system role, and the Messages API mapping with no fence. When the user's message follows the summary, the block opens that message, so neither dialect sends two user turns in a row.
|
|
353
|
+
- **`LlmContext`** (`akanjs/service`) is what an adaptor of the app's own calls: `LlmContext.of(request.context)` is the context text, empty when there is none, and `LlmContext.summary(text)` the summary block.
|
|
354
|
+
- **A context block can be marked `untrusted: true`** (`AgentWireContext`, and `ContextBlock` in the page) when it holds text someone other than the developer or the user may have written. Both dialects fence marked blocks apart from the app's own, in a `<page-content …>` block, the one a `readScreen` result arrives in. A turn that carries one counts as an untrusted read. In the page the first change after it asks the user first, as after `readScreen`. In `agentService.loop` the run is tainted from its first round: `approve` hears `tainted: true`, and with no `approve` a write is answered with the code `writeAfterPageText` and a sentence for the model, and the loop logs once per run that `approve` is what decides such a call. The run stores `tainted: true` on each assistant message it writes while tainted, so a resume and the next ask in that conversation keep the taint when the block is not passed again.
|
|
355
|
+
- **Text from a mentioned record is treated like text a tool read.** An `@` mention's reference reaches the model with its pointer, label, value and note together in one `<page-content …>` block under the "Referenced data" heading; before, only the value was fenced. The token in the user's message is sent as `@[pointer](mention:pointer)`, so the record's title is in that block only; the chat still draws the title. When the id or the path is not a token, as a slug is not, the token is sent as `@[ref-1a2b3c4d](mention:ref-1a2b3c4d)` and the block spells the pointer under that name. A message that carries a reference counts as an untrusted read: in `Agent.Chat` the first change after it shows the approval card a change after `readScreen` shows, and an `agentService.loop` run whose messages carry `references` is tainted from its first round. A loop's compaction digest names a pointed-at record by its pointer.
|
|
356
|
+
- **The page's default context keeps ids, enum members, numbers and booleans inline, and leaves free text to a read tool.**
|
|
357
|
+
- A string rides inline only when it is one token: up to 40 letters, digits, `.`, `_` or `-`, of at most three words. A word ends at a separator or at a lower-to-upper case change, so `created-at-desc` and `createdAtDesc` pass and `archive-every-note-now` does not. More parts pass only as an id's: each hex, with a digit or eight characters long, as in a UUID. A run of over sixteen letters with no digit never passes. It used to ride inline up to 200 characters.
|
|
358
|
+
- In the `state` block any other string is listed by key and type with no value.
|
|
359
|
+
- The `route` block applies the rule to each path segment and path param, and keeps at most twelve words of each. A search param rides inline when a store declares its key with `search("key", …)` and its value is a token. Of the others at most four ride, key and value both tokens, so `?tab=settings&page=2&sort=created-at-desc` reads the same on a page whose stores declare none; the rest are left out, key and value. A page's typed `search` is read on the server and does not count as a declaration. What is left out reads `…` in the path, the block names the keys to read in `withheld` and the number of search params left out in `searchParamsWithheld`. `readState` answers `pathname`, `params` and `searchParams` whether or not a component subscribes them, as page content.
|
|
360
|
+
- In the `screen` block a `Load` scope's label, which is its record's title, and the ids and labels of a list scope's `items` follow the rule; the block then says to read the scope with `readScreen`.
|
|
361
|
+
- Not covered: an `Agent.Zone`'s `label` and a value published with `st.expose`, `st.useState` or `useAgentResource` still ride whole, as no read tool returns them. Publish an id or an enum member there, not text a user wrote.
|
|
362
|
+
- The MCP App view names its screen to the host by origin and path under the same rule, without the query string or the hash.
|
|
363
|
+
- `AgentService.preamble` and each adaptor's fallback prompt say what a `<turn-context …>` block is, and that a `<page-content …>` block may also end a user turn.
|
|
364
|
+
- The agent and MCP guidelines and the `akan-agent` skill describe all of the above.
|
|
365
|
+
|
|
366
|
+
**Upgrading.**
|
|
367
|
+
|
|
368
|
+
An `LlmAdaptor` of your own that builds its whole request with `OpenaiDialect.requestBody` or `AnthropicLlm.requestBody` needs no change. One that builds its own messages must change, also when it takes its system prompt from `OpenaiDialect.systemPrompt(request)` or `AnthropicLlm.systemPrompt(request)`: those now return the instructions without the context, so such an adaptor would send no context at all. Append the context to the last user-role content, and map a `summary` message to a user turn:
|
|
369
|
+
|
|
370
|
+
```ts
|
|
371
|
+
// before
|
|
372
|
+
const system = OpenaiDialect.systemPrompt(request); // held the context
|
|
373
|
+
const turns = request.messages.map((message) =>
|
|
374
|
+
message.summary
|
|
375
|
+
? { role: "system", content: message.text }
|
|
376
|
+
: toTurn(message)
|
|
377
|
+
);
|
|
378
|
+
// after
|
|
379
|
+
const system = OpenaiDialect.systemPrompt(request); // the instructions alone
|
|
380
|
+
const turns = request.messages.map((message) =>
|
|
381
|
+
message.summary
|
|
382
|
+
? { role: "user", content: LlmContext.summary(message.text ?? "") }
|
|
383
|
+
: toTurn(message)
|
|
384
|
+
);
|
|
385
|
+
const context = LlmContext.of(request.context); // "" when the turn carries none
|
|
386
|
+
if (context) turns.push({ role: "user", content: context }); // or append it to the last user turn
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
Marked blocks come fenced by the same call. A test that looked for a context value in `body.system`, or in the first chat-completions message, finds it in the last user-role content, and one that looked for a summary in a system message finds it in a user message.
|
|
390
|
+
|
|
391
|
+
A loop request or a page context that already used a field named `untrusted` on a block for something else must rename it: any value but `false` or `undefined` now marks the block.
|
|
392
|
+
|
|
393
|
+
A store for `agentService.loop` messages must keep `tainted` on assistant messages too. Store each message `onMessage` hands over whole, as before; a store that picks fields adds this one. A loop that passes user messages with `references` and has no `approve` no longer writes: each write is answered with the code `writeAfterPageText`. Pass `approve`, or send the message without `references`. This lasts for the rest of the conversation, not for one run, because the stored messages keep the reference; a marked context block lasts as long through the mark on what the model said. Passing `untrusted` does not lift it.
|
|
394
|
+
|
|
395
|
+
A loop that passes messages with `references` and has an `approve` hears `tainted: true` on every call from that message on, in that run and in every later ask of the conversation. An approver that allows untainted calls by itself and holds tainted ones for a person will hold them all.
|
|
396
|
+
|
|
397
|
+
In a loop the model reads a mention in the user's words as `@[ticket/t1](mention:ticket/t1)`, or as `@[ref-1a2b3c4d](mention:ref-1a2b3c4d)` when the id or path is not a token, and finds the title only in that message's "Referenced data" block. A compaction summary names a mentioned record by its pointer and no longer by its title, so after a compaction the model reads the record again to name it. A prompt or a test that expected the title in the user's text looks in the block.
|
|
398
|
+
|
|
399
|
+
An app that relied on the model seeing a search param, a path param, a short store string or a list row's title in its context now has the model read it with `readState` or `readScreen`. The model is told which to call, so most apps change nothing. To keep a search param in the context whatever else the link carries, declare it in a store (`search("status", String, { default: "" })`); an undeclared one rides only as one of the first four whose key and value are tokens.
|
|
400
|
+
|
|
401
|
+
An id that is not a token is left out like other free text: a slug of more than three words (`my-first-blog-post`) or a mixed-case random id such as a nanoid (`V1StGXR8_Z5jdHi6B-myT`). A list scope's `items` then lists the other rows only, a list whose ids are all such lists none, and the block's `note` says to call `readScreen` with the scope's path, where every row is. A live store key holding such an id is listed with no value. A 24-character hex id, a UUID, a ULID and a number ride as before.
|
|
402
|
+
|
|
403
|
+
The URL an MCP App view reports to its host as model context no longer has the query string or the hash, and a path segment of free text reads `…`. A host prompt or a test that read a search param from that URL gets it from a tool the view publishes.
|
|
404
|
+
|
|
405
|
+
Two cases need an edit. Instructions that point at the context point at the tool instead:
|
|
406
|
+
|
|
407
|
+
```tsx
|
|
408
|
+
// before
|
|
409
|
+
<Agent.Chat instructions="The search box's text is searchParams.q in the route context." />
|
|
410
|
+
// after
|
|
411
|
+
<Agent.Chat instructions="The search box's text is the q search param: call readState with key searchParams." />
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
And a chat or zone that withholds a read tool gives it back when its agent needs such a value:
|
|
415
|
+
|
|
416
|
+
```tsx
|
|
417
|
+
// before
|
|
418
|
+
<Agent.Zone builtins={["highlight"]}>
|
|
419
|
+
// after
|
|
420
|
+
<Agent.Zone builtins={["highlight", "readState", "readScreen"]}>
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
What `readState` and `readScreen` return is page content, so the first change after one asks the user first.
|
|
424
|
+
|
|
425
|
+
A chat where the user mentions a record now asks before the first change that follows. `AgentConfirm.set({ afterScreenRead: false })` turns that off together with the ask after `readScreen`.
|
|
426
|
+
|
|
427
|
+
- e5d3cac: An `Agent.Zone`'s label and a value published with `st.expose`, `st.useState` or `useAgentResource` reach the model the way route params and store keys do: ids, enum members, numbers and booleans in the turn's context, free text through a read tool.
|
|
428
|
+
|
|
429
|
+
- **A published value rides in the `screen` block only when it is the app's own kind of data.** A string rides when it is one token (the rule route params follow) or an ISO timestamp, beside numbers, booleans and `null`. A list rides when every item does and it spells at most twelve words; a list with free text in it is left out whole. An object keeps its fields of that kind, at most twelve of them and twelve words of values, under names that are tokens. A resource with anything left out is marked `withheld: true`, and one whose read threw is listed with no error text.
|
|
430
|
+
- **`readState(name)` answers a published value.** The name is the one the `screen` block lists, a zone's prefix included. The answer is the whole value, as page content, so the first change after it asks the user first. A store key the screen reads is answered before a published value of the same name.
|
|
431
|
+
- **A zone's `label` rides only when it is one token.** `readScreen` with `section` set to the zone's path, or with no `section` inside the zone's own chat, starts with a `Zone label:` line when the label was left out.
|
|
432
|
+
- `StoreSurfaceSource` takes the surface it is attached to as its second argument, `AgenticSurface.shared` by default.
|
|
433
|
+
- The agent guideline and the `akan-agent` skill describe the rule.
|
|
434
|
+
|
|
435
|
+
**Upgrading.** A model that read a sentence from `st.expose`, `st.useState`, `useAgentResource` or a zone's `label` in the turn's context now finds the resource marked `withheld` and reads it with `readState`, which makes the next change ask for approval. Where an agent should act on a value without that ask, publish an id, a count or an enum member. A host that builds its own `StoreSurfaceSource` on a surface other than `AgenticSurface.shared` passes that surface to it.
|
|
436
|
+
|
|
437
|
+
- a291bbb: The path rules an agent loads with every service, signal, page and `.tsx` file are shorter: the `server`, `style` and `ssr` rules keep only what fails the build or silently changes behaviour and point at the skill that explains the rest (server 7.9 KB to 2.4 KB, style 5.8 KB to 2.5 KB, ssr 3.6 KB to 1.9 KB), and the `akan-page` skill no longer repeats what the `page` rule already says. Nothing was dropped: an endpoint's `errors` option and where an adapter's error keys live are now in the `akan-err` skill, the request-schema check in `transportRule`, and the `cn`, multi-slot and enum-to-class conventions in `cssRule`. `cssRule` and `recipeRule` now say the framework recipe list is in the `style` rule, and the API reference says what `akanjs/dictionary`, `document`, `service`, `store`, `client/native`, `native/desktop` and `test` hold. Run `akan agent install` in a workspace to pick up the new files.
|
|
438
|
+
- f678e80: The skills no longer repeat the path rule an agent has already loaded for the same files: `akan-query` points at the `module` rule for its musts (500 rows, soft removal, hookless writes, secret projections, cascade direction), `akan-transport` at the `auth` rule for guards and drops what the `server` rule says about body types, the 30-second default deadline and remote errors, `akan-service`, `akan-err` and `akan-mcp` at the `server` rule, and `akan-ui`, `cssRule` and `componentRule` at the `style` rule for class order and the colour vocabulary. The `server` rule drops its in-page agent line, which the `akan-agent` skill already holds and which no service, signal or document file needs. Run `akan agent install` in a workspace to pick up the new files.
|
|
439
|
+
- ce430ed: A coding agent reads less before its first page: the generated AGENTS.md is about 9% smaller, leaving to the path rules what they already say while still naming every check that breaks the build, and it now says that `i18n: { localePrefix: "as-needed" }` in `akan.config.ts` serves URLs without `/<locale>/`. The `akan-page` skill now holds the guard basics, the first-render `searchParams` snapshot and Link prefetch, so `pageRule` keeps only the deeper contract (12 KB to 7 KB), and the `@akanjs/cli` README tells an agent to read the workspace's `AGENTS.md`, rules and skills rather than the package's `guidelines/` folder. Run `akan agent install` in a workspace to pick up the new files.
|
|
7
440
|
- c44d068: A coding agent reads less to build its first app: the `akanjs` README keeps the path to a first app and links the rest on akanjs.com (17 KB to 7 KB), the `akan-page` and `akan-service` skills ship the API reference one section at a time with every entry named in the skill's index (`Link` now lists the anchor attributes it takes and `Link.Back`, `Link.Close` and `Link.Lang`), the `akan-page` skill holds what a first page looks up while `pageRule` keeps the deeper contract, and each rule is stated once across AGENTS.md, the path rules and the skills. Run `akan agent install` in a workspace to pick up the new files.
|
|
441
|
+
- ad5e1ac: chore(lint): Biome 2.5.15, and `noUnnecessaryConditions` is `warn` again in the base config
|
|
442
|
+
|
|
443
|
+
Biome 2.5.14 read `RegExp.prototype.exec` as never returning null, so `/…/.exec(url)?.[1]` got "Unnecessary optional chaining" and `match ? … : …` got "This condition is always truthy" (biomejs/biome#11278, fixed in 2.5.15). A new workspace now pins `@biomejs/biome` 2.5.15 and its `biome.json` names the 2.5.15 schema, and the base config keeps the rule at `warn` as in 3.2.0. An existing workspace gets the fix by setting `@biomejs/biome` to 2.5.15 in its root `package.json` and the `$schema` in `biome.json` to `https://biomejs.dev/schemas/2.5.15/schema.json`.
|
|
444
|
+
|
|
445
|
+
2.5.15 also knows the global `Array` type, so `useArraySortCompare` (on at `warn` through the base config's `types` domain) now reports a `.sort()` or `.toSorted()` with no compare function on any array, `Object.keys(…).sort()` included. `(a, b) => (a < b ? -1 : a > b ? 1 : 0)` keeps the order the default sort gives a string array.
|
|
446
|
+
|
|
447
|
+
`akan lint-all` now runs Biome once over every app, lib and package, then each target's own gates, instead of one Biome run per target at once. Each run scans the whole workspace for the type-aware rules, about 1.6 GB apiece on Biome 2.5.15 (1.0 GB on 2.5.14), so this repository's 13 parallel runs no longer fit a 16 GB Linux runner: the kernel killed some of them, and the npm wrapper reported the killed run as exit 0 with no output. One run here peaks under 3 GB and finishes in about 17 s. `BiomeCheck.run` takes `targets: string[]` in place of `target`.
|
|
448
|
+
|
|
449
|
+
- 83d791b: fix(devkit): `akan build` prints one plain line per phase where its output is not a terminal
|
|
450
|
+
|
|
451
|
+
Run by an agent, a CI job or behind a pipe, `akan build` printed each phase twice (a start line, then an end line
|
|
452
|
+
with a coloured tick) and, between them, a coloured logger line carrying a process id and a timestamp:
|
|
453
|
+
`[client-runtime] 34 routes load per module, …`.
|
|
454
|
+
|
|
455
|
+
- Where stderr is not a terminal, a phase is one uncoloured line on stdout when it ends,
|
|
456
|
+
`✓ Compiling backend: 4 entrypoints, 37 outputs (148ms)`, and `✗ <phase> failed` on stderr when it fails. A
|
|
457
|
+
terminal keeps the spinner.
|
|
458
|
+
- The client-runtime count is part of the SSR phase's line everywhere:
|
|
459
|
+
`Building SSR route artifacts: 34 routes, 42 entries; 34 routes load per module, …`. `akan quality runtime` still
|
|
460
|
+
prints it with its reasons.
|
|
461
|
+
|
|
462
|
+
- 22791e7: A production page loads fewer, larger client files: the client entries exactly the same routes load are built as one.
|
|
463
|
+
|
|
464
|
+
`akan build` gave every `"use client"` file, and every export of one it takes apart, an entry of its own. The bundler puts a module in a chunk of its own for every different set of entries that reach it, so an app with several hundred entries ended with hundreds of small files per page, many under 1 KB, where a file is served uncompressed. Entries that the same set of routes loads are now one entry, so what only they reach is one chunk. Entries any other set of routes loads stay apart, and a route still downloads nothing it did not download before.
|
|
465
|
+
|
|
466
|
+
On a real workspace's largest app (236 routes, brotli as served) every route got smaller, by 3.8 to 60.6 KB: the JS all routes load fell 3.4% in total, the median route went from 764.7 to 748.1 KB, and the routes of its signed-in area from a median of 836.0 to 801.8 KB. A signed-in route loads a median of 354 files against 454. The build writes 1,414 client files against 1,827, 5.7% fewer bytes on disk, and 518 files under 1 KB against 688. This repository's sample apps write 214 files against 232 and 132 against 156.
|
|
467
|
+
|
|
468
|
+
What changes for an app: the files of one group run together, the first time a page uses any of them. A file that does work when it loads — registers something, reads the window — now does it when a file grouped with it is first used, on the same routes as before, and a file that throws while loading takes its group with it. A group's file name changes when any file in it changes, so a returning visitor downloads a group again where one small file changed.
|
|
469
|
+
|
|
470
|
+
`akan start` (development) and the server bundle are unchanged. No upgrade step.
|
|
471
|
+
|
|
472
|
+
- 56d67dd: A production page loads the exports of a client file it uses, not everything else the file holds.
|
|
473
|
+
|
|
474
|
+
A workspace file with several exports — a `*.Util.tsx`, a `*.Zone.tsx`, a `ui/` or `webkit/` file — was one module to the bundler, so a page rendering `Memo.Util.Remove` also downloaded what `Memo.Util.Edit` imports. `akan build` now hands the browser bundle each such file as one module per export: a top-level declaration that only builds a value (a component, a function, a constant, a class) becomes its own module with the imports it alone reads, and an importer naming `{ Remove }` follows that module only. A `"use client"` file is likewise built as one entry per export, and a route preloads and counts as Route JS the entries of the exports its server files ask for.
|
|
475
|
+
|
|
476
|
+
How a file is written does not change: several exports in one file, imported by name or as `Memo.Util.Remove`. What the file does when it loads — a bare import, a call at the top level, anything that is not a plain declaration — stays together in one module that each of its exports loads first.
|
|
477
|
+
|
|
478
|
+
A file stays one module when it has a top-level `let` or `var`, `export *`, a namespace or a macro import, and so do generated barrels, `lib/__client` pieces, `index.ts` files and `*.constant|dictionary|document|service|signal|store.ts`. A namespace import (`import * as Util`) used as a value still loads every export.
|
|
479
|
+
|
|
480
|
+
On a real workspace's largest app (236 routes, brotli as served) the JS all routes load fell 9.3% in total, the lightest route went from 363.8 to 290.2 KB and the median from 795.3 to 764.7 KB. The build writes more, smaller files: 1,827 client files against 1,141, and 8.8% more bytes on disk. An app with little to take apart grows by a fraction of a KB per route. `akan start` (development) and the server bundle are unchanged. No upgrade step.
|
|
481
|
+
|
|
482
|
+
- 55d1518: A production build of a workspace with several libs loads its client modules in order, and a page that needs every module weighs what it weighed before.
|
|
483
|
+
|
|
484
|
+
- Each generated piece exports a name, and a module that needs the piece imports that name and hands it to `loadedAfter` from `akanjs/base`. A piece imported only for its effect could end up in a chunk the importer's chunk did not load first; a store or an endpoint was then read before it existed.
|
|
485
|
+
- A store file, and every file a store file imports, loads no store piece. The stores its code names are loaded by each file outside that imports it or names its store, so no store file is defined through a piece that imports it back. Where the importing file is one the build leaves as written (it holds a macro import, or lies outside `apps/` and `libs/`), the page keeps the whole runtime.
|
|
486
|
+
- A store spreading a value into the object it gives its own `this.set` (`this.set({ ...patch })`) no longer counts as picking a name at run time. A value or a function handed over whole (`this.set(patch)`, `this.set(update)`) still does, since an updater may read any module's state. `fetch.ws`, `fetch.http`, `fetch.origin`, `fetch.jwt`, `fetch.logger`, `fetch.setJwt`, `fetch.setTimeout`, `fetch.connect`, `fetch.connectOnUse`, `fetch.disconnect` and `fetch.configureWs` are the fetch client's own members, not endpoint names.
|
|
487
|
+
- A client entry that reaches a file needing every module keeps the whole runtime, as does an entry held only by pages with such an entry, and one naming a module that more such pages hold than other pages. Their files are left as written, so the page loads the code it loaded before.
|
|
488
|
+
- `akan build` checks its output before it serves it: every chunk holding a module that needs a piece reaches the chunk holding that piece, no store file sits in an import cycle with a piece, and no entry built to load pieces reaches a file needing every module. On a failure the build warns once with the two source files named, builds every page on the whole runtime instead and succeeds; the warning is a bug in akan to report. The development server serves each module on its own and checks nothing, so the production build is the guard.
|
|
489
|
+
- `akan quality runtime` adds a note, `akan.runtime.framework-marker`, per file that brings a framework component reading models by name (`Field`'s relation fields, `Load`, `Model`, `Data`, `Signal`, `Constant.Doc`) onto a page: the imports from that file to the component, and the pages that load the whole runtime through it.
|
|
490
|
+
|
|
491
|
+
Nothing to do. A file outside every app and lib that imports a `lib/__client/` piece by hand should import the piece's exported name and pass it to `loadedAfter`; the build's check names it otherwise.
|
|
492
|
+
|
|
493
|
+
- c183ac9: A page loads per module only where that makes it smaller, and a page that keeps the whole runtime no longer carries a module's API descriptions twice.
|
|
494
|
+
|
|
495
|
+
- `akan build` sizes every route twice: as the analysis planned it, and with every client entry keeping the whole runtime. A route no smaller per module is built again keeping the whole runtime, and stays that way only if it then came out smaller than it was; otherwise it loads per module as planned. The build says what it did in one line: `N routes load per module, M keep the whole runtime because per module would not be smaller`. `akan quality runtime` names the first routes of each kind (`--format json` names all), and the build lists them at the `verbose` log level.
|
|
496
|
+
- A page keeping the whole runtime beside pages that load per module took a module's API descriptions from `lib/useClient.ts` and again from that module's `lib/__client/*.fetch.ts` piece. Now `lib/useClient.ts` leaves out what those pieces hold and loads the pieces first, so each description ships once.
|
|
497
|
+
- A client entry that no per-module page loads keeps the whole runtime wherever some page does, so the files it shares with that page bring no pieces to it.
|
|
498
|
+
- The build warns when a route still loads a scope's whole file together with a piece repeating part of it.
|
|
499
|
+
- `akan quality runtime` prints what the last build of each app decided: the routes loading per module, and for every entry keeping the whole runtime the file and line to change, or the rule that keeps it.
|
|
500
|
+
- An app with routes to measure bundles its browser code at least twice instead of once: as planned, with everything whole, and then once per round of routes it tries keeping whole, six rounds at most (two to four bundles in the apps measured so far). An app whose every route keeps the whole runtime for a reason in a file bundles once, as before.
|
|
501
|
+
|
|
502
|
+
- 1e826a7: A build reads each scope's signal once, not once per generated `lib/__client/*.fetch.ts` piece, so an app with many modules builds about as fast as it did when every page loaded every module. The development server reads them once per compile round that holds a piece, and again for a file it has to build on its own.
|
|
503
|
+
|
|
504
|
+
- Each piece gets its module's descriptors written in where it called `getSerializedSignalOf`. A new read runs in a process of its own each time, so an edit to a signal between two builds is never served stale. That process sees the build's own environment and `define`, and no `.env` file the build did not load.
|
|
505
|
+
- A piece the read cannot answer exactly keeps running its macro as before. So do the pieces of a scope whose signal fails to load, or does not load within 60 seconds. The build names that scope, and the pieces of every other scope are still answered.
|
|
506
|
+
- The process reading the signals ends with the build that started it.
|
|
507
|
+
- The pages a build writes carry the same code as before; only the names the minifier picks for a few local variables can differ.
|
|
508
|
+
|
|
509
|
+
- b5b4834: The development server now loads what a production page loads, so a page that works in development works the same once built.
|
|
510
|
+
|
|
511
|
+
- A server-rendered page in development takes the descriptors and stores of only the modules its client code names, from the same `lib/__client/` pieces a route build uses, and imports from `akanjs/ui` narrow as they do in a build. The tab keeps one store, and each piece loads once.
|
|
512
|
+
- Saving a store, signal or constant file rereads which module declares each name and recompiles the files whose names moved to another module. A store save that adds an action replaces that store's actions and keeps its state, without reloading the page.
|
|
513
|
+
- Saving a lib's store file or store piece runs the app's piece of that module and the app's assembled store again after it, and the app's store of that model too when it extends the lib's, so a lib store the app extends keeps the app's actions.
|
|
514
|
+
- A component saved to name another module loads that module's piece without reloading the page; a file saved to pick a name at run time loads the whole runtime.
|
|
515
|
+
- An app whose `lib/__client/` files, or a mounted lib's, are missing, or whose modules cannot be read, loads the whole runtime in development as a build does. The development server says which once, names the sync to run, and loads per module again on the next save after that sync, with no restart.
|
|
516
|
+
- Reading a store key the page has not loaded fails with the name of the module whose store declares it, and says to name the key in the file that reads it or import `st` from the app's `client` barrel there. The list of each store's keys behind that message exists only in development: a production bundle carries neither the list nor the message.
|
|
517
|
+
|
|
518
|
+
- 170fa28: A page downloads the framework's `akanjs/client` code once. A production build used to bundle the `akanjs/client` files that the framework's UI imports by path into the page's own chunks, beside the copy the page's server-rendering client already loaded, so a page ran two copies of them, each with its own state (`Device.instance` among it). Both now come from one browser entry for `akanjs/client`, which, like the other framework entries, holds only the names the app uses. This applies to a page loading per module and to one keeping the whole runtime alike; what a page shows and how it behaves do not change.
|
|
519
|
+
|
|
520
|
+
- **Size.** In the framework's own sample apps each route loads 9 to 17 KB (brotli) less when it loads per module and 9 to 50 KB less when it loads every module. A page loading per module can make one more request, for the `akanjs/client` entry; a page loading every module makes the same number or fewer.
|
|
521
|
+
- **Which files.** A file comes from the entry when the `akanjs/client` barrel re-exports all of it under its own names, whether the importer names `akanjs/client`, a path into it, a relative path, or a path through a linked `akanjs` install. A file the barrel leaves out or renames, such as `akanjs/client/native`, any dynamic `import()`, and a file of another framework entry imported by its path stay in the page's chunks. The native bridge behind `akanjs/client/native` is therefore still written into both builds, because the entry's `Device` and `storage` import it lazily, but only the CSR shell loads it.
|
|
522
|
+
- **Development.** `akan start` serves those files from its whole `akanjs/client` entry as well, so a development page runs one copy of the client's state; a few stateless helpers the framework's UI imports by path (`cn` among them) still load beside it from the development module registry.
|
|
523
|
+
- **Unchanged.** The single-file CSR build that native apps load and MCP App views carry one copy, as before.
|
|
524
|
+
|
|
525
|
+
Nothing to do. A workspace on an older `akanjs` without the `akanjs/client` entry builds as it did.
|
|
526
|
+
|
|
527
|
+
- 19c6fa7: `akan code` on the `local` profile can be told to stop asking about a command for the rest of the session, and one option turns asking off for a run.
|
|
528
|
+
|
|
529
|
+
- **A third answer.** The prompt before a shell command is now `approve? run: <command> [y/n/a]`. `a` runs the command and stops asking about it until the session ends. What is remembered is the program, and the sub-command too for `git`, `bun`, `bunx`, `npm`, `npx`, `pnpm`, `yarn`, `akan`, `docker`, `kubectl`, `helm`, `cargo` and `go`: allowing `git status` leaves `git diff` asked about, and allowing `bun test` leaves `bun x` asked about. `gh` is remembered two words deep, so allowing `gh pr view` leaves `gh pr merge` asked about. A line of several commands (`&&`, `;`, `|`, `$(…)`, a subshell) runs unasked only once every command in it is allowed. `/allowed` lists what the session has allowed and `/allowed clear` forgets it. Nothing is written to disk, so a resumed, forked or reloaded session asks again.
|
|
530
|
+
- **Still asked every time**, with a prompt that offers only `[y/n]`: a networking command (`curl`, `wget`, `nc`, `ssh`, `scp`, `rsync`, …) and a redirection to or from `/dev/tcp/…` or `/dev/udp/…`; a command that sends something out of the machine (`git push`, `npm publish`, `pnpm publish`, `yarn publish`, `yarn npm`, `bun publish`, `cargo publish`, `gh api`, and a `docker` line with `push` or `--push` in it); `rm`; a command that runs another or sets what a later one runs (`sudo`, `env`, `timeout`, `xargs`, `sh`, `bash`, `eval`, `builtin`, `source`, `.`, `trap`, `alias`, `export`, `declare`, `find -exec`, …); a variable set in front of a command other than `CI`, `NODE_ENV`, `FORCE_COLOR`, `NO_COLOR`, `TZ`, `LANG`, `LC_ALL`, `TERM`, `DEBUG` or `PORT` given one plain word; a line that writes a file with `>` or `>>`; and a line that cannot be split into its commands with confidence (a loop or `if`, backticks, a here-document, a program named by a variable).
|
|
531
|
+
- **`--no-ask`.** `akan code --no-ask` runs the session without asking before a shell command or a network request: the same as `--no-ask-commands --no-ask-network`. It prints one line at start saying so. It changes nothing else: secret files stay refused, this repo's MCP servers and extensions still wait for their own approval (`--trust-workspace`), the agent's own questions are still asked, and the `pod`, `review` and `web` profiles behave as before.
|
|
532
|
+
|
|
533
|
+
A program that drives `akan code --rpc` sees `remember: string[]` on an `approval` request when the session answer is offered, sends `{ "type": "approve", "approvalId": …, "approved": true, "remember": "session" }` to give it, and reads the names on `approval_resolved.remembered`. A host that sends only `approved` keeps working as before.
|
|
534
|
+
|
|
535
|
+
**Upgrading.** No step is needed: the three wire fields in `akanjs/common` (`CodeAgentApprovalRequest.remember`, the `approve` command's `remember`, `approval_resolved.remembered`) and `CodeTranscriptPart`'s `remembered` are optional additions.
|
|
536
|
+
|
|
537
|
+
- d7e5c18: A built app serves its client files under 1 KB compressed too. `akan build` wrote a `.br` and `.gz` beside a file only from 1 KB up, and a page loads hundreds of smaller ones: re-export stubs, single icons, a model's runtime pieces. Each now gets its compressed copies whenever they come out smaller than the file. A page of the sample apps downloads 6 to 8 KB less JavaScript, and a page of a large app that loads about 500 files, 230 of them under 1 KB, about 44 KB less. The Route JS report and budget count what is served, so their numbers fall by the same amount.
|
|
538
|
+
- 9c538dc: `akan workflow plan` and `apply` for `create-ui` now write a Zone or a Util, for a database module and for a service module.
|
|
539
|
+
|
|
540
|
+
`--surface zone` and `--surface util` were advertised but apply refused them. They now write `<Model>.Zone.tsx` and `<Model>.Util.tsx` from the module templates. In a service module (`lib/_camera`, named `camera` or `_camera`) they write a small `Main` Zone or `Action` Util; `view`, `unit` and `template` stay refused there, since a service stores no model. `create-ui` also refuses, at plan and at apply, to overwrite a component file that already exists, which `view`, `unit` and `template` used to do silently.
|
|
541
|
+
|
|
542
|
+
A service module's `<Service>.Zone.tsx` and `<Service>.Util.tsx` now count as client files by role for `akan.ssr.unnecessary-use-client`, as a database module's do, so the new scaffold is not warned about before it reads the store.
|
|
543
|
+
|
|
8
544
|
- 1d8c8c2: An app with `basePaths` keeps every base path's CSS class scan in the candidate cache, so a start or build no longer rescans the sources of all but one of them. An entry is dropped only once its source file is deleted.
|
|
545
|
+
- 2f7c2b4: The build reads three more ways of writing a dictionary key, so a route holding one loads the groups it shows instead of the whole page dictionary. A key held in a `const` that may also be `null`, `undefined` or `false` (`const noteKey = denied ? "weather.locationDenied" : null`) is read as the keys written in it. A key read from a table the file made with `.map()` from another table (`stages.map((stage) => ({ ...stage, label: l(stage.key) }))`, then `l(item.key)`) is read as the keys the first table writes. A key picked from a `static` table of a constant class (`l(cnst.RunnerBot.labelKeyOf[botRole])`) is read as the keys that table writes, when the static has no type annotation and is an `as const` object or array of nothing but written strings; any other static, and a `.map()` callback that returns something the file does not write, keep the route on the whole dictionary as before.
|
|
546
|
+
- 2f7c2b4: A variable or parameter that only shares the translator's name no longer sends a route to the whole page dictionary. `values.map((l) => l.trim())`, `rows.sort((l, r) => l.order - r.order)`, `const l = line.length` and a `for (const l of lines)` loop are read as the plain values they are, so a file holding one keeps its routes on the dictionary groups they show. A name that may be the translator still counts as it: one destructured from an object, imported or not declared in the file, and any parameter or variable that is called, read through `l._`, `l.rich` or `l.trans`, or given another value.
|
|
547
|
+
- c866b21: No route downloads more dictionary than the whole file any more. A route that shows nearly every text could be handed up to four files that together came out larger than the whole dictionary, because several files compress worse than one. Such a route now loads the whole file, and it no longer decides how the other routes' files are cut, so light pages stop paying for it: in a large app with 20 such routes the lightest page's dictionary went from 115 KB back to 96 KB.
|
|
548
|
+
- 53bf2de: A problem in an env file is reported without the file's text, so a build or lint log holds no secret.
|
|
549
|
+
|
|
550
|
+
- **Type errors.** `akan build`, `akan typecheck` and `akan verify` report a TypeScript error in `env/env.server.*.ts` or `env/env.client.*.ts` by file, line, column and code alone. The source line and TypeScript's message are left out, because either can quote a value.
|
|
551
|
+
- **Lint.** `akan lint` and `akan verify` report a diagnostic in those files by file, line, column and rule, with no code frame, formatter diff or rule message. The files are still linted and formatted, and their errors still fail the run. Every other file prints as before.
|
|
552
|
+
- **`akan lint` output.** The `Found N errors.` lines are printed once at the end and the "Checked N files in …" line is gone. When Biome cannot read `biome.json`, the error is Biome's own explanation.
|
|
553
|
+
|
|
554
|
+
**Upgrading.** A failed `akan lint` now exits with 3, the code of a failed check, where it exited with 1. A script that tests for a non-zero exit needs no change; one that tests for exactly 1 does. To see what is wrong on a line of an env file, open the file at the position the diagnostic names.
|
|
555
|
+
|
|
556
|
+
- 537d28e: The first `akan sync` of a new checkout writes the client runtime files a second one used to, so the first production build of a clean tree loads its routes per module.
|
|
557
|
+
|
|
558
|
+
- **The files under `lib/__client` are written after every scope's `lib/cnst.ts`.** They were written beside it, and on a tree with no generated files a module whose signal names another lib's constants as `cnst.<lib>.X` got a fetch file that imports the scope's whole constant barrel. A build of that tree measured the per-module runtime as larger and kept the whole client runtime on every route. On a real workspace of nine libs, 21 fetch files were written that way by the first sync and none by the second; the first build of a clean tree said `0 routes load per module, 235 keep the whole runtime`, and now says `235 routes load per module`, as its second build did.
|
|
559
|
+
- **A lib reached only through another lib is a dependency from the first sync.** When an app or lib imports `@libs/b` and `b` imports `@libs/c`, its generated barrels name `c` at once. Before, the first sync left `c` out and a second sync added it, having found the import in the files the first one generated. `akan.app.json` lists such libs too, so their pages and assets are synced the first time.
|
|
560
|
+
|
|
561
|
+
A CI job that builds a clean checkout shipped the larger build. Running `akan sync <app>` before `akan build` was the way around it and is no longer needed.
|
|
562
|
+
|
|
563
|
+
Not changed: the order generated files list an app's libs in still depends on the order their scans finish in, so the first and the second sync of a new tree can list the same libs in a different order.
|
|
564
|
+
|
|
9
565
|
- 90d740f: `native.ios.hideFormAccessoryBar: true` (or a target's `ios.hideFormAccessoryBar`) leaves out the bar WebKit shows above the keyboard while a page field is focused. The iOS shell already had the switch, but `akan.config.ts` refused the key and the native config never carried it, so every iOS app showed the bar.
|
|
10
566
|
|
|
11
567
|
The key defaults to false, so existing apps are unchanged. The api report lists one new optional `AkanNativeIosConfig` property; no upgrade step is needed.
|
|
12
568
|
|
|
13
569
|
- 4732186: `akan --version` loads no command module, and `akan tunnel`, `akan subspace` and the package commands such as `akan version` no longer load the TypeScript compiler unless a step compiles.
|
|
570
|
+
- 1879e92: A whole-app lint runs about four times faster: `biome check apps/akan` in this repository went from 8.0 s to 2.0 s (median of five runs each on an Apple M4 Pro, 14 cores), where the same check with no lint plugins takes 0.95 s; `akan lint akan` went from 17.2 s to 5.0 s and `akan lint minimal` from 2.3 s to 1.7 s on the same machine. The ten costliest grit rules shipped in `@akanjs/devkit/lint` (the four colour rules, `no-conditional-st-hook`, `no-web-storage`, `no-web-only-api-outside-webkit`, `no-document-cookie`, `no-oversized-list-limit` and `no-unpublished-form-setter`) now check for a substring every match contains before their regex or code snippet runs, because Biome's GritQL engine pays for a regex or a snippet on every node it tries. Every rule reports the same diagnostics as before, and `biome.base.json` is unchanged, so a workspace picks this up by updating `@akanjs/devkit`.
|
|
571
|
+
- c7c27d9: A page that names a part through a workspace's own wrapper of an object loads that part's file, not everything the wrapper gathers: with a workspace's own `Field` wrapper, `<Field.Text />` no longer brings the wrapper's rich-text editor, map field and upload field onto the page.
|
|
572
|
+
|
|
573
|
+
- An object built over an imported one, `export const Field = Object.assign(Section, AkanField, { Rich, File })`, passes the copied object's parts on by file. `Field.Text` is imported from the file `akanjs/ui`'s `Field` takes `Text` from, and `Field.File` from the file the wrapper imports it from. The copied object may come through a barrel listed in `barrelImports` (`akanjs/ui`, a lib's `ui`), and may itself copy another object in.
|
|
574
|
+
- An object's file may now call React's `memo`, `forwardRef`, `lazy` and `createContext` while it loads (`const Rich = memo(…)`, `React.memo(…)`); any other call still keeps the whole object.
|
|
575
|
+
- What still keeps the whole object: a part declared in the wrapper's own file (`Field.Rich` above), a part the wrapper lists before the object it copies in (`Object.assign(Section, { File }, AkanField)`, where the copied object may replace `File`), a copied object whose own file does not qualify, and a namespace import copied in (`import * as parts`). `akan quality runtime` counts these as before, the first two as `unresolved-member` and a copied object's file by its own reason (`call`, `effect-statement`, …).
|
|
576
|
+
- A member reached from a server file past a `"use client"` wrapper or a `"use client"` copied object is narrowed only when the member's own file is `"use client"`, as with an object imported directly.
|
|
577
|
+
|
|
578
|
+
Measured on a real workspace's largest app (236 routes, JavaScript as served with brotli), whose own `Field` wrapper every route reaches: the lightest route went from 465.8 KB to 363.8 KB, the median of the 126 routes outside its signed-in area from 604.5 KB to 503.7 KB, and all routes together from 174,557 KB to 162,476 KB (−6.9%). The 110 signed-in routes, which use most of the wrapper's parts, moved little: median 894.1 KB to 882.5 KB.
|
|
579
|
+
|
|
580
|
+
No upgrade step.
|
|
581
|
+
|
|
582
|
+
- 6ea7242: `akan build`, `akan verify` and `akan start` stop with an error naming the import chain when the server pages bundle would import `react-dom/server` as it loads, instead of building a bundle whose RSC worker throws "react-dom/server is not supported in React Server Components" at boot. A module in the page graph that dynamically imports the app's `server.ts` is the usual cause: it brings the whole server, SSR renderer included, into the pages bundle.
|
|
14
583
|
- 0d5e75e: A stylesheet whose imports use no Tailwind (no `@import "tailwindcss"`, Tailwind at-rule or `theme()` function anywhere in its import graph) is no longer run through the Tailwind compiler: its imports are inlined and it ships without the `/*! tailwindcss … */` banner. A stylesheet that uses Tailwind compiles exactly as before.
|
|
584
|
+
- 36408f1: The route JS budget report no longer counts, and the route build no longer emits, chunks for `"use client"` files that export only hooks, such as the `akanjs/store` field tools, which no page loads. Reported route sizes drop by about 21 KB brotli on every route of `apps/akan` and `apps/minimal`.
|
|
585
|
+
- 08bcac6: A production build now writes `route-files.json` into the app's `.akan/cache` directory. It lists every client file with its raw and served size, and the files each route loads, so a heavy route can be traced to its files without patching the CLI. The sizes are the ones the route JS budget counts.
|
|
586
|
+
- ed9e787: A route no longer loads a model's client reference because one of the app's stores names that model.
|
|
587
|
+
|
|
588
|
+
`akan build` reads each route's server modules for the models they hand to client components (`fetch.init<Model>`, `view<Model>`, `edit<Model>`, a slice) and preloads those models' reference files on the route. The generated root layout imports every store of the app so the server holds them, which made each store, and every file a store or a signal imports, a server module of every route. A store calling `fetch.view<Model>` in an action, or reading a slice, therefore put that model's reference on every page of the app, and one picking a `fetch` name at run time put every model's there.
|
|
589
|
+
|
|
590
|
+
- The read now follows only what a route's own layouts and page import. The root layout's store imports are left out of it.
|
|
591
|
+
- A `*.store.ts` file reached any other way hands nothing over: its actions run in the browser, where the code calling them already loads the model's store and descriptors.
|
|
592
|
+
|
|
593
|
+
A route still loads the reference of every model its page, layouts and the server components they render hand over. No upgrade step.
|
|
594
|
+
|
|
595
|
+
- fb4f076: A route no longer preloads the client files of exports it does not render.
|
|
596
|
+
|
|
597
|
+
`akan build` lists, per route, the `"use client"` files to preload and to count as Route JS. It walked every import of each server file the route reaches, so a server component file with several exports — a `*.View.tsx`, a `*.Unit.tsx`, a `ui/` file — put the client files of all its exports on every route rendering one of them, and a framework file such as `akanjs/ui`'s `Model` put every wrapper it can load on each route using one.
|
|
598
|
+
|
|
599
|
+
The list now starts at the route's page and layouts and follows, for each export asked of a server file, only the imports that export's declaration reads, through the file's other declarations. A file's bare imports and top-level statements still count for every route reaching the file, a namespace handed on as a value (`components={Model}`) and `export *` count whole, and a CommonJS file is read as before.
|
|
600
|
+
|
|
601
|
+
Only the preload and Route JS list narrows. Every client file is still built and in the manifest, so one this read misses loads when the page asks for it; the route runtime plan and the dictionary per route keep the wider list. `akan start` (development) is unchanged. No upgrade step.
|
|
602
|
+
|
|
603
|
+
- eb1262f: Two readings that kept a whole app's routes on every model's runtime are gone, so those routes load per module again.
|
|
604
|
+
|
|
605
|
+
- A server file that takes `fetch` from the server barrel (`../useServer`, `@apps/<app>/server`) and only calls endpoints no longer counts every model on every route because some other line says `slice`, such as `ips.slice(0, 1)` on an array. The build now reads what the file does with `fetch` itself: `fetch.init<Model>`, `view<Model>`, `edit<Model>`, their `get` forms and `fetch.slice` still count every model, and so does a `fetch` that is indexed, passed on or taken apart. In a real workspace one such service held all 38 routes of an app.
|
|
606
|
+
- A name `akanjs/ui` re-exports from the package it carries (`SessionContext`, `useAgent`, `AgentProvider`, `httpRunner` and the rest of the agent client) is imported from the file that declares it in an installed `akanjs` too. Installed, those names sit in a folder beside `ui/`, which the import narrowing did not follow, so one import of them pulled the whole `akanjs/ui` barrel and, with it, every model's runtime into the route. A workspace that links the framework source was not affected.
|
|
607
|
+
|
|
608
|
+
- 02cc5db: `akan quality runtime` reports, for each app and library, how many client files read the generated client runtime (`st`, `fetch`, `sig`, a cast to `RootStore`) only by names one module answers, and prints a note, `akan.runtime.whole-scope`, at each file that reads it by a computed key, through a cast, hands it on, re-exports it or imports it whole, so a page that loads that file loads the scope's whole client runtime. The notes never fail a command and change no build: the file works as it is. Each line also says how long reading the scope took. The report reads every name from module source, the store, signal and constant files of the scope and the libraries it loads, and a test checks those names against the ones the generated runtime answers.
|
|
15
609
|
- 98931e4: `akan start` boots the backend while the first base build runs: the backend loads its server graph beside the build and mounts the web surface as soon as the build's artifact is on disk, so the dev server is ready sooner.
|
|
16
610
|
|
|
17
611
|
The port now answers from the start of the build. A request to `localhost` or an IP address, page or API, waits for the first artifact; a build longer than the 15 s the gateway holds a request ends the wait with a 503 "Backend is starting" page that reloads itself. A request to one of the app's own domains (a custom local domain) gets that 503 at once until the backend is ready, because the build has not written the app's hosts yet; after that it is served as before, and any other Host is refused as before.
|
|
18
612
|
|
|
19
613
|
- 1d8c8c2: `akan start` keeps `apps/<app>/.akan/cache` between runs, so a restart reuses the CSS class scan and the subset fonts instead of redoing them. Each entry names the akanjs and Bun versions and the build of the cache code that wrote it, and an entry another one wrote, or one cut short, is rebuilt.
|
|
614
|
+
- cb8ec71: `akan start` binds the port `PORT` names.
|
|
615
|
+
|
|
616
|
+
`PORT=28284 akan start face` started the dev server on the app's derived port (8282 plus its place in the app list) and said nothing about the value it dropped, while the built server (`bun main.js`) honours `PORT`. Only `AKAN_DEV_PORT` moved a dev server.
|
|
617
|
+
|
|
618
|
+
`AKAN_DEV_PORT` still wins. Without it, a usable `PORT` pins the dev port the same way, for every command that looks for the dev server (`akan start`, `--kill`, `akan preview`); several apps started together count upward from it. A workspace whose shell or root `.env` already sets `PORT` for another purpose now starts its dev server there: set `AKAN_DEV_PORT` to keep the old port.
|
|
619
|
+
|
|
620
|
+
The runtime guide gains three lines on the dev port, so the budget of `runtimeRule-1.md` is raised to 19287 bytes.
|
|
621
|
+
|
|
20
622
|
- 98931e4: `akan start` prints one line when the dev server is ready that says where the start's time went: what the CLI did before the builder, the base build and its parts, the backend's boot, and when the first artifact was on disk.
|
|
623
|
+
- 4795e71: `akan sync` lists an app's libs in one fixed order, and `akan.app.json` records the routes of the lib pages the same sync linked.
|
|
624
|
+
|
|
625
|
+
- **Libs are listed dependency first, by name where neither depends on the other.** The order came from which lib's scan finished first, so two syncs of an unchanged tree could rewrite the generated barrels (`lib/cnst.ts`, `lib/dict.ts`, `lib/sig.ts`, `lib/st.ts`, `client.ts`, `server.ts` and the rest) with the same libs in another order. A real workspace of nine libs had 58 generated files rewritten that way by the second sync of a clean checkout. `libDeps` in `akan.app.json` and `akan.lib.json` follows the same order.
|
|
626
|
+
- **`routes` in `akan.app.json` holds lib pages from the first sync.** With `syncPageLibs`, the manifest was written before the lib page folders were linked, so the first sync of a new checkout recorded the app's own routes only and a second sync added the rest.
|
|
627
|
+
|
|
628
|
+
**Expect one diff.** The first sync after this upgrade can reorder the lib imports and lists in generated files once, in every app and lib of a workspace. Nothing else in them changes, and a later sync leaves them alone.
|
|
629
|
+
|
|
630
|
+
- 8bbe7c8: A Redis or Postgres tunnel to a cluster environment needs a configured credential: `SSH_TUNNEL_PRIVATE_KEY_PATH` (with `SSH_TUNNEL_PASSPHRASE` if the key has one), exported in the shell, or `SSH_TUNNEL_PASSWORD`. Without either, the tunnel fails before it dials, with an error naming both settings, instead of signing in with a built-in default credential and a warning. This removes an unsafe default. A key file the tunnel cannot read fails with an error naming the tunnel, `SSH_TUNNEL_PRIVATE_KEY_PATH` and the path.
|
|
631
|
+
|
|
632
|
+
**Upgrading.** If `akan start` against a cluster environment opened its tunnel with neither setting, it now stops with that error in every database mode but `single`, where it logs the error and runs without Redis. Export `SSH_TUNNEL_PRIVATE_KEY_PATH` in the shell (a repository's dotenv file cannot set it), or set `SSH_TUNNEL_PASSWORD` to the password the cluster's tunnel endpoint expects. `SSH_TUNNEL_USERNAME` still defaults to `root`.
|
|
633
|
+
|
|
634
|
+
- 7d4c3c7: fix(lint): `noUnnecessaryConditions` is off in the base Biome config again
|
|
635
|
+
|
|
636
|
+
Biome reads a class field initialised with a literal as that literal for good: `#isBusy = false` stays `false` however many methods assign it, so `if (this.#isBusy)` gets "This condition is always falsy" and `if (!this.#hasFeeder)` "always truthy". Private, public and static fields, and boolean, number and string literals, all read this way; an explicit annotation (`#isBusy: boolean = false`) does not. It is biomejs/biome#11174, open since 2.5.6 and still there in 2.5.15 and 2.6.8, so the 2.5.15 bump that fixed the `RegExp.exec` misreading did not make the rule safe to show. In this repository 174 of its 607 warnings are checks on such a field.
|
|
637
|
+
|
|
638
|
+
`akan verify` prints the warning to agents, and the fix it suggests is to delete a guard that is live. So the base config turns the rule off, as it was from 3.3.0-rc.38 to rc.45. A workspace that wants it sets `"noUnnecessaryConditions": "warn"` under `linter.rules.suspicious` in its own `biome.json`; this repository's does. A test pins the misreading, so the rule can come back when Biome fixes it.
|
|
639
|
+
|
|
21
640
|
- 694444d: `akan verify` writes its build check to `dist/verify/<app>` and leaves `dist/apps/<app>` as `akan build` left it, so running `akan verify` after `akan build` no longer stops `cd dist/apps/<app> && bun main.js` from starting. The check no longer copies the app's `public/` and `private/` folders either.
|
|
641
|
+
- 86e2fe1: A workflow plan that lacks a required input now names the flag to pass and the inputs it was given but does not take.
|
|
642
|
+
|
|
643
|
+
`akan workflow plan create-scalar --app shop --module address` used to answer `requires input "scalar"` and drop `--module` without a word. It now answers `Workflow create-scalar requires input "scalar" (--scalar on the command line). It does not take "module", which was passed.` The `plan_workflow` tool of `akan mcp` returns the same message.
|
|
644
|
+
|
|
645
|
+
- Updated dependencies [800f3ef]
|
|
646
|
+
- Updated dependencies [4a568b2]
|
|
647
|
+
- Updated dependencies [e5d3cac]
|
|
22
648
|
- Updated dependencies [c44d068]
|
|
649
|
+
- Updated dependencies [43b44ca]
|
|
650
|
+
- Updated dependencies [6443972]
|
|
651
|
+
- Updated dependencies [af57986]
|
|
652
|
+
- Updated dependencies [f678e80]
|
|
653
|
+
- Updated dependencies [cda53a8]
|
|
654
|
+
- Updated dependencies [af09c4f]
|
|
23
655
|
- Updated dependencies [24315d1]
|
|
656
|
+
- Updated dependencies [7c4143e]
|
|
657
|
+
- Updated dependencies [e3f405f]
|
|
658
|
+
- Updated dependencies [55d1518]
|
|
659
|
+
- Updated dependencies [edf14fd]
|
|
660
|
+
- Updated dependencies [0a2f6dd]
|
|
661
|
+
- Updated dependencies [b5b4834]
|
|
662
|
+
- Updated dependencies [8720b88]
|
|
663
|
+
- Updated dependencies [4ff5d5e]
|
|
664
|
+
- Updated dependencies [b5b4834]
|
|
665
|
+
- Updated dependencies [a708a40]
|
|
666
|
+
- Updated dependencies [170fa28]
|
|
667
|
+
- Updated dependencies [19c6fa7]
|
|
668
|
+
- Updated dependencies [217b061]
|
|
669
|
+
- Updated dependencies [c7dee50]
|
|
670
|
+
- Updated dependencies [fa2bd6c]
|
|
671
|
+
- Updated dependencies [9a3e6b0]
|
|
672
|
+
- Updated dependencies [c30e4df]
|
|
673
|
+
- Updated dependencies [0baacae]
|
|
674
|
+
- Updated dependencies [e704d16]
|
|
675
|
+
- Updated dependencies [5c7c6cf]
|
|
676
|
+
- Updated dependencies [53bf2de]
|
|
677
|
+
- Updated dependencies [bbc9def]
|
|
678
|
+
- Updated dependencies [aff1ba2]
|
|
24
679
|
- Updated dependencies [bf582c1]
|
|
680
|
+
- Updated dependencies [8bbe7c8]
|
|
681
|
+
- Updated dependencies [2030f6c]
|
|
25
682
|
- Updated dependencies [90d740f]
|
|
683
|
+
- Updated dependencies [1a225e8]
|
|
684
|
+
- Updated dependencies [e9598f3]
|
|
685
|
+
- Updated dependencies [1885caf]
|
|
686
|
+
- Updated dependencies [45e3ffa]
|
|
26
687
|
- Updated dependencies [3032627]
|
|
688
|
+
- Updated dependencies [9c2a5d9]
|
|
689
|
+
- Updated dependencies [b6f1838]
|
|
27
690
|
- Updated dependencies [c10f7cf]
|
|
28
691
|
- Updated dependencies [c10f7cf]
|
|
692
|
+
- Updated dependencies [10641a0]
|
|
693
|
+
- Updated dependencies [234e31d]
|
|
29
694
|
- Updated dependencies [045699c]
|
|
30
695
|
- Updated dependencies [5c7e083]
|
|
696
|
+
- Updated dependencies [31097f2]
|
|
31
697
|
- Updated dependencies [4040f2d]
|
|
698
|
+
- Updated dependencies [9a7a9d5]
|
|
699
|
+
- Updated dependencies [8d75f2b]
|
|
700
|
+
- Updated dependencies [d5e60f2]
|
|
32
701
|
- Updated dependencies [aead1aa]
|
|
702
|
+
- Updated dependencies [4225827]
|
|
703
|
+
- Updated dependencies [4225827]
|
|
704
|
+
- Updated dependencies [040c561]
|
|
705
|
+
- Updated dependencies [fb5e77e]
|
|
706
|
+
- Updated dependencies [bfa67d8]
|
|
707
|
+
- Updated dependencies [6f8f6aa]
|
|
708
|
+
- Updated dependencies [ee302c4]
|
|
709
|
+
- Updated dependencies [31097f2]
|
|
710
|
+
- Updated dependencies [6e5da23]
|
|
711
|
+
- Updated dependencies [48d33a7]
|
|
33
712
|
- Updated dependencies [5c6d039]
|
|
713
|
+
- Updated dependencies [b30db27]
|
|
34
714
|
- Updated dependencies [0492e0b]
|
|
35
715
|
- Updated dependencies [0492e0b]
|
|
36
716
|
- Updated dependencies [5c7e083]
|
|
37
717
|
- Updated dependencies [98931e4]
|
|
718
|
+
- Updated dependencies [05ef91f]
|
|
719
|
+
- Updated dependencies [8720b88]
|
|
720
|
+
- Updated dependencies [f4b5aa6]
|
|
721
|
+
- Updated dependencies [4225827]
|
|
722
|
+
- Updated dependencies [8f9d432]
|
|
723
|
+
- Updated dependencies [fb46b5d]
|
|
38
724
|
- akanjs@3.3.0
|
|
39
725
|
- @akanjs/language@3.3.0
|
|
40
726
|
|