10 September 2022
We are happy to announce a new release, Ballerina 2201.2.0 (Swan Lake Update 2), the second update release of Ballerina Swan Lake.
[string, T]. Then, the query expression will create a value of type
map<T>. Duplicate keys will be handled similarly to a query expression constructing a table.
xml. This ensures that a query expression as an interpolation works as expected. However, it is not an error for the static type to not be a subtype of the contextually-expected type.
readonlycontextually-expected types. Such query expressions create immutable structural values.
on fail error err). It has now been made optional.
lang.function:call()langlib function has been introduced to call a function dynamically passing a function value and optional argument(s). If the arguments do not match the parameters expected by the function, the function call results in a panic.
More precise explanations are provided in the release note.
This update release comes with multiple new features and improvements in the runtime.
SIGTRAPis not available on Windows).
onGracefulStopwill result in one call to the handler function that was passed as an argument; the handler functions will be called after calling
gracefulStopon all registered listeners in the reverse order of the corresponding calls to
onGracefulStop(e.g., the function foo can be called during the graceful shutdown by registering it as follows:
BTypeReferenceTypeinstance. A few existing runtime APIs have been modified to return the
The following standard library and extended library modules now come with new features and improvements:
constraintstandard library package, which provides features to validate the values that have been assigned to Ballerina types
HTTP 201for POST resources
immediateStop()function for the HTTP listener
serdesstandard library module for serializing and deserializing Ballerina
exec()function to support OS command execution in Ballerina
toXmlto perform conversions between XML and
toRecordAPI is being deprecated by introducing this
JsonOptionsto configure the name of the XML root element tag
createDecimal()function to be cryptographically secure
grpc:Descriptor) as a replacement for the existing (
grpc:ServiceDescriptor) annotation. Both annotations are supported now to maintain backward compatibility. The
grpc:ServiceDescriptorwill be removed in the future. (Please update the service annotation if stub files are regenerated for the existing gRPC services)
Here are the major new features and improvements you can find in the developer tools:
bal graphCLI command, which resolves the dependencies of the current package and prints the dependency graph in the console has been introduced. This produces the textual representation of the dependency graph using the DOT graph description language.
bal semverCLI command has been introduced to validate the Semantic Versioning compatibility of the local package changes against any previously published version(s) in Ballerina Central. The tool is currently capable of listing source code differences (along with its compatibility impact) between the local and any published version and suggesting the new package version based on the compatibility impact of the source code changes.
sourceattach point(s) constant, etc.
ballerina/constraintstandard library package annotations when generating Ballerina clients and services from the OpenAPI definition.
Paste JSON as recordfeature in the Ballerina VSCode extension.
With respect to Code to Cloud features, a notable change is that the base image was updated to
ballerina/jvm-runtime:1.0 based on Alpine 3.15 with the necessary libraries.
We made numerous other changes in this release including many bug fixes to the compiler, runtime, standard library, and developer tools. See the release note for all the details of this release.
We want to extend our sincerest thanks to the Ballerina community for your valuable feedback and support in making Ballerina what it is today. We hope you enjoy this release.
Cheers, The Ballerina Team