v0.13.0-alpha.1
This release brings a new cue trim algorithm, a performance fix for field ordering, two new commands, and many fixes.
Changes which may break some users are marked below with: ⚠️
Evaluator
A great deal of work has happened in the new evaluator, which can be used via CUE_EXPERIMENT=evalv3. Marcel recently posted another update on performance progress.
An entirely new algorithm for cue trim and tools/trim has been implemented for CUE_EXPERIMENT=evalv3, which resolves all known bugs when trimming CUE. Give it a try and report any issues you find.
⚠️ The new topological sort algorithm for field ordering has been tweaked to avoid becoming too slow in some cases. This may result in some ordering changes, but we expect them to be relatively small. See the change for more details.
The parser now correctly allows keywords as required field labels such as if!: _, fixing a discrepancy with the spec.
cmd/cue
The new cue refactor imports command rewrites import paths, making it easy to migrate between module locations and major versions.
The new cue mod mirror command copies modules from one registry to another.
cue get go should no longer attempt to import types from the Go standard library as CUE, which caused errors.
Hidden files and files with build tags should now be correctly filtered when loading a single CUE package.
Encodings
Loading binary files, such as via @embed(file="foo", type=binary), no longer requires the input to be valid UTF-8.
⚠️ The JSON Schema decoder now imports schema descriptions as CUE doc comments, which required a change to encoding/jsonschema.Config.DefineSchema.
Go API
⚠️ The long-deprecated cue.Runtime methods Parse, FromExpr, CompileFile, and CompileExpr are now removed.
module.SplitPathVersion and module.ParseImportPath have been deprecated in favor of cue/ast.SplitPackageVersion and cue/ast.ParseImportPath package to consolidate the API.
The new mod/module.Version.Compare method is added in favor of module.Sort, which is now deprecated.
The new mod/modfile.File.ModuleForImportPath function allows resolving a module and default major version for a package without consulting a registry.
The new mod/modregistry.Client.Mirror method implements the logic behind the new cue mod mirror command.
All changes
142 changes since v0.12.0by area
all9
allstart making more use of strings.Cutallunconvert -apply ./...alluse a few more newer std APIsallstart using slices.Backwardalluse more maps and slices APIs from Go 1.23allGODEBUG=gotypesalias=1 is on as of go1.23.0allstart using maps and slices APIs from Go 1.23alluse eval.NewContext when possiblealluse ast.ParseImportPath and ast.ImportPath
cmd18
cmd/cuemention --inject-vars/-T flag for injection helpcmd/cue, internal/mod/modimportsadd test cases for issue 3795cmd/cueadjust the detection of Go standard library packagescmd/cueactually drop unsupported Go std types inget gocmd/cueadd testscript reproducing get go issues with std packagescmd/cuefix refactor imports over multiple modulescmd/cue/cmdshow incorrect handling of binary files when embeddedcmd/cuestop marking the login command as experimentalcmd/cueembed support is no longer experimentalcmd/cue/cmdadd test for edge casecmd/cuedon't truncate refactor-imports help textcmd/cueupdate workflow command help text linkscmd/cueimprove CUE example for exp-gengotypescmd/cuemention -c=false in vet's incomplete errorcmd/cueadd experimental warning to gengotypescmd/cueimplement mod mirrorcmd/cueaddrefactor importscommandcmd/cuefix typos in cue-help-filetypes
core4
core/toposortstop trying to order structinfos/structlitscore/toposortDo not calculate cycles within an SCCcore/adtcorrect copying of conjuncts in stripNonDefaultscore/adtCombine Vertex.Structs when inserting Conjunct for evalv3
cue10
cue/loadrespect build tags when determining packagecue/loaduse iterator rangecue/parserallowifas a label for a required fieldcue/interpreter/embedremove obsolete TODOscue/parserallowforas label for required fieldcuetweak cue.Value.Decode with Go std changescue/testdataadd a benchmark test for https://cuelang.org/issue/3514cueadd tests for Unifycue/astproperly deprecate Optional and Token in Fieldscueremove more long-deprecated APIs
encoding12
encoding/jsonschemasupport x-kubernetes-embedded-resourceencoding/jsonschemainitial support for Kubernetes CRDsencoding/jsonschemadelete code for Go 1.22encoding/jsonschemasupport single schema not at rootencoding/openapiconvert remaining cue->json tests to txtarencoding/openapiconvert test suite to txtarencoding/jsonschemapass comments to DefineSchemaencoding/jsonschemapass comments to DefineSchemaencoding/jsonschemabetter placement of jsonschema attributeencoding/jsonschemaadd test case for if/then/else with $idencoding/openapiswap sort.Slice for slices.Sortencoding/jsonschemause a cmp-based stable sort when decoding constraints
internal69
internal/mod/modimportsexclude hidden CUE filesinternal/ciupdate Go and goreleaserinternal/cuetxtarAppend \n to generated txtar file contentinternal/_e2eremove unused CUE_REGISTRY_TOKEN env varinternal/core/adtfix counter issueinternal/core/adtfix edge case in structural cycles with structure sharinginternal/core/adtfix structural cycle stack overflowinternal/core/adtremove Inline checkinternal/core/adtmake inline expressions addressableinternal/core/adtdo not hasNonCycle in one caseinternal/core/adtrefactor unifyNodeinternal/core/adtadd tests for issue 3634internal/encodingdon't interpret files as UTF8 with the binary encodinginternal/core/adtpropagate default marker in single nested valueinternal/core/adtadd tests for issue 3779internal/core/adtfix FromDefinternal/core/adtshorten closeContext graph depthinternal/vcsuse os.CopyFS from Go 1.23internal/core/adtremove unnecessary clearing of CloseInfointernal/core/adthoist feature checking logicinternal/core/adtdo not add arc dependencies for some nodesinternal/core/adtprepare for shortening rootinternal/core/adtadd test for closeContext graph shorteninginternal/core/adtsimplify ellipsis logicinternal/core/adtfix bug when merging closing struct with ellipsisinternal/core/adtadd test for issue 3778internal/core/adtbring semantics of top in line with v2internal/core/adtfix yield unwinding issue for validatorsinternal/core/adtadd tests for 3762internal/core/adtfix consistency issue for disjunctionsinternal/core/adtadd tests for 3124internal/core/adtremove diff/todo/p1internal/core/adtimprove reference cycle behaviorinternal/core/adtexplicitly detect cycle errorinternal/core/adtput blocking queue on stackinternal/core/adtadd tests for 3669 and 3737internal/core/adtdisable nodeContext.freeinternal/core/adtprune recursive processinginternal/core/adtremove noop counterinternal/core/adtlogging improvementsinternal/core/adtpass and use OpContext to functions using Schemainternal/encoding/yamluse adt.Unify instead of Value.Unifyinternal/core/adtavoid crashinternal/core/adtmove cycle state saving logic to Exprinternal/valuesupport more types and rename ConvertToContextinternal/core/adtadd Expr method on CallContextinternal/core/adtrecursively resolve pending arcs before lookupinternal/core/adtadd test for issue 3708internal/core/adtremove GroupUnify mechanisminternal/core/adtdo not carry forward FromEmbedinternal/core/adtdo not carry forward FromDef flaginternal/core/adtuse adt.Unify in cue packageinternal/envflagsmall follow-ups to int and string supportinternal/core/adtfix handling of topinternal/envflagsupport int and string flagsinternal/envflagskip over empty comma-separated elementsinternal/core/adtpass CallContext to builtin functionsinternal/core/adtfirst step in using CallContextinternal/core/adtfix hang on finalizationinternal/core/adtprevent recursion in callsinternal/core/adtdo not count validators as new datainternal/core/adtfix some cycle issues related to validatorsinternal/core/adtset the parent in UnifyValidatorinternal/core/adthoist unifyValidatorinternal/core/adtavoid cycle in debug outputinternal/core/adtadd tests for 3649internal/core/adtadd more error context in matchNinternal/cmd/cue-astadd support for ref and file-onlyinternal/cueversionbump LanguageVersion for v0.13
mod6
mod/moduleadd Version.Comparemod/modregistrytestmove from internal/registrytestmod/modregistryadd Mirrormod/modfileadd ModuleForImportPathmod/modfilemake it an error to have an empty module pathmod/moduleadd explicit test for package path with full version
pkg3
pkguse adt.Unify instead of Value.Unifypkg/encoding/jsonexpand implementation of Validate in placepkg/encoding/yamlhoist validate functionality
Other11
- update golang.org/x dependencies
- update various dependencies unlikely to cause breakage
cue.moduse exp3 curated modules- Revert "encoding/jsonschema: pass comments to DefineSchema"
tools/trimimplement trim for evalv3tools/trimprepare for trimv3- require Go 1.23 or later, test and release with Go 1.24
- update emicklei/proto and protocolbuffers/txtpbfmt
ast/astutilmake Resolve aware of version suffixescue.modupgrade to latest GitHub actions curated moduleast/astutiladd test for resolving imports with major version suffix
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_d74b484db9d0b82685fdb865e4b4a1a4ab14e7fd0bfc4ee49766e9f8e48f5d34 |
| macOS, Apple silicon | cue_96c31242efabb5edd7d89769c2f6163dfd01ccc305ae8323195f2d853cbf370d |
| Linux, x86-64 | cue_4bf8b7f3139dc4383cb63a0a822f4b08b8ea4aa1cbba9a32ae641539c1345fb9 |
| Linux, Arm64 | cue_0ac1ed0a478c6bd6f1ec93656f4d9b65ce15f9eb6a20f18964046ac7ce5af861 |
| Windows, x86-64 | cue_b2b2ff3b1b2cb6cffdab69e590a1dc2f1156c6bb573d738c2b0ddb4ed83138f8 |
| Windows, Arm64 | cue_332743a002bf7b2022763753e7e93144991542bc222da790bed0e0283033a3d6 |
SHA-256 checksums for all of these: checksums.txt