Skip to content

docs(web/blog): fix Adobe-breaking top-level var in from-wirebox-to-wheelsdi DI example#3235

Merged
bpamiri merged 1 commit into
developfrom
peter/fix-wirebox-di-post-var-scope
Jun 20, 2026
Merged

docs(web/blog): fix Adobe-breaking top-level var in from-wirebox-to-wheelsdi DI example#3235
bpamiri merged 1 commit into
developfrom
peter/fix-wirebox-di-post-var-scope

Conversation

@bpamiri

@bpamiri bpamiri commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

What

The published post From WireBox to Wheels DI has a config/services.cfm code example using a top-level var di = injector();. A bare top-level var statement compile-errors on Adobe CF (#3063) — config/services.cfm is an included template, not a function body, so var isn't valid there on Adobe. Lucee/BoxLang tolerate it, but the snippet as shipped breaks for any Adobe reader who copies it.

Switched to the cross-engine-safe local.di form (matching the DI guide and CLAUDE.md), and updated the chained .map()/.bind() references to local.di.*.

How this surfaced

Found during the Wheels 4.0 blog-series validation campaign. A validator claimed "the published guides ship the same var di form" — I verified, and the guides are actually clean (they already use local.di). The real occurrence was this one published blog post. The admin DB row (id 878) has been updated to match.

Content-only change to one blog .md; no executable code paths touched.

…heelsdi services.cfm example

The `config/services.cfm` snippet used a top-level `var di = injector();`. A bare
top-level `var` statement compile-errors on Adobe CF (#3063) — `config/services.cfm`
is an included template, not a function body, so `var` isn't valid there on Adobe.
Lucee/BoxLang tolerate it, but the example as shipped breaks for Adobe readers who
copy it. Switch to the cross-engine-safe `local.di` form (matching the DI guide and
CLAUDE.md), and update the chained references to `local.di.*`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Peter Amiri <petera@pai.com>
@github-actions github-actions Bot added the docs label Jun 20, 2026

@wheels-bot wheels-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wheels Bot — Reviewer

TL;DR — This docs-only PR fixes a config/services.cfm code example in the From WireBox to wheelsdi blog post, swapping a bare top-level var di = injector(); (and its chained .map()/.bind() references) for the cross-engine-safe local.di form. A bare var statement in an included template — which config/services.cfm is, not a function body — compile-errors on Adobe CF (#3063), so the snippet as shipped broke for any Adobe reader who copied it. The change is correct, complete, and matches the established convention. Verdict: approve.

Correctness

The fix is complete and internally consistent: all four lines (injector(), two .map() chains, one .bind() chain) now use local.di, leaving nothing stale. Verified against the file — web/content/blog/posts/from-wirebox-to-wheelsdi.md:49-52 is now uniformly local.di.*, and a grep for var di in the file returns nothing.

Conventions

The new form matches the canonical convention used everywhere else in the repo:

  • CLAUDE.md:453local.di = injector();
  • web/sites/guides/.../digging-deeper/dependency-injection-usage.mdx:30 and the rest of the v4-0-0 guides

So the blog post no longer contradicts the guides or the agent reference. As the PR body notes, the guides were already clean — this was the lone stray occurrence.

Commits

The single commit fa8d6abb6docs(web/blog): use local.di (not top-level var) in from-wirebox-to-wheelsdi services.cfm example — is a valid conventional-commit header at 97 chars (within the 100 limit), correct docs type, optional unrestricted scope. The PR title (87 chars) is likewise valid and is the squash-merge landing subject.

No changelog fragment is required: changelog.d/ is for user-facing framework fix/feat changes, not blog-content corrections.

Clean, well-scoped, verifiable. Nice catch on the Adobe-breaking snippet.

@bpamiri bpamiri merged commit d0c343a into develop Jun 20, 2026
13 checks passed
@bpamiri bpamiri deleted the peter/fix-wirebox-di-post-var-scope branch June 20, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant