What's New With 3.1
09/25/2023
New Features
Auto-Include CBWIRE Assets
CBWIRE 3.1 introduces automatic inclusion of styles and scripts, eliminating the need to manually call wireScripts() and wireStyles() in your templates.
// config/ColdBox.cfc
moduleSettings = {
"cbwire" = {
"autoIncludeAssets" = true // Default: true
}
};Previously required manual inclusion:
<!-- Old way - no longer needed -->
<head>
#wireStyles()#
</head>
<body>
<!-- content -->
#wireScripts()#
</body>Now assets are automatically included when components are rendered.
Enhanced Lifecycle Hooks
New onUpdate() and onUpdateProperty() lifecycle methods provide granular control over component updates.
Child Component Refresh
Parent components can now refresh all child components using the new refresh functionality.
UDF Access in Templates
Components can now call CBWIRE User Defined Functions directly from templates, expanding beyond computed properties.
Single File Components Improvements
Enhanced single file component handling with better caching and collision prevention.
Single file components now automatically clear on fwreinit and have improved file name collision handling for high-traffic applications.
Enhanced onMount() Parameters
Support for params as an alias for parameters in onMount() method calls.
Template Helper Access
Templates can now access ColdBox application helpers and module helpers directly.
Reset Methods Enhancement
New resetExcept() method allows resetting all data properties except specified ones.
Enhancements
Performance Improvements
Faster rendering with optimized view caching and lookups
Improved single file component compilation and caching
Better memory management for high-traffic applications
Template Variable Cleanup
Removed unnecessary template variables to prevent collisions
Cleaner template scope with better variable isolation
Improved debugging experience
Child Component Management
Fixed child components not re-rendering on follow-up requests
Better tracking and lifecycle management for nested components
Improved parent-child communication
Bug Fixes
Template Rendering
Fixed HTML comments breaking re-renders: HTML comments in templates no longer interfere with component re-rendering
Fixed child component rendering: Child components now properly re-render on subsequent requests
Single File Components
Fixed file name collisions: Improved handling of SFC file names in high-traffic applications
Automatic cleanup: Compiled SFCs are now properly cleared on
fwreinit
Breaking Changes
This release maintains backward compatibility with existing CBWIRE 3.x applications. The automatic asset inclusion is enabled by default but can be disabled if needed.
Was this helpful?