Priority
Medium-high — language predictability, security reviewability, and refactor safety.
Context
Current docs describe lane inference for directives such as g:for and g:if: when an operand comes from server {} data, the directive renders server-side; when it comes from component state/store, the same directive binds a client island.
That design is compact, but the source code does not visibly state where execution happens.
Problem
The same directive spelling can have different execution, runtime, validation, and security behavior depending on where its data source is declared.
Examples of different behavior:
g:key is accepted but ignored server-side;
g:else and g:else-if are client-only;
- server expression evaluation failure hides the branch;
- server rows reject components and several client directives;
- moving data from state to server can change execution location without changing the directive.
This makes refactors risky and makes it harder for reviewers, tools, and users to answer: “does this run on the server or in the browser?”
Proposed direction
Make execution ownership explicit in source or in a required surrounding declaration.
Possible directions:
server view {
<li g:for={item in items}>{item.title}</li>
}
client view {
<li g:for={item in items}>{item.title}</li>
}
or explicit directive variants. The exact syntax can be designed separately, but the invariant should be: a source diff that changes execution location must show that change directly.
Acceptance criteria
Related
Priority
Medium-high — language predictability, security reviewability, and refactor safety.
Context
Current docs describe lane inference for directives such as
g:forandg:if: when an operand comes fromserver {}data, the directive renders server-side; when it comes from component state/store, the same directive binds a client island.That design is compact, but the source code does not visibly state where execution happens.
Problem
The same directive spelling can have different execution, runtime, validation, and security behavior depending on where its data source is declared.
Examples of different behavior:
g:keyis accepted but ignored server-side;g:elseandg:else-ifare client-only;This makes refactors risky and makes it harder for reviewers, tools, and users to answer: “does this run on the server or in the browser?”
Proposed direction
Make execution ownership explicit in source or in a required surrounding declaration.
Possible directions:
or explicit directive variants. The exact syntax can be designed separately, but the invariant should be: a source diff that changes execution location must show that change directly.
Acceptance criteria
Related
internal/parser#673 — Move semantic validation and asset identity planning out ofinternal/parser