v0.15.0-alpha.2
Changes which may break some users are marked below with: ⚠️
Evaluator
self experiment
The self experiment enables a new “self” predeclared identifier, which refers to the innermost surrounding struct or list, or the top level if none exist.
Once a module’s language.version targets v0.15.0, this can be enabled via the file attribute @experiment(self). The introduction of a new predeclared identifier should be a fully backwards compatible change. The LSP also adds support for the self experiment.
For more information, see the proposal on GitHub and the spec change patch.
Other changes
⚠️ With its proposal accepted, the keepvalidators experiment is now stable, meaning that CUE_EXPERIMENT=keepvalidators is always enabled.
With its proposal accepted, the structcmp experiment is now stable with language.version at v0.15.0 or later, meaning that the @experiment(structcmp) attribute is unnecessary as it’s always enabled.
The evaluator now shows all user errors created with the error builtin when they can be related to a disjunction failure. Previously, the evaluator would try to only show user errors directly part of a disjunction error, but that caused too many omissions.
Fix a regression introduced in v0.12.0 where incomplete errors were not being handled consistently if they directly involved the top-level value.
cmd/cue
A new cue help experiments command is introduced to document all available per-file and global experiments.
Fix a regression introduced in v0.9.0 where loading a qualified pattern like ./...:pkgname no longer filtered files based on the package name given.
LSP
Support is added for standalone CUE files, meaning any CUE file which is not part of a package inside a module. For example, a CUE file without a package declaration, or a CUE file outside of any CUE module.
Encodings
The YAML library in the archived Go module gopkg.in/yaml.v3 has been replaced by go.yaml.in/yaml/v3, an active fork now maintained by the YAML organization.
cue exp gengotypes is improved to handle more edge cases with CUE package imports which could result in broken Go code.
Go API
cue/ast.StringLabelNeedsQuoting determines whether a string label needs to be quoted when used in CUE syntax.
cue/ast.NewStringLabel creates an ast.Label as either an unquoted identifier or a quoted string, depending on whether the string label needs quoting.
⚠️ cue/build.Instance.Match is removed, given that it was never set to any value at any point since it was added.
All changes
67 changes since v0.15.0-alpha.1by area
all3
allrun cuetxtar garbage collectionallconsistently split test table structsallswap len([]rune(s)) for utf8.RuneCountInString(s)
cmd11
cmd/cue/cmdaliascue help experimentcmd/cueadd a test case for the recent:pkgnameCLI argument regressioncmd/cuesimplify when printing imported CUE schemascmd/cueremove debug print inget gocmd/cueremove the last use ofshin testscriptscmd/cueinclude global experiments in experiment helpcmd/cueadded cue help experiments commandcmd/cuetest the handling of interrupt signalscmd/cuetreat top-level incomplete errors consistentlycmd/cueadd test for issue 4079 and 4029cmd/cueadd test for issue 4005
cue21
cue/astrename NewLabel to NewStringLabelcue/buildremove the Instance.Match field, which was never setcue/literaluse Form.tripleQuote when quoting a stringcue/astremove commented out bits of codecue/testdataadd a test case for quoting paths in evaluator errorscue/formatremove unnecessary IsDefOrHidden checkcue/astadd StringLabelNeedsQuotingcue/statsuseResolveDepin arithmeticcue/testdata/basicrewriteuse consistent spelling for "diff/explanation"cue/parseruse more robust logic for detecting the end of an interpolationcue/parseradd test case for string interpolation edge casecue/scannerdocument how interpolations workcue/asttweak ParseImportPath to treat:pkgnameas.:pkgnamecue/loadrespect package qualifiers when matching wildcard packagescue/loaderadd test for issue 4110cueadd test for issue 4093cue/astintroduce NewLabel helper for regular fieldscue/loadadd test case for the fixed issue 741cuededuplicate work from adt.Vertex.Elemscueimplement "self"cue/testdataadd fixed test case for issue 3743
doc3
doc/ref/spec.mdsome formatting and typo fixesdoc/ref/spec.mdsupport unary == bounddoc/ref/spec.mdsupport comparing values of different types
internal20
internal/encoding/gotypeshandle CUE import aliases and duplicatesinternal/cuetxtarimplement garbage collectioninternal/core/compileproperly quote labels in error message pathsinternal/cuetdtestconsider the first item in a Matrix to be defaultinternal/core/adt"write" stats file even when it isn't changinginternal/lsprefactoringinternal/core/adtadd Kind.AllKinds and Kind.Count methodsinternal/exportcater for NodeLinkinternal/encoding/yamluse cue/ast.NewLabelinternal/core/convertuse reflect.Value iterator methodsinternal/core/adtimprove structure sharing for _internal/ciupdate various action dependenciesinternal/core/adtmake Vertex.Elems return an iteratorinternal/cueexperimentmake keepvalidators stableinternal/cueexperimentstandardize experiment lifecycle systeminternal/core/adtaccept structcmp experimentinternal/core/adtshow all user errorsinternal/core/adtadd test for Issues 3983 and 3984internal/core/debugprevent stack overflowinternal/core/debugremove use of compact printer type
lsp5
lsp/cachebe robust for nil file contentlsp/definitionsadd support for the self experimentlsp/definitionscompletions from dot should be zero widthlsp/cacheprevent files from being both standalone and module/packagelsp/cacheadd support for standalone files
Other4
encodinguse ast.StringLabelNeedsQuoting- update all dependencies
encoding/xml/koalause ast.NewLabel- swap gopkg.in/yaml.v3 for go.yaml.in/yaml/v3
Downloads
Every file this release published on GitHub, with its SHA-256. Most people install CUE as Installing CUE describes, which also shows how to check a download.
Archives
| Platform | File and SHA-256 |
|---|---|
| macOS, Intel | cue_9545dabac462e54e360e2965149eca2261338b18e552b1395e06c48bf2a14504 |
| macOS, Apple silicon | cue_5f797e91691893c5bfebbfd750e691c45391c8bdf6d732f66c1c7677e5dc71d1 |
| Linux, x86-64 | cue_50f328e106748cd4176d47ed77b02f28ca9af30a4de75446f9a7365b9a5f1880 |
| Linux, Arm64 | cue_f3068cbabd612372adea7d0e0fe61bfb1632b6d3a0f67a378e255a6f016e52db |
| Windows, x86-64 | cue_8735b978147863a1e0b6c0a4bf2322d721962965d2d41effd061050ac66ff900 |
| Windows, Arm64 | cue_f1c6232b36a9bfdb023c937aed9d7f24c37f20fc9d6f9d439622088535288a39 |
SHA-256 checksums for all of these: checksums.txt