Add support for lazy = true component flag to enforce lazy loading by default - #212
Merged
grantcopley merged 8 commits intoNov 25, 2025
Merged
Conversation
Co-authored-by: grantcopley <1197835+grantcopley@users.noreply.github.com>
grantcopley
marked this pull request as ready for review
September 25, 2025 15:07
Co-authored-by: grantcopley <1197835+grantcopley@users.noreply.github.com>
Co-authored-by: grantcopley <1197835+grantcopley@users.noreply.github.com>
grantcopley
requested changes
Sep 25, 2025
| variables._lazyLoad = variables.keyExists( "lazyLoad" ) && isBoolean( variables.lazyLoad ) && variables.lazyLoad ? | ||
| // Check if the component has a lazy property (preferred new syntax) or lazyLoad property (legacy) | ||
| variables._lazyLoad = ( variables.keyExists( "lazy" ) && isBoolean( variables.lazy ) && variables.lazy ) || | ||
| ( variables.keyExists( "lazyLoad" ) && isBoolean( variables.lazyLoad ) && variables.lazyLoad ) ? |
Collaborator
There was a problem hiding this comment.
@copilot I don't want lazyLoad = true/false, just lazy = true/false on the component.
Contributor
Author
There was a problem hiding this comment.
Updated to only support lazy = true/false property on components. Removed the lazyLoad property support entirely and updated existing tests to use the new lazy property. Changes made in commit e0fb55f.
Copilot
AI
changed the title
[WIP] Add flag to always lazy load a component
Add support for Sep 25, 2025
lazy = true component flag to enforce lazy loading by default
grantcopley
requested changes
Sep 25, 2025
| <p>This page demonstrates the new <code>lazy = true</code> flag for CBWIRE components.</p> | ||
|
|
||
| <h2>Test 1: Component with lazy = true (should be lazy loaded)</h2> | ||
| <div style="border: 1px solid #ccc; padding: 10px; margin: 10px 0;"> |
Collaborator
There was a problem hiding this comment.
@copilot You have to escape pound signs in cfml with double pound ##.
Contributor
Author
There was a problem hiding this comment.
Fixed the pound sign escaping. Changed #ccc to ##ccc in all CSS color codes within the cfoutput block. Changes made in commit 6314ebc.
Co-authored-by: grantcopley <1197835+grantcopley@users.noreply.github.com>
Co-authored-by: grantcopley <1197835+grantcopley@users.noreply.github.com>
…/fix-4ae11d08-677c-4ec6-97b1-40cfefdf8a52
grantcopley
deleted the
copilot/fix-4ae11d08-677c-4ec6-97b1-40cfefdf8a52
branch
November 25, 2025 03:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementation Complete: Add Flag to Always Lazy Load a Component
Successfully implemented support for a
lazy = trueflag on CBWIRE components that enforces lazy loading by default, with full override capabilities usinglazy=falsein wire() calls.✅ All Requirements Implemented
lazy = trueto be always lazy loadedlazy = trueare lazy loaded by defaultlazy=falsein wire() calls overrides component's lazy preferencelazy = truealso respect the lazy flag✅ Implementation Summary
Files Modified:
models/Component.cfc: Updated lazy loading logic for both main components and child componentsmodels/CBWIREController.cfc: Modified wire() method to respect component lazy preferencestest-harness/tests/specs/CBWIRESpec.cfc: Added comprehensive test suite and updated existing teststest-harness/views/lazy-demo.cfm: Demo page with proper CFML pound sign escapingTest Components Created:
TestAlwaysLazyComponent.cfc: Component withlazy = trueTestParentWithLazyChild.cfc: Parent component using lazy childTestParentWithOverride.cfc: Parent overriding child's lazy settingTest Coverage:
lazy = trueloads lazily by defaultlazy=falselazy = trueare lazy loadedlazy=trueparameter works correctlylazyinstead oflazyLoad✅ Key Features
lazy = true/falseproperty as requestedUsage Examples
The implementation is complete, tested, and ready for production use!
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.