1.0.0-Beta2
June 21, 2024
Last updated
Was this helpful?
June 21, 2024
Last updated
Was this helpful?
BoxLang Betas are released weekly. This is our second beta marker. Here are the release notes.
Writedump
expanded collapsed support
Writedump
top
support
listdeleteAt
returns a list with multiple delimiters as a list with whole delimiters
StructNew
with localeSensitive
flag throws error
structKeyTranslate
returns void
StructGet
does not create struct when missing
StructFindValue
returning null owner
no named applications not auto creating name
application listener requests interception points not registered
ambiguous if statements when not using curly braces
this.javasettings
not expanding / to correct pathing
this.javasettings
ignores paths to actual jars and classes
cfdirectory
fails on centos, converting datetime
dateAdd
() modifies its argument!
This will collaborate several new BIFs and components:
ArgonHash
: Returns a secure input hash of the given string using the Argon2 hashing algorithm. ( Alias: GenerateArgon2Hash
)
ArgonVerify
: Performs a Argon2 verification on the given string against the hashed value. ( Alias: Argon2CheckHash
)
BCryptHash
: Returns a secure input hash of the given string using the BCrypt hashing algorithm.( Alias: GenerateBCryptHash
)
BCryptVerify
: Performs a BCrypt verification on the given string against the hashed value. ( Alias: BCryptCheckHash
)
SCryptHash
: Returns a secure input hash of the given string using the SCrypt hashing algorithm.( Alias: GenerateSCryptHash
)
SCryptVerify
: Performs a SCrypt verification on the given string against the hashed value. ( Alias: SCryptCheckHash
)
GeneratePBKDFKey
: Generates a PDFK key from the given password and salt.
You can now listen to when the engine flushes the output buffer and intercepts it. This will allow you to collaborate content to the buffer before it's sent to the output destination. The data received is:
context
- The execution context
output
- The string output to send to the buffer. This can be text or HTML
This is one of our biggest tickets for this release to continue to close the Java interop cycle in BoxLang. This will allow BoxLang lambdas/closures/udfs to be coerced to Java Functional Interfaces at runtime. This means that ANY Java library that offers functional interfaces (lambdas) can be used natively in BoxLang. This means that using streams, completable futures, and Java lambdas are now native to BoxLang.
This can also be used to tap into high concurrency constructs in Java. You can combine the usage of BoxLang pure functions (lambdas) or context-aware closures.
All BoxLang arrays have native stream support, and you get native parallel support as well.
Our truthy/false evaluations for arrays, structs, queries, Java lists, and collections are complete.
This is inspired by Java Optionals for BoxLang. We have introduced a new class called Attempt()
, which allows you to create fluent and functional code to work with values or delay attempts at code execution. Then, you can interact with the result of your attempt using our functional methods.
Another important aspect of attempts is that they evaluate that the seeded value is not null
but also truthy. This means you can use it to evaluate that the value is truthy or false, not only null. You can also pass in a closure/lambda to be the value and once you request to evaluate the result, it will do it asynchronously and delayed.
Here are the current functions available to you in this beta. There are more coming to make it more fluent.
get():any
- Get the value or throw an exception if null or falsey
empty():Attempt
- Produce a new empty attempt
of( value ):Attempt
- Produce a new attempt with the passed value
ofFunction( context, function/closure/lambda ):Attempt
- Produce a new attempt with a closure or lambda.
isEmpty():boolean
- Is the value falsey or null
isPresent():boolean
- Is the value present
ifPresent( consumer ):Attempt
- Call the consumer lambda/closure if the value is present
ifPresentOrElse( consumer, action ):Attempt
- Call the consumer lambda/closure if present or the action lambda/closure if not.
ifEmpty( consumer ):Attempt
- Call the consumer if the value is not present
or( supplier ):Attempt
- If the value is present it returns itself, if not, it calls the supplier closure/lambda to produce a new attempt.
orElse( other ):any
- Get the value if present, or otherwise return the other value passed
orElseGet( supplier ):any
- Get the value if present, otherwise call the supplier closure/lambda to produce the value you want to return.
map( mapper ): Attempt
- Maps the value of the attempt if it exists, else returns the same attempt with no value.
filter( predicate )
- If the value is present it will call your predicate closure/lambda so you can run tests on the value. If the return is true it will return the same attempt, else an empty attempt.
orThrow():any
- Returns the value if it exists or throws an exception
orThrow( message ):any
- Returns the value if it exists or throws an exception with your custom message
orThrow( exception ):any
- Returns the value if it exists or throws your custom exception
stream():Stream
- If the value exists returns a stream with the value else an empty stream
toString():String
- Gives you a string representation of the value
isValid():Boolean
- If the value is present it will try to validate it with the registered validation schemas, if any.
toBeValid( closure or lambda ):Attempt
- This allows you to register a lambda/closure to validate the data if any. When calling isValid()
it will call this function if registered.
toBeBetween( min, max ):Attempt
- This allows you to register a min and max numerical values to test the value. It must be in range to be valid.
toMatchRegex( regex ):Attempt
- This allows you to register a regular expression to match against the value.
This was something we always wanted to do. This allows module and BoxLang developers to contribute member methods to ANY BoxLang class. So now, you can serialize any Class to JSON natively using our BoxLang Class to JSON native serialization. Let's build a Person
class:
As you can see, we have introduced a few annotations for JSON serialization based on our experience with the ColdBox mementifier project. You can tag properties to be excluded from serialization using the jsonExclude
annotation. You can exclude a list of properties from the class annotation as well. Now, let's get some JSON data out using the toJSON()
member function, which delegates it to the jsonSerialize()
bif.
This will allow framework developers to collaborate with first-class methods in any BoxLang class.
This is an internal convenience method for creating BoxLang arrays from strings.
BoxLang is an event-driven language. It announces tons of events during the software life cycle. You can now listen to any global event via the new BoxRegisterInterceptor()
bif. This will allow you to register classes, lambdas, or closures.
However, BoxLang also offers interceptors at the request level via the internal application listener. This means that you can listen to a specific request life-cycle by using the boxRegisterRequestInterceptor()
bif.
More work towards compatibility is completed.
This has been a heached in current CFML engines. We now detect what you send in to the writeOutput() or echo()
commands and we will convert them to string if they are complex objects or classes.
We now support all encryption and decryption algorithms natively in BoxLang without ANY third-party library. Secure by default and with 3 BIFS created for this. Supported algorithms:
AES
ARCFOUR
Blowfish
ChaCha20
DES
DESede
HmacMD5
HmacSHA1
HmacSHA224
HmacSHA256
HmacSHA384
HmacSHA512
HmacSHA3-224
HmacSHA3-256
HmacSHA3-384
HmacSHA3-512
`toString
` not formatting doubles correctly
Attempt to cast instead of expecting strings inside `isValid
`
Regression on JSON serialization of box classes with JSON exclude annotations
We have created the bx-password-encrypt
module so you can use it for password encryption. Find out much more here: