Skip to content

1.5

Compare
Choose a tag to compare
@github-actions github-actions released this 26 Jun 10:18
· 5 commits to main since this release

This release finishes the work started in jaq 1.4 towards making jaq being able to process non-JSON values. In particular, a vast majority the filters in jaq's core library can now process any kind of value that satisfies certain conditions; see the corresponding PR. Currently, this is mostly interesting for people who want to use jaq as an API.

Compilation errors

Since about two months, the compilation of jaq via cargo install jaq failed. This happened because a dependency of jaq called ariadne (responsible for printing compilation errors in jaq) broke semantic versioning. Unfortunately, despite the issue being known upstream, at the time of writing there has been no action towards resolving this problem. This put jaq in an awkward position and was somewhat ironic: the library responsible for reporting compilation errors caused compilation errors.

Eventually, I decided to resolve this problem by replacing ariadne. After having evaluated a number of alternative code span printing libraries, such as miette and codespan-reporting, I wrote a new library called codesnake. Starting from this release, codesnake is in charge for formatting code that is printed during compilation errors in jaq. One direct benefit of this change is that compilation errors are now also colored on the jaq playground.

At this point, I would like to thank @zesterer for having created and maintained ariadne. Without it, the error reporting in jaq would not be close to what it is today.

Smaller changes

This release corrects escaping of special characters in strings; in particular, newlines tabs, and quotes (") were not correctly escaped. For example, for the filter "\n" | tojson, jaq 1.4 yields "\"\n\"", whereas jaq 1.5 yields "\"\\n\"" (the difference being an additional backslash before n). Among others, this shows up in string interpolation ("\(.)"), tostring, and tojson.

Apart from ariadne, this release also removes another dependency, namely colored_json. This makes it possible to print output values without first converting them to a format that colored_json can interpret (serde_json::Value). This should favourably influence the performance of printing output values. In the long run, this will allow to remove jaq's dependency on serde, further contributing to shorter compilation times and smaller binary size.

Furthermore, when using --color never, compilation errors are now also printed without colors (#177).

Full Changelog: v1.4.0...v1.5.0