1.0.0-Beta14
September 13, 2024
In this release, we are excited to introduce several new features and enhancements aimed at improving functionality and user experience. These updates include the creation of immutable query types, new server keys to aid on CLI tooling, and methods to identify runtime initiation modes.
Additionally, we've added an event announcement for dump rendering to enable better integration with external listeners. Read on to learn more about these features and how they can benefit your workflow.
Code Strong!
New Features
We have now introduced the immutable query type. Any query in BoxLang can become immutable by just calling the toImmutable()
method on it. This will lock the query into read-only mode. Great for multi-threaded operations or just data safety. You can also unlock immutable types via the toMutable()
method.
We have added a new global listener for the language: onBxDump
which allows you to listen to any call to our dump component. This will allow developers to tap into the dumping facilities and intercept the dump calls. We are doing this in order to bring real-time dump facilities to VSCode.
All the arguments from the dump
bif/component will be passed through.
This is a new method in the BoxRuntime
which allows developers or module authors to know if your runtime is in CLI mode or not. The server.boxlang
also contains much more information about the modes you are in:
server.boxlang.cliMode
- True or false if you are in CLI modeserver.boxlang.jarMode
- True or false if running in JAR modeserver.boxlang.runtimeHome
- The runtime home seeded in the runtime
There is a new server.cli
structure that will assist CLI developers. It contains the following data:
server.cli.executionPath
- From what directory was the runtime command called fromserver.cli.command
- The full raw commandline string used by the OS to call the binary + your commandserver.cli.args
- The raw array of arguments the command was called withserver.cli.parsed.options
- A struct of name-value pairs of all the options detected in the CLI arguments.server.cli.parsed.positionals
- An array of positional arguments sent to the CLI
BoxLang will detect and parse the following conditions into the options
struct:
--{name}
- Will crete a key called{name}
with a value oftrue
--!{name}
- Will crete a key called{name}
with a value offalse
--no-{name}
- Will crete a key called{name}
with a value offalse
-{character}
- Shorthands using a single character. The value will betrue
and the key will be the character used. Example:-p
-{characters}
- You can use multi-shorthand characters and each of them will be keys in the struct with a value oftrue
. Example:-abc
will createa=true, b=true, c=true
--{name}=value
- Will create a key called{name}
with the value from the right side of the equals sign.--{name}="value"
- Will create a key called{name}
with the value from the right side of the equals sign and removing the quotes.--{name}='value'
- Will create a key called{name}
with the value from the right side of the equals sign and removing the single quotes
In preparation to the inclusion of CommandBox commands into BoxLang we have also added our CLI utility to assist with argument parsing and detection. We have also encapsulated our CLI tooling in preparation for more in the next betas.
Improvements
Bugs
Last updated