Skip to content

Commit 422fcdb

Browse files
wheels-bot[bot]github-actions[bot]bpamiriclaude
authored
docs(web/guides): add Debug Panel guide (#2539)
* docs(web/guides): add Debug Panel guide covering each tab and configuration <!-- wheels-bot:write-docs:2536 --> * docs(web/guides): fix debug panel setting names and sidebar order Address review feedback on PR #2539: - Replace `enableDebug` (which does not exist in the framework) with `showDebugInformation` throughout. The actual gate is checked in `vendor/wheels/events/EventMethods.cfc` and initialized in `vendor/wheels/events/init/debugging.cfm`. - Correct the default-environment claim: `showDebugInformation` is `true` only in `development`, not also in `testing` (per `debugging.cfm` lines 26-27, anything other than `development` flips it to false). - Correct `enablePublicComponent` default: it is `false`, only flipped to `true` in `development` (per `onapplicationstart.cfc` lines 241-243). - Add conditionality note to the Request tab's DB Adapter row, matching the existing treatment of the Route row (debug.cfm renders DB Adapter inside `StructKeyExists(application.wheels, "adapterName")`). - Bump sidebar `order` for `route-model-binding`, `cors`, `rate-limiting`, and `dependency-injection-usage` by 1 each so `debug-panel` (order 11) no longer collides with `route-model-binding`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(web/guides): address Reviewer A/B consensus findings (round 1) - Fix Tools tab API Docs URL: /wheels/api-docs -> /wheels/api (matches urlFor(route='wheelsApiDocs') resolving to namespaced /wheels/api per vendor/wheels/public/routes.cfm:22) - Fix Tools tab Tests URL: /wheels/tests -> /wheels/app/tests (matches urlFor(route='testbox') pattern at vendor/wheels/public/routes.cfm:40) * docs(web/guides): add debug panel screenshots from blog demo Captured against a running Wheels 4.0.0-SNAPSHOT app (the blog sample) via headless Chrome driven by CDP. All seven `{/* screenshot: ... */}` placeholders in debug-panel.mdx are now replaced with `<img>` references to PNGs under public/v4-0-0-snapshot/digging-deeper/debug-panel-screenshots/. Shots: - 01-collapsed-bar — bar pinned to bottom with all five tabs visible - 02-request-panel — Posts.index with full key-value table - 03-timing-panel — execution timing bars (action 9ms, view 3ms) - 04-params-panel — table populated from a query string with four params - 05-environment-panel — Application + Packages + Plugins sections - 06-tools-panel — Developer Tools link grid Total bundle ~1.0MB (six PNGs at 1280x800 @2x for retina). The Environment-panel shot is referenced from both the Application and Packages subsections since it shows both at once. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Peter Amiri <peter@alurium.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d7c3a66 commit 422fcdb

13 files changed

Lines changed: 217 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ All historical references to "CFWheels" in this changelog have been preserved fo
2424
2525
### Added
2626

27+
**Documentation**
28+
- Add Debug Panel guide covering each tab, configuration settings, and when the bar appears
29+
2730
**ORM & data layer**
2831
- Chainable query builder with `where()`, `orWhere()`, `whereNull()`, `whereBetween()`, `whereIn()`, `whereNotIn()`, `orderBy()`, `limit()`, and more for injection-safe fluent queries (#1922)
2932
- Enum support with `enum()` for named property values, auto-generated `is*()` checkers, auto-scopes, and inclusion validation (#1921)
194 KB
Loading
143 KB
Loading
168 KB
Loading
182 KB
Loading
178 KB
Loading
178 KB
Loading

web/sites/guides/src/content/docs/v4-0-0-snapshot/digging-deeper/cors.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: CORS
33
description: Cross-origin request handling — configuring the Cors middleware, preflight, credentials mode, and per-route scoping.
44
type: howto
55
sidebar:
6-
order: 12
6+
order: 13
77
---
88

99
import { Aside, CardGrid, LinkCard } from '@astrojs/starlight/components';
Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
---
2+
title: Debug Panel
3+
description: The built-in development debug bar — what each tab shows, how to configure it, and when it appears.
4+
type: howto
5+
sidebar:
6+
order: 11
7+
---
8+
9+
import { Aside, CardGrid, LinkCard } from '@astrojs/starlight/components';
10+
11+
The Debug Panel is a fixed bar that Wheels appends to every HTML response in development mode. It surfaces request details, execution timing, parameters, environment configuration, installed packages, and links to built-in tools — without leaving the page you are working on. The panel is rendered by `vendor/wheels/events/onrequestend/debug.cfm` and runs at the very end of the request lifecycle, after your controller and views have finished.
12+
13+
**You'll learn:**
14+
15+
- When the debug bar appears and how to control it
16+
- What each tab shows and which configuration drives it
17+
- How to read the timing breakdown to find bottlenecks
18+
- Where to find package and plugin status
19+
- How to access developer tools from the bar
20+
21+
## When the debug bar appears
22+
23+
The bar only renders for standard full-page HTML requests. It is automatically suppressed for any of the following:
24+
25+
- AJAX requests (`X-Requested-With: XMLHttpRequest`)
26+
- HTMX requests (`HX-Request`)
27+
- Turbo Frame requests (`Turbo-Frame`)
28+
- Fetch requests (`X-Fetch: true`)
29+
- Requests that produce structured output (`?format=json`, `xml`, `csv`, or `pdf`)
30+
31+
This means AJAX-driven partial updates, Turbo Streams, API endpoints, and CSV exports all receive clean responses with no injected HTML.
32+
33+
## Enabling and disabling
34+
35+
The bar respects the `showDebugInformation` application setting. By default, Wheels sets this to `true` only in the `development` environment and `false` in every other environment (`testing`, `maintenance`, and `production`). You can override it explicitly in `config/environment.cfm`:
36+
37+
```cfm title="config/environment.cfm"
38+
<cfset set(showDebugInformation=true)>
39+
```
40+
41+
Setting `showDebugInformation=false` removes the bar entirely — no HTML is injected into responses.
42+
43+
<Aside type="caution">
44+
Never enable the debug bar in production. It renders internal state — your data source name, environment, CFML engine version, and parameter values — that you do not want visible to end users.
45+
</Aside>
46+
47+
## The debug bar
48+
49+
When active, the bar appears as a slim strip pinned to the bottom of the browser window. Tabs are arranged from left to right: a Wheels logo (doubles as the Request tab toggle), then Request, Timing, Params, Environment, and optionally Tools. The right side shows the current git branch (when Wheels detects a `.git` directory), the framework version, and a one-click reload link when no reload password is configured.
50+
51+
![The collapsed Wheels debug bar pinned to the bottom of a browser window: Wheels logo, Posts.index controller.action, timing badge, Params, Development environment, and Tools tabs, with Wheels 4.0.0-SNAPSHOT version on the right](/v4-0-0-snapshot/digging-deeper/debug-panel-screenshots/01-collapsed-bar.png)
52+
53+
Clicking any tab opens a panel above the bar. Clicking the same tab again closes it. The minimize button (×) collapses the bar to a small "Debug" button in the corner, persisted via `sessionStorage` so it stays collapsed as you navigate.
54+
55+
## Request tab
56+
57+
The Request tab label shows `controller.action` for the current request. Clicking it opens a key-value panel with:
58+
59+
| Field | Description |
60+
|---|---|
61+
| Route | Named route that matched this request (omitted when no named route matched) |
62+
| Controller | Controller name |
63+
| Action | Action name |
64+
| Key | URL key segment, if present |
65+
| HTTP Method | `GET`, `POST`, `PUT`, `DELETE`, etc. |
66+
| URL | Full URL for this request |
67+
| Application | Value of `applicationName` from `Application.cfc` |
68+
| Data Source | The configured `dataSourceName` |
69+
| DB Adapter | The active database adapter (MySQL, PostgreSQL, SQL Server, etc.) — omitted when the adapter name is not detected |
70+
| URL Rewriting | Current URL rewriting mode |
71+
72+
![Request panel open showing the key-value table: Route (root), Controller (Posts), Action (index), HTTP Method (GET), URL, Application (blog), Data Source (blog), DB Adapter (SQLiteModel), URL Rewriting (On)](/v4-0-0-snapshot/digging-deeper/debug-panel-screenshots/02-request-panel.png)
73+
74+
Use this panel to confirm that routing resolved the way you intended, that the correct data source is in use, and that URL rewriting is configured as expected.
75+
76+
## Timing tab
77+
78+
The Timing tab label shows the total request duration in milliseconds, color-coded by threshold:
79+
80+
- **Green** — under 100 ms
81+
- **Yellow** — 100–499 ms
82+
- **Red** — 500 ms or more
83+
84+
Opening the panel shows a horizontal bar chart breaking down where time was spent. Each phase (model, queries, template rendering, etc.) is sorted by duration descending and rendered as a proportional colored bar showing both the raw milliseconds and the percentage of total time.
85+
86+
![Timing panel showing "Execution Timing — 9ms total" in the header with horizontal bar chart for action and view phases, color-coded and sorted by duration](/v4-0-0-snapshot/digging-deeper/debug-panel-screenshots/03-timing-panel.png)
87+
88+
The chart is most useful for spotting query-heavy actions: if `queries` or `model` accounts for 80%+ of total time, look at the SQL being generated (the Routes admin page lists query counts per action if you need more detail).
89+
90+
## Params tab
91+
92+
The Params tab shows the count of extra request parameters as a badge. Opening the panel displays a table of every parameter that was available to the action, excluding the routing parameters (`controller`, `action`, `key`, `route`) and `fieldnames`.
93+
94+
| Column | Description |
95+
|---|---|
96+
| Name | Parameter key, lowercased |
97+
| Value | The value; complex values (structs, arrays) are JSON-encoded |
98+
| Type | `string` or `json` |
99+
100+
![Params panel showing the Request Parameters table with Name, Value, Type columns — four rows for status=published, category=tech, author=peter, page=2 — all string type](/v4-0-0-snapshot/digging-deeper/debug-panel-screenshots/04-params-panel.png)
101+
102+
This is the fastest way to confirm that form fields, query string values, and nested structs arrived the way you expected before you reach for a `writeDump` call.
103+
104+
## Environment tab
105+
106+
The Environment tab label shows the current environment name (Development, Testing, etc.) with a color-coded dot matching the timing badge palette. The panel is divided into subsections based on what is enabled.
107+
108+
### Application
109+
110+
Always shown. Lists the environment, the git branch (when the app root contains a `.git` directory), the Wheels version, the CFML engine and version, and the host name (when available).
111+
112+
When no reload password is set, the environment name is followed by quick-switch links that reload the app in a different environment mode. This is useful during development to test environment-specific code paths without editing config files.
113+
114+
![Environment & Configuration panel showing Application section with Environment (Development with green dot), Wheels Version, CFML Engine (Lucee 7.0.0.395), Host Name; Packages section listing wheels-basecoat; and Plugins (Legacy) "No plugins installed."](/v4-0-0-snapshot/digging-deeper/debug-panel-screenshots/05-environment-panel.png)
115+
116+
### Packages
117+
118+
Shown when `enablePackagesComponent` is `true` (the default in Wheels 4.0+). Displays two tables.
119+
120+
**Installed packages** lists every package found in `vendor/` and loaded by `PackageLoader.cfc`:
121+
122+
| Column | Description |
123+
|---|---|
124+
| Package | Package name from `package.json` |
125+
| Version | Semver version string |
126+
| Description | One-line description |
127+
128+
If any package failed to load (manifest error, missing dependency, CFC exception), a red error list appears below the installed table with the package name and the exception message.
129+
130+
**Available from registry** pulls the same 24-hour cached registry index used by the `wheels packages` CLI and shows what is available to install:
131+
132+
| Column | Description |
133+
|---|---|
134+
| Package | Name, linked to the package homepage when available |
135+
| Latest | Latest compatible version |
136+
| Description | Registry description |
137+
138+
![Packages section of the Environment panel — Installed table showing wheels-basecoat 3.0.0-rc.1 with version and description columns](/v4-0-0-snapshot/digging-deeper/debug-panel-screenshots/05-environment-panel.png)
139+
140+
This lets you discover first-party packages such as `wheels-hotwire`, `wheels-sentry`, or `wheels-i18n` without leaving the app. The table reflects the same 24-hour cache as `wheels packages list`; run `wheels packages registry refresh` from the CLI if you need up-to-the-minute data.
141+
142+
### Plugins (legacy)
143+
144+
Shown when `enablePluginsComponent` is `true`. Lists plugins installed in the legacy `plugins/` directory with their names and versions. Legacy plugins are the Wheels 3.x predecessor to packages — if you are on a fresh 4.x app, this section is likely empty.
145+
146+
If any plugin warnings exist, a red **Warnings** subsection appears beneath the plugin table:
147+
148+
- **Incompatible plugins** — plugins flagged as incompatible with the current Wheels version (controlled by `showIncompatiblePlugins`)
149+
- **Dependent plugins** — plugins whose dependencies are not satisfied
150+
- **Version mismatches** — plugins that require a different version of another plugin than what is loaded
151+
- **Mixin collisions** — cases where two plugins defined the same method name on the same mixin target; the later-loaded plugin wins
152+
153+
## Tools tab
154+
155+
Shown when `enablePublicComponent` is `true` (the default in development). Opens a grid of link cards, each opening in a new tab:
156+
157+
| Card | Links to |
158+
|---|---|
159+
| System Info | `/wheels/info` — Wheels internals, environment variables, loaded settings |
160+
| Routes | `/wheels/routes` — all registered routes with HTTP method, path, and handler |
161+
| API Docs | `/wheels/api` — generated API documentation |
162+
| Guides | `/wheels/guides` — the documentation site |
163+
| Tests | `/wheels/app/tests` — the test runner |
164+
| Migrator | `/wheels/migrator` — the database migration UI (shown when `enableMigratorComponent` is `true`) |
165+
| Packages | `/wheels/packages` — the package browser (shown when `enablePackagesComponent` is `true`) |
166+
| Plugins | `/wheels/plugins` — the legacy plugin list (shown when `enablePluginsComponent` is `true`) |
167+
168+
![Tools panel showing the Developer Tools link-card grid: System Info, Routes, API Docs, Guides, Tests, Migrator, Packages, and Plugins](/v4-0-0-snapshot/digging-deeper/debug-panel-screenshots/06-tools-panel.png)
169+
170+
## Configuration reference
171+
172+
All settings are applied in `config/settings.cfm` or an environment-specific file under `config/`:
173+
174+
```cfm title="config/environment.cfm"
175+
<cfset set(showDebugInformation=true)>
176+
<cfset set(enablePackagesComponent=true)>
177+
<cfset set(enablePluginsComponent=true)>
178+
<cfset set(showIncompatiblePlugins=true)>
179+
<cfset set(enablePublicComponent=true)>
180+
<cfset set(enableMigratorComponent=true)>
181+
```
182+
183+
| Setting | Default | Effect |
184+
|---|---|---|
185+
| `showDebugInformation` | `true` in `development`, `false` elsewhere | Show or hide the debug bar entirely |
186+
| `enablePackagesComponent` | `true` | Show the Packages subsection in the Environment panel and the Packages link in Tools |
187+
| `enablePluginsComponent` | `true` | Show the Plugins (Legacy) subsection and the Plugins link in Tools |
188+
| `showIncompatiblePlugins` | `true` | Include incompatible-plugin warnings in the Warnings subsection |
189+
| `enablePublicComponent` | `true` in `development`, `false` elsewhere | Show the Tools tab and its link grid |
190+
| `enableMigratorComponent` | `true` | Show the Migrator link in the Tools panel |
191+
192+
## Related guides
193+
194+
<CardGrid>
195+
<LinkCard
196+
title="Packages"
197+
description="Install first-party packages, write your own, and understand the vendor/ activation model — the same packages that appear in the debug bar's Packages tab."
198+
href="/v4-0-0-snapshot/digging-deeper/packages/"
199+
/>
200+
<LinkCard
201+
title="Configuration"
202+
description="Full reference for all Wheels application settings, including the debug-related flags covered here."
203+
href="/v4-0-0-snapshot/configuration/"
204+
/>
205+
</CardGrid>

web/sites/guides/src/content/docs/v4-0-0-snapshot/digging-deeper/dependency-injection-usage.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Dependency Injection Usage
33
description: Practical DI patterns — strategy swapping in tests, per-request resolvers, factories, and the service-locator pitfall.
44
type: howto
55
sidebar:
6-
order: 14
6+
order: 15
77
---
88

99
import { Aside, CardGrid, LinkCard } from '@astrojs/starlight/components';

0 commit comments

Comments
 (0)