You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use literal initial values from component JS in server HTML #146
Citry's server does not know the initial values a component sets in its JavaScript (data(), setup(), injected state). Knowing the simple, literal ones would help in three places.
Where it helps
Server-rendered HTML before hydration. The server leaves out values only the browser knows, such as the result of v-show="activeTab === 'notes'". So on a hydrated page, every tab panel is visible while the HTML parses, and Vue hides the inactive ones when it hydrates. On the benchmark project board at 1,400 outputs, keeping the inactive panels hidden in the server HTML measured about 7 ms faster to first layout, in one research run (hydration-step0, arm "k" vs "b"). With literal defaults such as data(){ return { open: true } }, the server could evaluate more of these bindings.
Linter. It could check template references against the state a component declares, and flag bindings whose initial value makes content permanently hidden.
LSP. It could offer completion and types for component state in templates.
Scope to decide
Which forms count as "literal": object literals returned from data(), ref(...)/reactive(...) initial values in setup(), and values from inject with a literal default.
What happens when a value is not literal. The server keeps today's behavior, leaving the value to the browser; the linter and LSP report it as unknown.
Where the parsing lives. The Rust side already parses compiled render code with oxc, so component JavaScript could be read there once per definition.
Not needed for the current performance work: the public board already matches the research targets without it.
changed the title [-]Read literal initial state from component JS for the server, linter and LSP[/-][+]Use literal initial values from component JS in server HTML[/+]on Oct 28, 2026
Retitled to the server part. The linter and editor already read the member names in $component({...}) (browser.rscollect_options; see the template-linting and VS Code docs pages). What remains is the server: it renders Vue bindings from prepared data and js_data() only, so a v-show whose initial value lives only in data() is written visible. Until this lands, the Vue guide and the Events State page explain the choice: move the value to js_data() for a matching first paint (each server render then resets it), or keep it in data().
Activity
[-]Read literal initial state from component JS for the server, linter and LSP[/-][+]Use literal initial values from component JS in server HTML[/+]JuroOravec commentedon Oct 28, 2026
Retitled to the server part. The linter and editor already read the member names in
$component({...})(browser.rscollect_options; see the template-linting and VS Code docs pages). What remains is the server: it renders Vue bindings from prepared data andjs_data()only, so av-showwhose initial value lives only indata()is written visible. Until this lands, the Vue guide and the Events State page explain the choice: move the value tojs_data()for a matching first paint (each server render then resets it), or keep it indata().