10 September 2022
Ballerina Team
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.readonly
contextually-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.
SIGTRAP
signal (SIGTRAP
is not available on Windows).onGracefulStop
will result in one call to the handler function that was passed as an argument; the handler functions will be called after calling gracefulStop
on 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: runtime:onGracefulStop(foo);
).BTypeReferenceType
instance. A few existing runtime APIs have been modified to return the BTypeReferenceType
instances.The following standard library and extended library modules now come with new features and improvements:
io
constraint
constraint
standard library package, which provides features to validate the values that have been assigned to Ballerina typeshttp
http
moduleHTTP 201
for POST resourcesimmediateStop()
function for the HTTP listenerwebsocket
graphql
serdes
serdes
standard library module for serializing and deserializing Ballerina anydata
subtypesos
exec()
function to support OS command execution in Ballerinaxmldata
fromXml
and toXml
to perform conversions between XML and map<anydata>
. The toRecord
API is being deprecated by introducing this fromXml
APIrootTag
in the JsonOptions
to configure the name of the XML root element tagrandom
createDecimal()
function to be cryptographically securesql
grpc
grpc:Descriptor
) as a replacement for the existing (grpc:ServiceDescriptor
) annotation. Both annotations are supported now to maintain backward compatibility. The grpc:ServiceDescriptor
will be removed in the future. (Please update the service annotation if stub files are regenerated for the existing gRPC services)kafka
rabbitmq
nats
Here are the major new features and improvements you can find in the developer tools:
bal graph
CLI 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 semver
CLI 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.source
attach point(s) constant, etc.ballerina/constraint
standard library package annotations when generating Ballerina clients and services from the OpenAPI definition.Paste JSON as record
feature 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.
Happy coding!
Cheers, The Ballerina Team