Akan.js 3.3

Release note · Nov 28, 2026

Akan.js 3.3: lighter pages, safer by default

3.3 gathers more than 200 changes around three questions an app meets once real users arrive. How much does a page make the browser download? What could leak? Can you see what the server is doing? This post walks through the answers in plain words, then lists what to check when you upgrade from 3.2.

What's new

Eight changes worth knowing

01

Pages load only what they use

This site's typical page now sends 43% less JavaScript, and most apps get lighter just by upgrading.

Until now a page loaded the stores, API descriptions and texts of the whole app, even when it used one module. In 3.3 a page loads only the modules its own code names and only the icons it draws, and it loads no store library at all when it uses no store.

How much lighter depends on the app: a page that uses many modules has less to leave behind. When a page still loads everything, akan quality runtime names the file and line that cause it.

A page takes only its own modules
Of the app's five modules, only the two the page names are sent to the browser; the other three stay behind.
Terminal
akan build myappakan quality runtime

akan quality

02

Secrets stay out of the build

A leaked image no longer takes your passwords with it.

A built server used to carry the secret values of its env file: database passwords, API tokens, signing keys. akan build now leaves them out. The server reads each one from an environment variable when it starts, and stops with a message that names any it could not find.

akan secret-env lists the variables an app needs and writes them as a Kubernetes Secret or a dotenv file, so nobody copies them by hand.

Secrets arrive when the server starts
The image and the secrets reach the server by separate paths: the image holds no secret, and the key is handed over at start.
Terminal
akan secret-env myapp --env mainakan secret-env myapp --env main --format k8s --out local/secret-env.yaml

Deploying with secrets

03

Only your scripts run on your pages

A script someone slips into a page is refused by the browser.

Every page now tells the browser exactly which scripts it may run. The framework lists its own, so an injected script, the usual way an account is stolen through a comment or a profile field, does not run. A snippet of your own, such as an analytics tag, is named once in the page's head.

Not sure what your pages carry? Deploy once in report-only mode, and the server logs each script the policy would have blocked without blocking it.

The browser checks every script
The page's own script passes the policy and runs in the browser, while an injected script is stopped at the gate.
page/_layout.tsx
import { layout, scriptHashes } from "akanjs/client";const consent = "window.dataLayer=window.dataLayer||[];";export default layout()  .head(() => {    scriptHashes("sha256-djPdT5J1kuWFwawDhtbzz0YHt/63i3CUBG3CyUjLa4c=");    return <script dangerouslySetInnerHTML={{ __html: consent }} />;  })  .render(({ children }) => children);

Script policy

04

Sign-ins that are harder to steal

A stolen token is good for an hour, not a week.

With the shared library's sign-in, a web session now lives in cookies that page scripts cannot read. The token a browser holds lasts one hour and renews itself while the app is open. Signing a device out closes its live connections at once, on every server.

Users can see the devices signed in to their account and sign any of them out. Admin password sign-in can be closed in favour of SSO, and your code can be told about a locked account, a reused refresh token or a sign-in from a new device.

05

See what your server is doing

Request counts, slow queries and errors, without adding a library.

Every endpoint and page now counts its requests and times them, in a form Prometheus scrapes as it is. One request id follows a request through every process it touches, background jobs and websocket messages included, so one search finds its whole story in the logs.

A SQL statement that takes 200 ms or more gets a log line of its own, and the server can list which statements run most and take longest. Hand the server one function and its errors reach your error tracker; turn on client reports and the ones that happen only in a user's browser or inside a native app arrive too.

One id follows the request
One request id travels with a request from the gateway through the server to a background job.
apps/myapp/lib/option.ts
export const option = new AkanOption<ModulesOptions>()  .setErrorReporter(errorTracker)  .setClientReport({ sampleRate: 0.25 });

Metrics Error reporting

06

Agents that carry fewer tools and take more care

Long conversations cost less, and a stranger's text cannot give orders.

An agent with hundreds of tools used to send every tool's description on every turn. Now it can keep a short list and search for the rest when a task needs them. The conversation it sends only grows at the end, so the model provider's prompt cache keeps working and long conversations cost less.

Text someone else wrote, such as a document a user mentions or the content on the screen, now reaches the model marked as data, not as instructions. After the agent reads such text, its next change asks the user first. The in-page agent also answers only once the page it moved to has finished loading.

The same idea reaches MCP: an app with many endpoints can sort them onto shelves and let an MCP client search them, instead of handing over the whole list.

Agent chat MCP

07

Heavy work in its own process, in a safer image

A long job no longer slows the requests running beside it.

Name an entry file under workers in akan.config.ts and Akan builds it apart from the server. AppWorker.spawn then runs it as a process of its own, sends its output to the server log, and starts it again if it crashes. A library can ship a worker to every app that uses it.

The Docker image akan build writes now runs the server as an ordinary user instead of root, on a base image pinned to one exact build, and it can be built for another CPU architecture.

apps/myapp/akan.config.ts
workers: { vision: "srvkit/vision.worker.ts" },

Configuration

08

Navigation that answers at once, on the web and in native apps

A tap shows it was heard before the next page arrives.

A link can show a pressed state from the tap until its page is drawn, and a loading view can appear at the press. Nested layouts start rendering together instead of one after another, so the first paint of a page under three layouts that each wait for data came down from 214 ms to 52 ms in our test.

In a native app the page meets the keyboard the way a native screen does, on iOS and Android alike. A deep link opens the right screen with the screens that belong under it, Android's back button closes an open dialog first, and a development build installs beside the store app under its own name.

ui/Menu.tsx
<Link href="/orders" pendingClassName="opacity-60">  Orders</Link>

Routing Deep links

Performance

The numbers

Less to download is the headline, but the server got quicker too. It starts every level of a route at once, sends a page's file list to the render process once instead of with every request, and streams static files from disk at about a quarter of the CPU.

−43%

JavaScript on this site's median page

535 KB → 304 KB

−38%

lightest page of a 236-route app

466 KB → 290 KB

−32%

largest page of the minimal sample app

469 KB → 319 KB

−15%

an empty page

202 KB → 171 KB

4×

faster first paint under three waiting layouts

214 ms → 52 ms

5×

faster burst of cached pages

38 ms → 7 ms

Page sizes are the JavaScript a route loads, as served with brotli. Each figure was measured before and after the change behind it.

Fixed along the way

  • Korean, Japanese and emoji characters no longer break where a long page's output happened to be cut in the middle of a character.
  • A built server started on a machine with no NODE_ENV set renders its pages, where it used to fail every one.
  • A call to an API path that does not exist answers a JSON 404 instead of an HTML page, and a malformed websocket message answers 400 or 404 instead of a server error.
  • Tailwind classes marked important, such as h-0!, compile as important.
  • An input drops its error message when the field is emptied.
  • On iOS, opening the camera or the in-app browser no longer reloads the page underneath.

Upgrading from 3.2

3.3 keeps the requirements of 3.2: Bun 1.4.4 or newer and React 19.3.1. Update the workspace, verify each app and library, and refresh the agent guide. Several defaults changed for safety, so go through the list below before you deploy.

Terminal
akan updateakan verify <app-or-lib>akan agent install
  1. 1

    Give the server its secrets

    An image built with 3.3 holds no secret values and does not start without them. Run akan secret-env <app> --env <env>, supply those variables, and rotate the secrets older images still hold.

    Details
  2. 2

    Name your own inline scripts

    An inline script, an onclick="…" attribute or a javascript: link is blocked until the page names it. Deploy once with AKAN_CONTENT_SECURITY_POLICY_REPORT_ONLY=on to find them first.

    Details
  3. 3

    Sessions last one hour

    An app that mounts Auth.User or Auth.Admin renews by itself. A page that read the token out of a sign-in answer now gets an empty one: pass the answer to setAuth and let the cookie carry the session.

  4. 4

    The image runs as uid 1000

    A volume an older image wrote belongs to root. The server stops at boot and names the directory and the chown to run once. The Helm chart has values that keep an older image on root.

    Details
  5. 5

    Ignore two new generated paths

    Add lib/usePage.ts and lib/__client to .gitignore for apps and libs. Then run akan build and akan quality runtime to see whether anything keeps a page on the whole runtime.

    Details
  6. 6

    Deprecated imports are gone

    What 3.2 marked deprecated is removed: wildcard paths such as akanjs/server/* and @akanjs/devkit/*, and thirteen old exports. Typecheck points at each use.

  7. 7

    akan code is its own package

    A workspace that runs akan code adds it at the same version: bun add -d @akanjs/code@3.3.0.

    Details
  8. 8

    Native apps: two settings

    A desktop app that opens external views names their origins in native.desktop.externalView.allowOrigins. An iOS dev build installs as <appId>.debug, so register that App ID and its development profile.

    Details

The changelog has every option, env variable and removed name, including the notes for agents, observability and route caches that most apps will not need.

Read the full changelog

Released under the MIT License

Connect your AI to these docs

MCPhttps://akanjs.com/mcp
Copyright © 2026 Akan.js All rights reserved.System managed bybassman