Language

Language Construct Stability

This table is the per-construct stability and deprecation contract for the experimental 0.x .gwdk language. The diagnostics registry already records a stability tier per diagnostic code (internal/diagnostics/registry.go); this page does the same for the language constructs themselves, so a user or tooling author can tell which syntax is safe to depend on and which is still moving.

This table is the per-construct stability and deprecation contract for the experimental 0.x .gwdk language. The diagnostics registry already records a stability tier per diagnostic code (internal/diagnostics/registry.go); this page does the same for the language constructs themselves, so a user or tooling author can tell which syntax is safe to depend on and which is still moving.

It complements, and is pinned by, the machine-checked Conformance Corpus: a Stable or Partial construct should have an accept/ case, and a Planned/Deprecated construct should have a reject/ case asserting the diagnostic code named below.

Status Tiers

  • Stable: accepted by the current compiler and not expected to change shape within 0.x without a deprecation step.
  • Partial: accepted for a narrower slice than the final contract; the syntax is real but its capability will grow.
  • Planned: not accepted as source behavior yet; using it is rejected with the listed diagnostic code so it cannot become accidental behavior.
  • Deprecated: previously accepted spelling that is now rejected with a migration diagnostic.

The tiers below are the code-level registry lang.ConstructStabilities() (with metadata keywords derived from lang.MetadataKeywords and directives checked against viewparse.SupportedDirectiveNames()). TestStabilityRegistryCoversCodeConstructs asserts the registry covers every keyword and directive in code, and TestStabilityTableMatchesRegistry asserts this page matches the registry, so neither the table nor the registry can drift without failing a test.

Top-Level Blocks

ConstructTierNotes
packageStableRequired first declaration.
importStableGo import for colocated blocks.
useStablePackage-scoped component import.
paths {}PartialLiteral => { field: "value" } records only.
build {}PartialLiteral records and no-argument Go calls.
server {}PartialRequest-time server-lane data; requires the SSR addon.
view {}StableMarkup; see directives below.
style {}StableScoped CSS body.
client {}PartialBounded component client language.
go {} / go build {} / go server {} / go client {} / go addon.* {}PartialColocated Go lanes.
store / props / state / emitsPartialComponent contracts.
Unknown top-level blockPlannedRejected with unsupported_top_level_block.

Metadata Keywords

All metadata keywords are Stable. The canonical list is lang.MetadataKeywords.

KeywordTier
pageStable
routeStable
titleStable
descriptionStable
canonicalStable
imageStable
robotsStable
noindexStable
preloadStable
prefetchStable
layoutStable
cacheStable
revalidateStable
errorStable
guardStable
cssStable
componentStable
wasmStable
assetStable

Legacy @-prefixed metadata is Deprecated and rejected with malformed_legacy_metadata.

View g: Directives

Supported exact-name directives (the closed set in viewparse.SupportedDirectiveNames()):

DirectiveTierNotes
g:ifStableConditional render. Server-side over a server {} field; a client island over state/store. g:else-if/g:else are client-only chains.
g:for / g:keyStableList render. Server-side over a server {} field; a client island over state/store. The lane is inferred from the operand.
g:bind:value / g:bind:checkedPartialTwo-way bindings.
g:on:*PartialEvent handlers with .prevent/.stop/.once/.capture/.debounce/.throttle.
g:post / g:target / g:swapPartialProgressive form/fragment submission.
g:message:*Partialrequired, minlength, maxlength, pattern.
g:islandPartialjs or wasm island.
g:command / g:queryPartialContract web adapters.
g:subscribePartialRealtime presentation-event subscription metadata on query-owned elements.
g:eventPartialParses to explain backend-owned domain events.
g:unsafe-htmlStableRaw HTML escape hatch; unsafe_raw_html is reported.
g:refPartialClient reference.
g:slotPartialNamed/scoped slot.
g:transitionPartialCSS class/state hooks for client g:if branches and keyed client g:for rows.
g:animatePartialCSS class/state hooks for keyed client g:for row moves.

Component calls also accept g:bind:<ExportedState> for exported child state fields. HTML elements remain limited to g:bind:value and g:bind:checked.

View Markup Blocks

ConstructTierNotes
{#await}PartialClient-island async placeholder for fetchJSON[T](urlExpr) with pending, {:then name}, and optional {:catch err} branches.

Planned directives are rejected. They currently surface as the generic parse_error rather than the intended unsupported_markup_directive code; that code lands when markup rejections carry their own code (see Conformance Corpus).

Directive familyTierReplacement
g:window, g:document, g:body, g:headPlannedPage metadata or g:on:* on elements.
g:await, g:asyncPlannedUse {#await fetchJSON[T](urlExpr)} for local island placeholders, or build/load data, actions, APIs, and fragments for server-owned data.
g:use, g:action, g:attachPlannedclient {} with g:ref.

Foreign template syntax ({#if}, {@html}, and similar) is Planned/Unsupported and likewise currently surfaces as parse_error (intended: unsupported_markup_syntax).

Endpoint Declarations

ConstructTierNotes
actStableact <Name> POST "<path>"; POST only today.
apiStableapi <Name> <METHOD> "<path>"; GET/POST/PUT/PATCH/DELETE.
fragmentPartialFirst-slice partial updates.
act block formDeprecatedact <name> { ... }; rejected with old_action_block_syntax.
api block formDeprecatedapi <name> { ... }; rejected with old_api_block_syntax.