ColdBox HMVC Documentation
DocsSourceSupportTraining
6.x
6.x
  • Introduction
  • Intro
    • Release History
      • What's New With 6.11.0
      • What's New With 6.10.0
      • What's New With 6.9.0
      • What's New With 6.8.2
      • What's New With 6.8.1
      • What's New With 6.8.0
      • What's New With 6.7.0
      • What's New With 6.6.1
      • What's New With 6.6.0
      • What's New With 6.5.x
      • What's New With 6.4.0
      • What's New With 6.3.0
      • What's New With 6.2.x
      • What's New With 6.1.0
      • What's New With 6.0.0
      • Upgrading to ColdBox 6
    • About This Book
    • Author
  • For Newbies
    • 60 Minute Quick Start
      • Installing ColdBox
      • My First ColdBox Application
      • My First Handler & View
      • Linking Events Together
      • Working With Event Handlers
      • Adding A Layout
      • Adding A Model
      • RESTFul Data
      • Next Steps
  • Getting Started
    • Getting Started Guide
    • Installation
    • Conventions
    • Configuration
      • ColdBox.cfc
        • Configuration Directives
          • CacheBox
          • ColdBox
          • Conventions
          • Environments
          • Flash
          • InterceptorSettings
          • Interceptors
          • Layouts
          • LayoutSettings
          • LogBox
          • Modules
          • ModuleSettings
          • Settings
          • WireBox
        • System Settings (Java Properties and Environment Variables)
      • Using Settings
      • Bootstrapper - Application.cfc
  • The Basics
    • Request Context
    • Routing
      • Requirements
        • Rewrite Rules
      • Application Router
      • Routing DSL
        • Routing By Convention
        • Pattern Placeholders
        • Routing Methods
        • Resourceful Routes
        • Named Routes
        • Routing Groups
        • Routing Namespaces
      • Building Routable Links
      • RESTFul Extension Detection
      • HTTP Method Spoofing
      • HTML Base Tag
      • Pathinfo Providers
    • Event Handlers
      • How are events called?
      • Getting & Setting Values
      • Setting Views
      • Relocating
      • Rendering Data
      • Sending Files
      • Interception Methods
        • Pre Advices
        • Post Advices
        • Around Advices
      • Model Integration
        • Model Data Binding
      • HTTP Method Security
      • Implicit Methods
      • Executing Events
      • Executing Routes
      • Viewlets - Reusable Events
      • Event Caching
      • Validation
    • Layouts & Views
      • Views
        • Rendering Views
        • Rendering External Views
        • Rendering With Local Variables
        • Rendering Collections
        • View Caching
        • View Helpers
        • View Events
      • Layouts
        • Basic Layouts
        • Default Layout
        • Nested Layouts
        • Overriding Layouts
        • Layouts From A Module
        • Layout Helpers
        • Layout Events
      • Implicit Layout-View Declarations
      • Helpers UDF's
      • ColdBox Elixir
    • Models
      • Domain Modeling
        • Service Layer
        • Data Layers
        • Book
      • Conventions Location
      • WireBox Binder
      • Super Type Usage Methods
      • Injection DSL
        • ColdBox Namespace
        • CacheBox Namespace
        • EntityService Namespace
        • Executor Namespace
        • Java Namespace
        • LogBox Namespace
        • Models Namespace
        • Provider Namespace
        • WireBox Namespace
      • Object Scopes
      • Coding: Solo Style
        • Datasource
        • Contact.cfc
        • ContactDAO.cfc
        • ContactService.cfc
        • Contacts Handler
      • Coding: ActiveEntity Style
        • ORM
        • Contact.cfc
        • Contacts Handler
        • Views
      • Coding: Virtual Service Layer
        • ORM
        • Contacts.cfc
        • Contacts Handler
        • Views
      • Coding: ORM Scaffolding
        • ORM
        • Contacts.cfc
        • Scaffold
    • Interceptors
      • How do they work?
        • Conventions
      • Interceptor Declaration
      • Interceptor Registration
      • Dynamic Registration
      • Core Interception Points
        • Application Life Cycle Events
        • Object Creating Events
        • Layout-View Events
        • Module Events
        • CacheBox Events
      • Restricting Execution
      • Interceptor Output Buffer
      • Custom Events
        • Configuration Registration
        • Programmatic Registration
        • Listening
        • Announcing Interceptions
      • Unregistering Interceptors
      • Reporting Methods
      • Interceptor Asynchronicity
        • Async Announcements
        • Async Listeners With Join
        • Async Listeners No Join
        • Asynchronous Annotations
  • HMVC
    • Modules
      • Core Modules
      • Locations
      • Parent Configuration
      • Module Layout
        • Changing The Module Layout
      • Module Service
        • Module Lifecycle
        • Module Registration
        • Module Activation
        • Module Unloading
        • Common Methods
        • Loading New Modules
        • Loading A-la-carte Modules
        • Module Events
      • ModuleConfig
        • Public Module Properties
        • The Decorated Variables
        • The configure() Method
        • Module Settings
        • Environment Control
        • Interceptor Events
      • Module Event Executions
      • URL Routing
        • Default Route Execution
        • Module Routes Files
      • Module Async Scheduling
      • Request Context Module Methods
      • Layout and View Renderings
        • Layout/View Discovery
        • Overriding Views
        • Overriding Layouts
        • Default Module Layout
        • Explicit Module Renderings
      • Models
      • Module CF Mappings
      • Module Dependencies
      • Module Helpers
      • Module Bundles
      • Module Inception
  • Testing
    • Testing Quick Start
    • Testing ColdBox Applications
      • Test Harness
      • ColdBox Testing Classes
      • Common Testing Methods
      • Integration Testing
        • Life-Cycle Events
        • Request Setup()
        • The execute() Method
        • HTTP Testing Methods
        • Testing Without Virtual Application
        • Test Annotations
      • Interceptor Testing
      • Model Object Testing
      • Tips & Tricks
  • Digging Deeper
    • Async Programming
      • Async Pipelines & Futures
      • Parallel Computations
      • Executors
      • Scheduled Tasks
    • ColdBox Proxy
      • Getting Started
      • The Base Proxy Object
      • The Event Handlers
        • Distinguishing Request Types
        • RenderData()
      • Proxy Events
      • Standard Return Types
      • Caveats & Gotchas
    • Controller Decorator
    • Flash RAM
      • Flash Storage
      • Using Flash RAM
      • Creating Your Own Flash Scope
    • HTML Helper
    • REST Handler
    • Request Context Decorator
    • Recipes
      • Building REST APIs
      • Application Templates
      • ColdBox Exception Handling
      • Debugging ColdBox Apps
      • Clearing the View Cache
      • Basic HTTP Authentication Interceptor
    • Scheduled Tasks
  • Architecture Concepts
    • What is MVC
    • What is ColdBox
    • How ColdBox Works
    • Testing Concepts
      • Functional Testing
      • Non-Functional Testing
      • Bugs Cost Money
      • Static Testing
      • Dynamic Testing
      • Developer Focus
      • Testing Vocabulary
Powered by GitBook
On this page
  • WireBox Binder & Mapping Objects Rewritten
  • Async Package Performance Upgrades
  • Test Dependency Injection
  • ColdBox Test Matchers
  • More Rendering Improvements
  • Whoops! Keeps Getting Better
  • Release Notes
  • 6.2.0
  • 6.2.1
  • 6.2.2

Was this helpful?

Edit on GitHub
Export as PDF
  1. Intro
  2. Release History

What's New With 6.2.x

Last updated 4 years ago

Was this helpful?

ColdBox 6.2.0 is a minor release with some major improvements in many areas like:

  • Async programming

  • Logging

  • Object creations

  • WireBox Mappings and Binders

WireBox Binder & Mapping Objects Rewritten

This is a major change in the core as we have finally rewritten the WireBox Binder and object Mapping objects to script. This resulted in a 45-50% code reduction for those objects and an impressive 30% speed improvements when creating and processing mappings with the new binder processing optimizations. We analyzed every single line of code on these two objects and we are incredibly satisfied with the initial results.

That's right, we have some async goodness prepared for future versions when dealing with multiple directory mappings and much more.

Async Package Performance Upgrades

We have done more runtime analysis on our asynchronous package and we have optimized the heck out of it using the amazing FusionReactor Profilers! Especially the applyAll() and collection based parallel computing. We reached a point where all of our tests cases where running faster than even native Lucee/Adobe 2021 parallel constructs. Below you can see a snapshot of our test bed creating 1000 transient objects with dependency injections and object populations using async constructs.

You can find our test bed here: https://github.com/ColdBox/coldbox-platform/blob/development/tests/suites/async/performance-parallel-tests.cfm

Just a reminder that the ColdBox async capabilities are all powered by the Java concurrency packages leveraging Completable Futures, Executors and Scheduled Tasks. It is not only true to the Java API but we have made tons of enhancements especially for ColdFusion and its dynamic nature. Check out our docs!

It is also available to ANY ColdFusion application that is NOT running ColdBox. This is achieved by using either of our standalone libraries: WireBox, CacheBox and LogBox.

Test Dependency Injection

This version introduces the capability for you to tag your integration tests with an autowire annotation on the component tag. By adding this annotation, your test object will be inspected and wired with dependencies just like any other WireBox object.

component extends="coldbox.system.testing.BaseTestCase" autowire {

    // DI
    property name="securityService" inject="provider:securityService";
    property name="jwt"             inject="provider:JWTService@cbsecurity";
    property name="cbsecure"        inject="provider:CBSecurity@cbsecurity";
    property name="qb"              inject="provider:QueryBuilder@qb";

    /*********************************** BDD SUITES ***********************************/
    function run(){
        describe( "Authentication Specs", function(){
            beforeEach( function( currentSpec ){
                // Setup as a new ColdBox request for this suite, VERY IMPORTANT. ELSE EVERYTHING LOOKS LIKE THE SAME REQUEST.
                setup();
                // Make sure nothing is logged in to start our calls
                securityService.logout();
                jwt.getTokenStorage().clearAll();
            } );

            story( "I want to authenticate a user via username/password and receive a JWT token", function(){
                given( "a valid username and password", function(){
                    then( "I will be authenticated and will receive the JWT token", function(){
                        // Use a user in the seeded db
                        var event = this.post(
                            "/api/v1/login",
                            {
                                username : variables.testEmployeeEmail,
                                password : variables.testPassword
                            }
                        );
                        var response = event.getPrivateValue( "Response" );
                        expect( response.getError() ).toBeFalse( response.getMessagesString() );
                        expect( response.getData() ).toHaveKey( "token,user" );
                        // debug( response.getData() );
                        var decoded = jwt.decode( response.getData().token );
                        expect( decoded.sub ).toBe( variables.testEmployeeId );
                        expect( decoded.exp ).toBeGTE( dateAdd( "h", 1, decoded.iat ) );
                        expect( response.getData().user.userId ).toBe( variables.testEmployeeId );
                    } );
                } );
                given( "invalid username and password", function(){
                    then( "I will receive a 401 invalid credentials exception ", function(){
                        var event = this.post(
                            "/api/v1/login",
                            { username : "invalid", password : "invalid" }
                        );
                        var response = event.getPrivateValue( "Response" );
                        expect( response.getError() ).toBeTrue();
                        expect( response.getStatusCode() ).toBe( 401 );
                    } );
                } );
            } );

        } );
    }

}

ColdBox Test Matchers

We have also included a new object coldbox.system.testing.CustomMatchers which will register matchers into TestBox when doing integration tests. It will give you the nice ability to expect status codes and validation exceptions on RESTFul Requests via the ColdBox Response object.

  • toHaveStatus()

  • toHaveInvalidData()

var event = this.post(
    "/api/v1/login",
    { username : "invalid", password : "invalid" }
);
var response = event.getPrivateValue( "Response" );
expect( response.getError() ).toBeTrue();
expect( response.getStatusCode() ).toBe( 401 );

var event = this.post(
    "api/v1/timelogs",
    { description : "A nice unit test" }
);
expect( event.getResponse() ).toHaveStatus( 400 );
expect( event.getResponse() ).toHaveInvalidData( "project", "is required" )
expect( event.getResponse() ).toHaveInvalidData( "task", "is required" )
expect( event.getResponse() ).toHaveInvalidData( "user", "is required" )

More Rendering Improvements

Thanks to Dom Watson (@dom_watson) from PresideCMS (@presidecms) for many contributions to help clean up ColdBox view rendering! This release focuses on more performance and memory utilization updates, as well as refactoring external dependencies from pre singleton rendering approaches, which has resulted in more performance gains and lower memory usages on high rendering apps.

Whoops! Keeps Getting Better

We have had tons of updates and requests from our new exception handling experience in ColdBox: Whoops! In this release we tackle CFML core engine files so they can render appropriately, AJAX rendering for exceptions and best of all a huge performance and size boost when dealing with exceptions. Even when dealing with exceptions we want the best and the fastest experience possible for our developers.

The previous approach whoops took was to read and load all the source code of all the templates that caused the exception. You could then navigate them to discover your faults. However, each template could be loaded from 1 to up to 10 times if the stack trace followed it. In this new update we provide source template caching and dynamic runtime injection and highlighting of the source code. This has granted us the following improvements in small test cases (Your improvements could be higher)

Release Notes

6.2.0

Bugs

  • [COLDBOX-936] - ExceptionBean throws exception on weird ORM illegal access collection on scope dump

  • [COLDBOX-937] - Migration to cgi.server_name and server_port did not account for the incoming browser port but the cf service port

  • [COLDBOX-938] - getFullURL() is not accounting for app mappings

  • [COLDBOX-939] - Invalid event handler detection was overriding some event handler beans

  • [COLDBOX-941] - timeUnits had type mismatches when used in async futures' allApply

  • [COLDBOX-948] - Whoops should validate a file exists before trying to present it to the code viewer

New Features

  • [COLDBOX-942] - Add timeout and timeUnit arguments to the allApply() method directly when using Futures

  • [COLDBOX-943] - New global settings: sesBasePath and HtmlBasePath that represent the pathing with no host and protocol

  • [COLDBOX-946] - new request context method getFullPath() which returns the full url with no protocol or host

  • [COLDBOX-957] - New autowire annotation or `variables.autowire` on integration tests so ColdBox will autowire the test with dependencies via WireBox

  • [COLDBOX-958] - Store the test case metadata on ```variables.metadata``` so it can be reused by any helper within test operations

  • [COLDBOX-959] - New ColdBox CustomMatchers object found at coldbox.system.testing.CustomMatchers which is loaded on all tests

Improvements

  • [COLDBOX-895] - migrating usage of cgi.http_host to cgi.server_name due to inconsistencies with proxy requests that affects caching and many other features

  • [COLDBOX-931] - ProcessStackTrace() Creates Many Nested Spans, improved output HTML

  • [COLDBOX-933] - Improved safety reset for base test cases

  • [COLDBOX-940] - Performance optimizations for entire async package

  • [COLDBOX-944] - Refactored cgi server and port detections to improve testability and single responsibiilty principles

  • [COLDBOX-945] - Event caching now bases off the multi host key from the event.getSESBaseURL() to improve consistencies and single responsibility

  • [COLDBOX-947] - encapsulate processEception() from the bootstrap to within the exception objects

  • [COLDBOX-949] - better exception tracking for interceptor getProperty() calls that don't exist

  • [COLDBOX-952] - RendererEncapsulator: use of filter method for rendererVariables is inefficient, migrated to less fluent but more performant approach.

  • [COLDBOX-953] - Update DateFormat Mask to use lowercase "d" to be compatible with ACF2021

  • [COLDBOX-954] - Refactor viewsHelperRef and layoutsHelperRef to local renderer variables instead of settings, which resulted in even better speed improvements

  • [COLDBOX-955] - If in an Ajax request and an exception occurs using Whoops the view is unusable

  • [COLDBOX-956] - Whoops loads multiple files into the DOM for the templates in the stacktrace causing major slowdownsa

Improvements

  • [COLDBOX-945] - Event caching now bases off the multi host key from the event.getSESBaseURL() to improve consistencies and single responsibility

  • [COLDBOX-953] - Update DateFormat Mask to use lowercase "d" to be compatible with ACF2021

Bugs

  • [LOGBOX-56] - Missing line break on file appender control string

New Features

  • [LOGBOX-57] - new shutdown() method to process graceful shutdown of LogBox

  • [LOGBOX-58] - New logbox config onShutdown() callback, which is called when LogBox has been shutdown

  • [LOGBOX-59] - New shutdown() method can be now used in appenders that will be called when LogBox is shutdown

Bugs

  • [WIREBOX-99] - parameter [binder] to function [process] is required but was not passed in When setting coldbox.autoMap to false and choosing either method of mapping a directory:

  • [WIREBOX-102] - ACF incompats with future combinations due to dumb elvis operator bug

New Features

  • [WIREBOX-98] - Pass the current injector to the binder's life-cycle methods: onShutdown(), onLoad()

  • [WIREBOX-100] - Create a processEagerInits() so it can process them at wirebox load

  • [WIREBOX-101] - Complete rewrite of the Mapping object to script and performance optimizations

  • [WIREBOX-103] - Complete rewrite of the WireBox Binder to script and optimizations

  • [WIREBOX-104] - New WireBox config: autoProcessMappings which can be used to auto process metadata inspections on startup.

6.2.1

Bugs

  • [COLDBOX-960] - jsonPayloadToRC is not working in 6.2 update

  • [COLDBOX-961] - Random bug dealing with integration testing when dealing with routes vs direct events

Bugs

  • [WIREBOX-105] - Regression: Remove default dsl of "" from initArg() and addDIConstructorArgument()

  • [WIREBOX-106] - Regression: parentInjector() stopRecursions() collision with internal property name

6.2.2

Bugs

  • [COLDBOX-963] - Use Java URI for more resiliant getFullURL to avoid double slashes

Bugs

  • [WIREBOX-107] - wirebox metadata caching broken

  • [WIREBOX-109] - Standalone event pool interceptData -> data not backwards compat

Improvements

  • [WIREBOX-108] - WireBox not handling cachebox, logbox, and asyncmanager instances properly

Improvements

  • [CACHEBOX-65] - CacheBox not handling wirebox, logbox, and asynmanager instances properly

Improvements

  • [LOGBOX-60] - Ignore interrupted exceptions from appenders' scheduler pool

Original Size: 218.54 KB New Size: 145.22 KB About 30-40% reduction on size depending on repetition of the templates

Original Rendering Speed: 288ms New Rendering Speed: 76ms About 74-80% rendering improvements

Fusion Reactor Profiler
Async Test Results
Whoops Improvements
:fire:
:fire: