release: WRNexusJS 0.6.0

This commit is contained in:
2026-08-01 01:09:58 +05:30
parent 3e565e8d03
commit 687d345882
502 changed files with 33038 additions and 11358 deletions
+9
View File
@@ -0,0 +1,9 @@
# WRNexusJS v0.6 architecture
The v0.6 compiler produces separate server and browser targets, generated declarations, component/store metadata, and an RPC manifest. Client functions are loaded as browser modules; server functions remain server-side. Shared functions are emitted to both targets.
The RPC endpoint accepts only manifest-declared server calls, validates input and output, enforces same-origin and CSRF checks, and returns structured traceable errors. Compile-time typing is never treated as an authorization boundary.
SSR creates one store container per request. Only serializable shared/client store state enters the hydration payload. Server state is excluded. CSR retains global stores across navigation and disposes page stores when the route changes.
Compatibility mode retains legacy component discovery, string layouts, unmodified legacy functions, and legacy output handling while emitting migration diagnostics.
+88
View File
@@ -0,0 +1,88 @@
# WRNexusJS v0.6 language
## Imports
```wrn
import type { PublicUser } from "@/types/user.ts"
import PublicLayout from "@/layouts/PublicLayout.wrn"
import userStore from "@/stores/global/user.wrn"
import { Button, Modal } from "@wrnexus/ui"
```
Existing applications default to compatible import mode. Explicit mode requires component, layout, store, and non-global type imports.
## Typed props, state, functions, and outputs
```wrn
component ConfirmCard {
props {
title: string
open: boolean = false
user?: PublicUser
}
state count: number = 0
state {
loading: boolean = false
}
client state {
focused: boolean = false
}
server state {
internalSessionId: string | null = null
}
outputs {
confirm(payload: ConfirmPayload)
cancel()
}
functions {
client async function confirm(payload: ConfirmPayload): Promise<void> {
const result = await server.confirm(payload)
output.confirm(result)
}
server async function confirm(payload: ConfirmPayload): Promise<ConfirmResult> {
return await confirmationService.save(payload)
}
shared function normalize(value: string): string {
return value.trim()
}
}
}
```
`event` is reserved for native DOM events. `payload` is the component-output payload. `$emit` and `event.detail` are compatibility-only APIs in v0.6.
## Stores
```wrn
global store UserStore {
state {
user: PublicUser | null = null
}
computed {
authenticated: boolean = user !== null
}
persist {
storage = "local"
include = ["user"]
version = 1
}
functions {
client function clear(): void {
user = null
}
}
}
```
Global stores survive CSR navigation and are request-scoped during SSR. Page stores are disposed on route leave. External state mutation is rejected; use store functions. `reset()` and `snapshot()` are built in.