Releases: google/jsonnet
v0.22.0-rc1
What's Changed
-
Language changes, new features, etc
- Bitwise operation arguments are now limited to the "safe-integer" range (#1217, #1240)
- Numbers in Jsonnet code can now be written with underscore used to separate groups of digits (e.g.,
1_500_000) (#1160) - New function
std.isNull(#1237) - RapidYAML updated to v0.10.0
- Man pages are built automatically from the CLI
--helpoutput (#1206) - The
jsonnetfmtCLI now prints the names of any input files that are changed or not cleanly formatted, when running in--testor--in-placemodes (#1303) - The
jsonnetCLI now knows a flag--no-trailing-newline- this disables the final newline that is normally included in the output of any Jsonnet evaluation. This option is also added to the Jsonnet API (see doc comments inlibjsonnet.h,libjsonnet++.h) (#1283)
-
Bug fixes:
- Function
std.objectRemoveKeyhas been re-implemented to fix several bugs and unexpected behaviours (#1269) - Parser now has an explicit recursion depth limit.
- Shift operations (
<<,>>) implementation now avoids undefined behaviour. - Multiple bugs in
std.parseYamlhave been fixed (#1148, #1292, #1293) - Built-in functions now correctly respect named arguments (#385, #1299)
- Built-in functions can now be passed to
std.makeArray(if they are type-compatible) (#511, #1299) std.flatMapnow has better type checking of its arguments (#1226)
- Function
-
Build systems, testing, CI, internal:
- CMake build configuration has been largely rewritten. It requires CMake 3.15 or greater.
- The plain Makefile build has also be somewhat rewritten.
- Bazel WORKSPACE config has been removed; bzlmod support is now required.
- Publishing website updates is now easier, with a GitHub Actions workflow to rebuild the site whenever master is updated.
- Pre-built Python binary wheels now use the Python Limited API and produce
abi3compatible wheels, improving compatibility with new Python versions (#1289)
Full commit history: v0.21.0...v0.22.0-rc1
New Contributors
- @kirisky made their first contribution in #1263
- @benjaminp made their first contribution in #1260
- @kalvdans made their first contribution in #1252
- @melosa11 made their first contribution in #1258
- @seizethedave made their first contribution in #1160
- @shrred26 made their first contribution in #1237
- @garyg1 made their first contribution in #1255
- @He-Pin made their first contribution in #1241
- @simonff made their first contribution in #1261
- @04cb made their first contribution in #1297
Full Changelog: v0.21.0...v0.22.0-rc1
v0.21.0
A release, after (slightly over) 2 years since v0.20.0.
A corresponding PyPI package is published at: https://pypi.org/project/jsonnet/0.21.0/
What's Changed since v0.20.0
Bug fixes
- std.all, std.any - had incorrect error reporting (#1101)
- std.parseYaml - RapidYAML updated to version 0.5.0; fixes various details (#942, #1014, #1050)
- Printed number output is now independent of global system locale (#722)
- UTF-8 input representing Unicode characters outside the Basic Multilingual Plane were not decoded correctly (#1181)
- Field visibility is now inherited as expected in objects constructed by object-comprehension expressions (#1111) [this was already the case in go-jsonnet, now fixed in C++ jsonnet]
- Range checks on bitwise operations, and arithmetic shifts are now limited to the integer-safe range (Jsonnet numbers are IEEE double precision floating point, so they can safely represent integers from -2^53 to 2^53).
- [Windows] On Windows, backslash is now supported as a directory separator (in imports)
- [go-jsonnet] YAML streams were incorrectly detected for some inputs to parseYAML (go-jsonnet/#673)
- [go-jsonnet] Internal error in conversion of native functions results to numbers (go-jsonnet/#752)
Language changes
- Array slices can now have negative start and/or end indexes; these are now wrapped-around (similar behaviour to Python).
- Multiline text blocks can now start with
|||-to cause a trailing newline to be trimmed. (#289)
New standard library functionality
- std.contains
- std.objectRemoveKey
- std.remove
- std.removeAt
- std.flattenDeepArray
- std.minArray
- std.maxArray
- std.avg
- std.isEven
- std.isOdd
- std.isInteger
- std.isDecimal
- std.atan2
- std.hypot
- std.pi (constant)
- std.deg2rad
- std.rad2deg
- std.log2
- std.log10
- std.equalsIgnoreCase
- std.trim
- [go-jsonnet only] std.sha1
- [go-jsonnet only] std.sha256
- [go-jsonnet only] std.sha512
- [go-jsonnet only] std.sha3
- [go-jsonnet only] std.manifestYamlDoc is now implemented in native Go
- [go-jsonnet only] std.escapeStringJson is now implemented in native Go
- [go-jsonnet only] std.splitLimitR is now implemented in native Go
Build & dependency changes
- Bazel build now uses MODULE.bazel (bzlmod), and the WORKSPACE file has been removed. bzlmod is the default in Bazel 8 and beyond, and is supported in Bazel 6 and beyond.
- Pin Bazel to 7.5.0 when building directly: #1220
- [C++ jsonnet] Python build should now work on Windows / MSVC
- [C++ jsonnet] Bazel build now uses rules_python
- [C++ jsonnet] RapidYAML updated to 0.5.0
- [go-jsonnet] The formatter package now provides FormatNode() and SnippetToRawAST() functions (go-jsonnet/#710)
- [go-jsonnet] golang.org/x/crypto updated from 0.17.0 to 0.33.0
- PyPI packages are now published direct from GitHub Actions and come with publisher attestations.
- Python wheel packages are built for Windows, Linux and MacOS.
New Contributors
- @toge made their first contribution in #1076
- @netomi made their first contribution in #1073
- @deepgoel17 made their first contribution in #1074
- @mortenmj made their first contribution in #1083
- @bitmaybewise made their first contribution in #1082
- @osher made their first contribution in #1095
- @fedya-at-db made their first contribution in #1011
- @rudo-thomas made their first contribution in #1103
- @podsvirov made their first contribution in #1112
- @ashi009 made their first contribution in #1102
- @johnbartholomew made their first contribution in #1127
- @pmorch made their first contribution in #943
- @worrycare made their first contribution in #1146
- @itchyny made their first contribution in #1149
- @eduardosm made their first contribution in #1156
- @olpa made their first contribution in #1176
- @danipozo made their first contribution in #1150
- @r-barnes made their first contribution in #1161
- @rben01 made their first contribution in #1187
- @vergenzt made their first contribution in #1175
- @daichifukui made their first contribution in #1224
- @thevilledev made their first contribution in #1217
Full Changelog: v0.20.0...v0.21.0
v0.21.0-rc2
v0.21.0-rc1
This is the first release candidate for v0.21.0. Since this is the first release for jsonnet for nearly 2 years, and since the build systems and packaging tools have changed somewhat since the last release, this release candidate is being published first to give an opportunity for jsonnet users to report any major build breakage or other problems that would make the release fundamentally unusable.
A corresponding PyPI package is published at: https://pypi.org/project/jsonnet/0.21.0rc1/
What's Changed
Bug fixes
- std.all, std.any - had incorrect error reporting (#1101)
- std.parseYaml - RapidYAML updated to version 0.5.0; fixes various details (#942, #1014, #1050)
- Printed number output is now independent of global system locale (#722)
- UTF-8 input representing Unicode characters outside the Basic Multilingual Plane were not decoded correctly (#1181)
- Field visibility is now inherited as expected in objects constructed by object-comprehension expressions (#1111) [this was already the case in go-jsonnet, now fixed in C++ jsonnet]
- [Windows] On Windows, backslash is now supported as a directory separator (in imports)
- [go-jsonnet] YAML streams were incorrectly detected for some inputs to parseYAML (go-jsonnet/#673)
- [go-jsonnet] Internal error in conversion of native functions results to numbers (go-jsonnet/#752)
Language changes
- Array slices can now have negative start and/or end indexes; these are now wrapped-around (similar behaviour to Python).
- Multiline text blocks can now start with
|||-to cause a trailing newline to be trimmed. (#289)
New standard library functionality
- std.contains
- std.objectRemoveKey
- std.remove
- std.removeAt
- std.flattenDeepArray
- std.minArray
- std.maxArray
- std.avg
- std.isEven
- std.isOdd
- std.isInteger
- std.isDecimal
- std.atan2
- std.hypot
- std.pi (constant)
- std.deg2rad
- std.rad2deg
- std.log2
- std.log10
- std.equalsIgnoreCase
- std.trim
- [go-jsonnet only] std.sha1
- [go-jsonnet only] std.sha256
- [go-jsonnet only] std.sha512
- [go-jsonnet only] std.sha3
- [go-jsonnet only] std.manifestYamlDoc is now implemented in native Go
- [go-jsonnet only] std.escapeStringJson is now implemented in native Go
- [go-jsonnet only] std.splitLimitR is now implemented in native Go
Build & dependency changes
- Bazel build now has a MODULE.bazel for bzlmod compatibility.
- [C++ jsonnet] Python build should now work on Windows / MSVC
- [C++ jsonnet] Bazel build now uses rules_python
- [C++ jsonnet] RapidYAML updated to 0.5.0
- [go-jsonnet] The formatter package now provides FormatNode() and SnippetToRawAST() functions (go-jsonnet/#710)
- [go-jsonnet] golang.org/x/crypto updated from 0.17.0 to 0.33.0
- PyPI packages are now published direct from GitHub Actions and come with publisher attestations.
- Python wheel packages are built for some environments.
New Contributors
- @toge made their first contribution in #1076
- @netomi made their first contribution in #1073
- @deepgoel17 made their first contribution in #1074
- @mortenmj made their first contribution in #1083
- @bitmaybewise made their first contribution in #1082
- @osher made their first contribution in #1095
- @fedya-at-db made their first contribution in #1011
- @rudo-thomas made their first contribution in #1103
- @podsvirov made their first contribution in #1112
- @ashi009 made their first contribution in #1102
- @johnbartholomew made their first contribution in #1127
- @pmorch made their first contribution in #943
- @worrycare made their first contribution in #1146
- @itchyny made their first contribution in #1149
- @eduardosm made their first contribution in #1156
- @olpa made their first contribution in #1176
- @danipozo made their first contribution in #1150
- @r-barnes made their first contribution in #1161
- @rben01 made their first contribution in #1187
- @vergenzt made their first contribution in #1175
Full Commit list: v0.20.0...v0.21.0-rc1
v0.20.0
Bug fix
This release has a bug fix for std.member on strings (google/go-jsonnet#656)
Standard library additions
std.escapeStringXMLstd.sumstd.xorstd.xnorstd.isEmptystd.roundstd.objectKeysValues(convert an object to a list of pairs)std.objectKeysValuesAll
jsonnet-go specific updates:
jsonnet-deps and jsonnet-lint are now included in releases
v0.19.1
The previous v0.19.0 release had a small change in the C bindings to allow importbin to function, but missing from the release notes was mention of the fact that the Python bindings had also changed in a similar way - to require the content of the file to be provided as a bytes type instead of a str. To convert from str to bytes, simply call .encode() on the str.
In order to write Python code that works for both Jsonnet versions, the Jsonnet version is now provided as a field of the _jsonnet module, which allows writing code like the following:
import _jsonnet
import semver
import_returns_bytes = semver.compare(getattr(_jsonnet, 'version', 'v0.18.0')[1:], '0.18.0') > 0
def no_nl_eof(directory, rel):
if import_returns_bytes:
return "foo.jsonnet", b"42"
else:
return "foo.jsonnet", "42"
_jsonnet.evaluate_snippet("test.jsonnet", "{\nlocal foo = import 'foo.jsonnet',\n \n 'bar': foo\n }\n", import_callback=no_nl_eof)
This release also fixes an off-by-one truncation error in the import callback logic of the Python bindings introduced in the previous release. This was only noticeable if the imported file had no trailing \n, or if you were using importbin with a Python import callback.
v0.19.0
Language
- importbin feature for loading binary files
Tooling
-
In order to support importbin, it was necessary to change the C API for import callbacks so that
they can return arbitrary binary blobs (that can contain \0) as opposed to just strings. This
change is not binary compatible with previous versions of libjsonnet. If you build against
libjsonnet.h and you use import callbacks then you will have to make a small adjustment to your
code. -
The emscripten build rules are now gone.
-
Fixed memory leak in libjsonnet++.cpp
-
Fixed lack of jsonnet_realloc in Go C bindings
-
There are many more native implementations of library functions on the Go side, resulting in better
performance for Jsonnet code calling those library functions.
Standard library
- std.all
- std.any
- std.split and std.splitLimit support multi-character split strings
- std.splitLimitR
v0.18.0
WASM
- The Jsonnet website now uses a WASM build of go-jsonnet for its online demos instead of an emscripten build of the C++ implementation. This is part of the ongoing migration towards go-jsonnet and away from C++ Jsonnet.
Language
- Unicode characters outside the "basic multilingual plane" (i.e. beyond the first 64k of them) now supported in unicode escapes in string literals that use unicode surrogate pairs.
Tooling
- Formatter now strips excess newlines after a comment at the end of a file.
Standard library
- Performance improvement to
std.stripChars - New:
std.objectGetOrDefaultandstd.objectGetOrDefaultAll - New:
quote_keysparameter forstd.manifestYamlDoc - New:
std.manifestToml - New:
std.manifestJsonMinified - New:
std.parseYaml
v0.17.0
Language
- Operator
<now works on arrays and performs lexicographic comparison. - New stdlib functions
std.objectValuesandstd.objectValuesAllfor getting an array on field values. - Bitshift by negative value is now an error (previously the behavior was inconsistent).
Go implementation
- New tool available:
jsonnet-lintwhich automatically finds common problems in Jsonnet programs. - New tool available:
jsonnet-depswhich finds all transitive dependencies. - Fixed multiple issues with stack traces, which sometimes resulted in missing or confusing stack trace entries.
- Fixed handling of object locals in object comprehensions.
- Added missing convenience functions to C and Python bindings. They should be now 100% complete.
- Python bindings no longer hold GIL during evaluation of Jsonnet code.
std.manifestJsonExis now much faster.- Strings are now supported in
std.flatMap(in addition to arrays). - Improved Go library API: more consitent handling of paths. We no longer treat fake names for ad hoc snippets or extvars as paths. Function family
EvaluateSnippet*is now deprecated in favor ofEvaluateAnonymousSnippet*orEvaluateFile*. - When using bazel, it is possible now to use
go_repositoryrule for go-jsonnet.
C++ implementation
- Python bindings no longer hold GIL during evaluation of Jsonnet code.
Docs
- New language reference is available at https://jsonnet.org/ref/language.html.
- Fixed multiple mistakes in the formal spec.
- Fixed a mistake in the documentation for
std.rstripChars - Added documentation for
std.slice.
Development and Internals
- The shared test suite allows specifying an overriding directory for test results (useful for error messages).
- Added a mechanism to C++ interpreter to call normal Jsonnet functions in the implementation of builtin operations (currently it's used for implementing array comparison).
- The
tests.shscript for go-jsonnet no longer refreshes cpp-jsonnet submodule. - Added a separate script for updating cpp-jsonnet, which automatically regenerates stdlib.
v0.16.0
Language
- It is now allowed to have positional parameters after named ones
Interpreter (Go)
- New
jsonnetfmtimplementation in Go was added. - New formatter library in Go was added.
- It is now possible to install Python package
gojsonnetusing pip. It is a source package, so a reasonably recent Go toolchain is required to install it.
Interpreter (C++)
- Shifting (
<<and>>) by negative exponent is a runtime error now. - Some improvements to error messages.
- Python bindings now support adding multiple jpathdirs.
- CMake uses CMAKE_CURRENT_SOURCE_DIR instead of CMAKE_SOURCE_DIR, which makes it easier to include Jsonnet in another project.