1.0.0-Beta5
July 12, 2024
Last updated
Was this helpful?
July 12, 2024
Last updated
Was this helpful?
BoxLang Betas are released weekly. This is our fifth beta marker. Here are the release notes.
The entire boxlang.json
has now been updated to match the project as much as it can. This ticket introduces a new method on the Configuration
object that the core team and module developers can use to navigate the configuration structures fluently. The navigate()
method produces a BoxLang object, which allows you to navigate in, get keys, cast them, do defaults, and so much more.
Check out our data docs for further information.
The configuration object also stores the original configuration struct from the last loaded boxlang.json. You can navigate it or retrieve it from anywhere within the BoxLang code. This is great for module developers, so they can have any setting they can retrieve later.
We use this methodology everywhere in BoxLang core, so we now expose it as a BIF and member method for strings. The stringBind()
allows you to pass in a string template, and bind it with a map of variables for you as long as it adheres to the binding pattern of: ${key:defaultValue}
You can use it for mail merging, data merging, string templates, and so much more.
We have just started talking about our Attempt class in BoxLang, a Java Optional on Steroids. It allows you to track values and act upon them depending on whether they exists or truthy/falsey. It provides many functional methods to produce fluent DSLs and is easier to work with any attempt at external resources or other things. The core will be moving towards returning attempts whenever it makes sense.
We’ve added more goodies to our BoxLang Java interop, this time around method references and high-order functions. BoxLang already allows you to grab a reference to a UDF or closure as a variable, pass it around, and invoke it.
BL also allows you to grab a reference to a static method from a Box class as well using the ::
notation.
Now, in BoxLang, we’ve elevated Java methods, both instance and static also to be objects you can pass around, invoke, and send into a higher-order function (a function that accepts functions).
When you reference a method on a Java class without the parenthesis (just like our BL examples above), you will get a special Function instance that wraps up the Java method, allowing it to be treated as a function, passed into any argument which is typed as a function, and invoked headlessly.
Here, we capture the static value of the Java String class valueOf()
method from and place it into a variable, where we invoke it.
This example captures the toUpperCase
method from a String instance. Note the method is still bound to the original String instance and, when invoked, will be invoked against that original instance
And finally, here we use a Java method to pass directly in place of a UDF or Closure to a higher order function.
We grab the compare
method from Java’s reverse order comparator and pass it directly into the array sort method in BoxLang, reversing our array! Stay tuned, as more features are coming on Java interop.
Our configuration is now solid leveraging cfconfig and we have now added several configuration items that will be used as defaults for all applications running under BoxLang. You will find this in the boxlang.json
We have introduced two new global interception points that modules can listen to:
onSessionCreated
Session
When a new session is created and registered
onSessionDestroyed
Session
When a session is about to be destroyed
We have now moved internally from Optionals to Attemps in order to have consistency in our APIs. I am sure there are more things to do, but all cache interfaces and operations now rely on BoxLang Attempts.
This is mostly for internal usage, where we can add native Java casting to struct operations to attempts.
The BoxLang Cache now has a localized interception pool so it can also announce events locally and globally to the runtime. This allows you to have interceptors that can listen only at specific caches instead of all caches. We use this for example, to listen when sessions expire in applications:
Which brings about the next ticket:
We have now added the capability to influence the application, request and session timeouts in configuration using the cfconfig standard of a string timespan:
The default timeout for applications in BoxLang is 0
, which means they live forever. If you want to change it, then you will change it at the boxlang.json
level or in the Application.bx/cfc
Please see our docs on for further information.
Sessions are now monitored by cache interceptors to detect removals so as to shutdown the sessions before removal
Combine config settings into a single struct
Allow optional attribute delimiters in ACF tag-in-script syntax
Refactor dump loading of CSS to use caching again
Refactor page pool to be per-mapping
jsessionID is the internal standard for boxlang sessions, move to this instead of cfid
getOrSet
() in the cache should return the object not an optional
BL Compat module should coerce null values to empty string
MSSQL DROP TABLE throws 'The statement must be executed before any results can be obtained'
Adobe Compatibility: Missing support for new java() and new component()
cfinvoke does not support params as attribute-value pairs
If the global runtime `javaLibraryPaths` is already a jar/class location, then use it, else it breaks
allow "var" before CF catch variable in script
ResetSession on the scripting request context was invalidating the new session instead of the old session
Session creation if the default timeout is not a duration, it should treat it as seconds, not milliseconds
Session object was not serializable
Cache was evicting items without reaping
DateTime toString() not accounting for formatter being null
sessionRotate() not copying over old keys due to nullification of keys when invalidating the old session