What's New With 3.2
12/20/2023
New Features
Auto-populate Data Properties
CBWIRE 3.2 introduces automatic data property population when onMount() isn't defined. This streamlines component development by reducing boilerplate code for simple components.
// wires/SimpleProfile.cfc
component extends="cbwire.models.Component" {
// No need to define onMount() - data properties are auto-populated
data = {
"name" = "",
"email" = "",
"bio" = ""
};
function updateProfile() {
// Save profile logic
saveUserProfile(data);
}
}Previously, you needed to explicitly define onMount() to ensure data properties were available. Now, CBWIRE automatically handles this initialization for you when passing parameters to components without an onMount() method.
Module-Specific Component Loading
Support for wire("MyComponent@module") calls enables loading components from specific modules, improving organization in complex applications.
Browser Event Dispatching
CBWIRE 3.2 adds support for dispatching browser events using the new dispatch() method, enabling better integration with JavaScript frameworks and third-party libraries.
Enhancements
Improved Component Initialization
Streamlined data property setup for components without custom initialization logic
Reduced boilerplate code requirements for simple components
Better parameter handling with type validation for security
Module System Integration
Enhanced module loading capabilities with
@modulesyntaxSupport for nested folders within modules
Better organization for large applications with multiple modules
Seamless integration with existing ColdBox module architecture
Template Access Improvements
Direct access to ColdBox event object in templates via
eventvariableAbility to call event methods directly from templates
Enhanced integration between CBWIRE and ColdBox framework
Breaking Changes
This release maintains backward compatibility with existing CBWIRE 3.x applications. No breaking changes were introduced in version 3.2.
Contributors
Special thanks to Michael Rigsby for contributing the auto-populate data properties feature and module-specific component loading functionality.
Was this helpful?