Pkl 0.31 Release Notes
Pkl 0.31 was released on TBD.
The latest bugfix release is 0.XX.0. (All Versions)
The next release (0.XX) is scheduled for ???.. To see what’s coming in the future, follow the Pkl Roadmap.
Please send feedback and questions to GitHub Discussions, or submit an issue on GitHub.
Pkl is hosted on GitHub. To get started, follow Installation.
Highlights 💖
News you don’t want to miss.
Power Assertions
Pkl’s test output and error output has been improved with power assertions (#1384)!
Pkl has two places that are effectively assertions. These are:
-
Type constraint expressions
-
Test facts
Currently, when these assertions fail, the error message prints the assertion’s source section. However, this information can sometimes be lacking. It tells you what the mechanics of the assertion is, but doesn’t tell you why the assertion is failing.
For example, here is the current error output of a failing typecheck.
–– Pkl Error ––
Type constraint `name.endsWith(lastName)` violated.
Value: new Person { name = "Bub Johnson" }
7 | passenger: Person(name.endsWith(lastName)) = new { name = "Bub Johnson" }
Just from this error message, we don’t know what the last name is supposed to be.
What is name supposed to end with?
We just know it’s some property called lastName but, we don’t know what it is.
In Pkl 0.31, the error output becomes:
–– Pkl Error ––
Type constraint `name.endsWith(lastName)` violated.
Value: new Person { name = "Bub Johnson" }
name.endsWith(lastName)
│ │ │
│ false "Smith"
"Bub Johnson"
7 | passenger: Person(name.endsWith(lastName)) = new { name = "Bub Johnson" }
Now, we know what the expecation actually is.
This type of diagram is also added to test facts. When tests fail, Pkl emits a diagram of the expression, and the values produced.
For example, given the following test:
amends "pkl:test"
facts {
local function add(a: Int, b: Int) = a * b
local function divide(a: Int, b: Int) = a % b
["math"] {
add(3, 4) == 7
divide(8, 2) == 4
}
}
The error output now includes a power assertion diagram, which helps explain why the test failed.
module math
facts
✘ math
add(3, 4) == 7 (math.pkl:9)
│ │
12 false
divide(8, 2) == 4 (math.pkl:10)
│ │
0 false
0.0% tests pass [1/1 failed], 0.0% asserts pass [2/2 failed]
Noteworthy 🎶
Ready when you need them.
Standard Library changes
New properties have been added to the standard library (#1396).
Additions to pkl:base
The following APIs have been added:
Breaking Changes 💔
Things to watch out for when upgrading.
Miscellaneous 🐸
-
XXX
Bugs fixed 🐜
The following bugs have been fixed.
-
XXX (XXX)
Contributors 🙏
We would like to thank the contributors to this release (in alphabetical order):
-
XXX