docs(web/guides): document buttonTo input-prefix convention and schema-cache invalidation#3250
docs(web/guides): document buttonTo input-prefix convention and schema-cache invalidation#3250bpamiri wants to merge 1 commit into
Conversation
…a cache Two v4 guide gaps surfaced while reviewing GitHub discussions: - buttonTo's input-prefixed attribute convention (inputClass/inputId/inputRel) was documented in v3 guides but dropped in the v4-0-0 restructure (#1352). Added a buttonTo entry to the view-helpers reference explaining that button attributes are input-prefixed because the button renders inside a <form>, and that siblings like linkTo take class/id directly. - The per-model schema/column-metadata cache in application.wheels.models — the cache that goes stale on a live ALTER TABLE and which $clearCache() cannot rebuild — was undocumented (#1481). Added a "Schema and model-metadata cache" section to the caching guide with reload/restart recovery options. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Peter Amiri <petera@pai.com>
There was a problem hiding this comment.
Wheels Bot — Reviewer
TL;DR — Docs-only PR closing two v4 guide gaps: buttonTo's input-prefixed attribute convention (#1352) and the per-model schema/column-metadata cache in application.wheels.models (#1481). Both additions are technically accurate — I verified every claim against the framework source — and the diff is clean. Verdict: approve.
Correctness
Both technical claims check out against vendor/wheels/:
-
buttonToinput-prefix split (views-layouts-partials.mdx). The doc states button attributes useinputClass/inputId/inputRelwhile unprefixedclass/idland on the wrapping<form>. This is exactly whatbuttonTo()does:vendor/wheels/view/links.cfc:143—local.args = $innerArgs(name = "input", args = arguments);routesinput*attrs onto the button.vendor/wheels/view/links.cfc:158—return $element(name = "form", ..., attributes = arguments);routes the remainingclass/idonto the form.- The function docstring (
links.cfc:83) corroborates it, so no source change was needed — the PR correctly leaves the code alone.
-
Schema / model-metadata cache (
caching.mdx). The doc claims$clearCache()cannot rebuild the column metadata inapplication.wheels.models. Confirmed:$clearCache()(Global.cfc:973-979) only ever callsStructClear(application.wheels.cache...). The model schema cache is cleared only by$clearModelInitializationCache()(Global.cfc:1341->StructClear(application.wheels.models)), which the reload path invokes (events/EventMethods.cfc:282). The recovery advice ("migrate, then reload") is sound. The two named settings the doc says do not rebuild it —clearQueryCacheOnReloadandclearTemplateCacheOnReload— both exist in the codebase, so the doc isn't inventing API names.
Docs
- Internal link
/v4-0-0/basics/migrations/resolves to an existing page (web/sites/guides/src/content/docs/v4-0-0/basics/migrations.mdx). <Aside type="caution">is safe —Asideis already imported atcaching.mdx:9, so no new import is required.- No changelog fragment needed: type
docs, notfix/feat. PR body states this correctly.
One minor, non-blocking note: the PR body acknowledges the full Astro build wasn't run locally. The two risks a build would catch — a broken internal link and a missing component import — are both verified above by hand, so residual risk is low.
Commits
docs(web/guides): document buttonTo input-prefix convention and schema cache — valid type, optional scope, header well under 100 chars, sentence-cased. DCO Signed-off-by trailer present. Conforms to commitlint.config.js.
Nicely scoped, accurate documentation. Approving.
Closes two v4 guide gaps surfaced while reviewing recent GitHub Discussions. Docs-only; no changelog fragment (type
docs, notfix/feat).1.
buttonToinput-prefix convention — discussion #1352The
input-prefixed attribute convention (inputClass/inputId/inputRel) was documented in the v3 guides but never carried into the v4-0-0 guides during the restructure — a grep forinputClass/inputIdacrossv4-0-0/returned nothing. Users hit "buttonTo()won't accept id/class" with no doc explaining why.Added a
buttonToentry to Common view helpers (views-layouts-partials.mdx) explaining that because the button renders inside a<form>, its attributes areinput-prefixed, while unprefixedclass/idland on the form — and thatbuttonTois the only link helper with this split. (The API docstring atvendor/wheels/view/links.cfcalready covers it in the function description, so no source change needed.)2. Schema / model-metadata cache — discussion #1481
The v4 caching guide thoroughly covers
application.wheels.cache(action/query/partial), but never the per-model schema cache inapplication.wheels.models— the column metadata Wheels reads viacfdbinfoat init and holds for the app lifetime. That's the cache that makes a running app throw "column not found" after a liveALTER TABLE, and which$clearCache()/clearQueryCacheOnReload/clearTemplateCacheOnReloaddo not rebuild.Added a "Schema and model-metadata cache" section to
caching.mdxexplaining the cache and the recovery options (migrate + per-node reload, rolling LB restart, off-hours engine restart).Verification
/v4-0-0/basics/migrations/confirmed to exist.<Aside>already imported incaching.mdx; no new component imports.🤖 Generated with Claude Code