Skip to content

feat(compiler): remove action render mode#680

Merged
cssbruno merged 1 commit into
mainfrom
issue-676-remove-action-render
Jun 22, 2026
Merged

feat(compiler): remove action render mode#680
cssbruno merged 1 commit into
mainfrom
issue-676-remove-action-render

Conversation

@cssbruno

Copy link
Copy Markdown
Owner

Summary

  • remove gowdk.Action from the public render-mode enum and reject "action" / gowdk.Action in config render defaults
  • keep action endpoints on SPA pages by moving buildgen/compiler tests to gowdk.SPA
  • update docs, ADR text, manifest examples, and VS Code render-mode highlighting so actions are endpoint capability rather than page rendering strategy

Issue Closure

Closes #676

Migration / Compatibility

This is intentionally breaking: configs that used Render.Default: gowdk.Action or Render.Default: "action" now fail config loading. Use gowdk.SPA or omit the default render mode. act declarations, g:post, generated action adapters, CSRF, partial responses, and action endpoint metadata remain supported.

Verification

  • I ran the relevant tests, lint, and build commands.
  • I ran scripts/test-go-modules.sh when Go code or compiler behavior changed.
  • I ran go build ./cmd/gowdk when CLI, compiler, runtime, addon, or release behavior changed.
  • I ran node --check editors/vscode/extension.js when editor files changed.
  • I updated docs for behavior, setup, or architecture changes.
  • I added or updated tests for changed behavior.
  • I considered security-sensitive surfaces such as auth, CSRF, redirects,
    request-time handlers, logs, diagnostics, embedded assets, editor commands,
    WASM, contracts, and realtime behavior.

Commands run:

  • go test ./internal/project ./internal/publicapi ./internal/gwdkir ./internal/compiler ./internal/buildgen ./internal/lang
  • go build ./cmd/gowdk
  • go test ./cmd/gowdk
  • node --check editors/vscode/extension-core.js && node --check editors/vscode/extension.js
  • node --test editors/vscode/*.test.js
  • go run ./cmd/gowdk check --ssr examples/pages/home.page.gwdk examples/actions/signup.page.gwdk
  • go run ./cmd/gowdk manifest --ssr examples/pages/home.page.gwdk examples/actions/signup.page.gwdk >/tmp/gowdk-action-render-manifest.json
  • go test ./...
  • scripts/test-go-modules.sh

LLM Assistance

  • LLM session summary: Codex inspected Decouple endpoint capabilities from page render modes and retire Action #676, confirmed actions should remain as endpoint capability, implemented the breaking removal of the Action render mode in an isolated worktree, updated tests/docs/editor metadata, and opened this draft PR.
  • Human-reviewed assumptions: breaking configs that still name action as a render mode is acceptable for this change; action endpoint behavior remains in scope and should not be removed.
  • Follow-up work: consider a deeper endpoint-plan cleanup separately from render-mode removal.

@github-actions github-actions Bot added compiler Compiler internals, pipeline, and generated metadata IR Internal compiler IR and phase handoffs docs Documentation work LSP Language server and editor tooling labels Jun 22, 2026
@cssbruno cssbruno marked this pull request as ready for review June 22, 2026 16:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 01d880da16

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +168 to +172
render, err := parseRenderConfig(field.Value)
if err != nil {
return gowdk.Config{}, false, false, err
}
config.Render = render

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate executable render defaults too

This new rejection only runs for the AST-only config path; when Render.Default contains an expression such as Default: gowdk.RenderMode("action") or a variable initialized to that value, needsConfigExpressionEvaluation switches to loadExecutableConfig, and validateLoadedConfig never revalidates config.Render.Default. Those configs still load with the removed "action" mode and then fail later or produce inconsistent route metadata, despite this change intending removed render modes to fail during config loading.

Useful? React with 👍 / 👎.

return renderModeByName(typed.Name)
default:
return ""
return "", fmt.Errorf("unsupported render mode expression")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve explicit zero render defaults

A literal config that explicitly leaves the render default at its zero value, e.g. Render: gowdk.RenderConfig{Default: ""}, now falls through to this new unsupported-expression error because parseString returns an empty string for both an empty literal and non-string expressions. The zero value is still the documented/default SPA behavior via RenderConfig.DefaultMode(), so this rejects an otherwise equivalent config during loading; allow an empty string literal before treating the expression as unsupported.

Useful? React with 👍 / 👎.

@cssbruno cssbruno merged commit 6fa2d88 into main Jun 22, 2026
18 checks passed
@cssbruno cssbruno deleted the issue-676-remove-action-render branch June 22, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler Compiler internals, pipeline, and generated metadata docs Documentation work IR Internal compiler IR and phase handoffs LSP Language server and editor tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decouple endpoint capabilities from page render modes and retire Action

1 participant