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
Draft
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
PushTheLimit
force-pushed
the
preview-resource-closure-bump
branch
2 times, most recently
from
August 25, 2026 21:36
dc1bf58 to
ca4df0e
Compare
…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
force-pushed
the
preview-resource-closure-bump
branch
from
August 26, 2026 03:10
ca4df0e to
2d7e102
Compare
Author
|
I have read the CLA Document and I hereby sign the CLA |
cdrci2
added a commit
to coder/cla
that referenced
this pull request
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Two related improvements to the dynamic-parameters create-workspace flow:
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.
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.