Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: evaluate only the parameter closure when rendering dynamic parameters, and guard submit while they update - #28602

Draft
PushTheLimit wants to merge 2 commits into
coder:mainfrom
PushTheLimit:preview-resource-closure-bump
Draft

feat: evaluate only the parameter closure when rendering dynamic parameters, and guard submit while they update#28602
PushTheLimit wants to merge 2 commits into
coder:mainfrom
PushTheLimit:preview-resource-closure-bump

Conversation

@PushTheLimit

@PushTheLimit PushTheLimit commented Aug 25, 2026

Copy link
Copy Markdown

What this does

Two related improvements to the dynamic-parameters create-workspace flow:

  1. Bump coder/preview to the version that evaluates only the parameter, preset, and workspace-tag reference closure when rendering a form, instead of the whole module graph. On large templates this takes per-interaction form rendering from several seconds down to well under one second.

  2. Disable the "Create workspace" button and show a "Loading parameters..." spinner while the form is waiting for the server to reconcile parameters over the WebSocket, so a fast user cannot submit stale parameter values and get a workspace built with the wrong parameters.

Dependency chain

This is the top of a three-PR chain and is a draft until the lower PRs merge:

The go.mod replace directives point at public forks to illustrate the chain; they will be repointed to the merged coder/trivy and coder/preview as each lands.

Testing

Running in our internal Coder deployment since 2026-08-26: dynamic-parameter forms render sub-second on our largest templates, and the create button correctly disables with "Loading parameters..." while parameters reconcile.

@github-actions github-actions Bot added the community Pull Requests and issues created by the community. label Aug 25, 2026
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@PushTheLimit
PushTheLimit force-pushed the preview-resource-closure-bump branch 2 times, most recently from dc1bf58 to ca4df0e Compare August 25, 2026 21:36
…forms

Pulls in the coder/preview change that evaluates only the parameter/preset/tag
closure when rendering a workspace form, instead of the whole module graph. This
is what makes the dynamic-parameters websocket slow on large templates: on a real
template it cuts server-side evaluation from ~2s to ~0.16s per request (~12x)
with identical parameters, presets and tags.

No coderd code change: preview applies the optimization internally, so this is a
dependency bump only.

Chain: coder/preview PR (evaluate closure) depends on coder/trivy PR
(OptionWithResourceClosure). The preview and trivy replaces are temporarily
pinned to those PRs' fork commits so this builds; both will be moved to the
merged coder/preview and coder/trivy commits before this leaves draft.
…ating

When a user changes a dynamic parameter, the form sends the new inputs
over the WebSocket and waits for the server to return the reconciled
parameter set. A fast user could click "Create workspace" in that window
and submit stale parameter values, producing a workspace built with the
wrong parameters.

Track an updating flag that is set when inputs are sent and cleared when
the matching response arrives. While it is set, disable the submit button
and show the existing Spinner with a "Loading parameters..." label, then
re-enable once the response lands.
@PushTheLimit
PushTheLimit force-pushed the preview-resource-closure-bump branch from ca4df0e to 2d7e102 Compare August 26, 2026 03:10
@PushTheLimit PushTheLimit changed the title chore: bump coder/preview to skip resource evaluation when rendering forms feat: evaluate only the parameter closure when rendering dynamic parameters, and guard submit while they update Aug 26, 2026
@PushTheLimit

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Pull Requests and issues created by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant