Commit 86f56af
docs(docs): record lazy-loading decision + add defensive spec (#2283)
Closes #2249.
Issue 2249 asked whether to keep or remove `"lazy": true` support in
package.json. Decision: keep. The feature is small (~15 lines in
PackageLoader), legitimately useful for third-party service-only
packages, and zero audit debt — no first-party package currently
qualifies, so we're not carrying adoption weight for an unused feature.
## What's already in place
- **Guide:** `web/sites/guides/src/content/docs/v4-0-0-snapshot/digging-deeper/packages.mdx`
has a dedicated `## Lazy loading` section and the `lazy` field is
documented in the manifest reference (added in #2281).
- **Tests:** `vendor/wheels/tests/specs/packages/PackageLoaderSpec.cfc`
already covers the happy path: eager-skip, `isPackageLoaded`, and
on-demand instantiation via `getPackage()`.
## What this PR adds
- **CHANGELOG entry** under Unreleased / Changed documenting the
retain-and-document decision, first-party audit result (no candidates),
and pointer to the guide.
- **Defensive spec** for the `canBeLazy` gate: a package declaring
`lazy: true` alongside `mixins: "controller"` must still be loaded
eagerly — if the lazy flag were honored the mixin tables would be
incomplete at boot. New fixture at `tests/_assets/packages/lazyignored/`.
## Audit of first-party packages
All six first-party packages declare `mixins: "controller"` and
therefore cannot be lazy-loaded (lazy requires mixins=none and no
middleware). No conversion work to do:
| Package | mixins | Candidate? |
|---|---|---|
| wheels-sentry | controller | no |
| wheels-hotwire | controller | no |
| wheels-basecoat | controller | no |
| wheels-legacy-adapter | controller | no |
| wheels-i18n | controller | no |
| wheels-seo-suite | controller | no |
The feature remains valid and tested for any future third-party
service-only package that benefits.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent fe9a603 commit 86f56af
4 files changed
Lines changed: 38 additions & 0 deletions
File tree
- vendor/wheels/tests
- _assets/packages/lazyignored
- specs/packages
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
449 | 466 | | |
450 | 467 | | |
451 | 468 | | |
| |||
0 commit comments