This release fixes many bugs in the new evaluator, enables the embedding experiment by default, and further improves JSON Schema support.
Changes which may break some users are marked below with: ⚠️
Evaluator
CLs 1204365, 1205361, and 1205363 fix a number of closedness issues in the new evaluator, which were spotted thanks to user reports and Unity testing.
CLs 1204490, 1205368, and 1205368 resolve a number of significant performance issues spotted in the new evaluator.
CL 1205861 enables the Embedding proposal via CUE_EXPERIMENT=embed
by default, now that the proposal has been moved to a "likely accept" state for v0.12.
CL 1204491 introduces CUE_DEBUG=openinline
, enabled by default, which emulates the old evaluator's incorrect closedness behavior in some edge cases. This should help the transition towards the new evaluator, and allow us to fix the behavior of these edge cases in future CUE releases.
CL 1204608 introduces CUE_DEBUG=sortfields
which sorts all struct fields lexicographically. This replaces CUE_DEBUG_SORT_ARCS=1
, which did not work with the new evaluator.
Go API
⚠️ CL 1205569 enables CUE_EXPERIMENT=decodeint64
by default, causing cue.Value.Decode
to choose int64
rather than int
as the default Go type for CUE integer values.
Builtins
CL 1204378 teaches list.UniqueItems
to handle incomplete values correctly, fixing a bug in JSON Schema.
CL 1204425 fixes list.MatchN
so that it matches final values, like the matchN
evaluator built-in, fixing a bug in JSON Schema.
⚠️ CL 1204920 removes the long-deprecated cue.Value.IsClosed
method.
⚠️ CL 1205530 removes the long-deprecated cue.Instance.Doc
method.
⚠️ CL 1205529 removes the long-deprecated cue/load.Config.BuildTags
field.
cmd/go
CL 1204111 fixes some edge cases where CUE comments were lost or duplicated, particularly with cue def
.
CL 1204874 re-enables command suggestions when a user makes a typo like cue exprot
.
Encodings
JSON Schema spec compatibility is improved further by fixing a number of bugs and adding missing features. Notably, it now supports arbitrary references to internal structure in $ref
. JSON Schema's spec test suite has gone from a "pass" rate of 75% to 79% thanks to these efforts.
Full list of changes since v0.11.0
- cmd/cue: remove support for CUE_DEBUG_SORT_ARCS by @mvdan in f2775f8
- internal/ci: update Go and goreleaser versions for the next release by @mvdan in 962fafa
- update most dependencies ahead of v0.12.0-alpha.1 by @mvdan in 18669a7
- internal/cueexperiment: enable embed experiment by default by @mvdan in 1b2d11c
- encoding/jsonschema: respect Config.PkgName by @rogpeppe in 4f8b741
- encoding/jsonschema: add test for Config.PkgName by @rogpeppe in d5de8d4
- encoding/jsonschema: implement
Config.DefineSchema
by @rogpeppe in 0112a33
- evaluator: add regression test to lock in evalv3 wrt #3567 by @myitcv in 92b8f6f
- cmd/cue: fix spelling of CUE_EXPERIMENT for evalv2 by @myitcv in 54c734c
- encoding/jsonschema: update external test errors by @rogpeppe in c4ef079
- encoding/jsonschema: refactor reference handling by @rogpeppe in 028c6f3
- encoding/jsonschema: add structBuilder type by @rogpeppe in ccaee22
- cue/load: assume that Config.Registry is set when SkipImports is false by @mvdan in 33945a2
- all: sunset CUE_EXPERIMENT=modules by @mvdan in c8033e9
- internal/astinternal: add IncludePointers by @rogpeppe in 950f7fb
- encoding/openapi: fix updating golden files in tests by @rogpeppe in 6e34b9e
- encoding/jsonschema: define isTop and isBottom functions by @rogpeppe in 5fdf0c2
- encoding/jsonschema: do not use explicit phase for TODO constraints by @rogpeppe in 9639ed8
- cue/ast/astutil: ensure imports always start a new section by @rogpeppe in 226aac1
- cue/ast/astutil: add test for file-level comments joining with imports by @rogpeppe in def8bcf
- cue/ast: remove outdated docs by @rogpeppe in 1ea52f1
- internal/mod/modload: sort module versions when adding a new dependency by @mvdan in 2be40ea
- all: CUE_EXPERIMENT=modules no longer needs to be set in tests by @mvdan in eaea301
- cue: enable CUE_EXPERIMENT=decodeint64 by default by @mvdan in 0005c22
- internal/core/adt: remove resolved TODO by @mvdan in 5bf869e
- cmd/cue: add new CUE_EXPERIMENT and CUE_DEBUG flags to
help environment
by @mvdan in 4e92634
- cue: add more godoc links by @mvdan in 0e99c20
- cue: remove Instance.Doc by @mvdan in 54dc544
- cue/load: remove Config.BuildTags by @mvdan in 49a53d2
- README: update version number in installation example by @elzapp in 1f15584
- internal/core/adt: more pruning in partial disjunction check by @mpvl in a03ed2e
- internal/core/adt: support simplifying string bounds by @mpvl in 6d15591
- internal/core/adt: order bound error messages by @mpvl in d298a53
- internal/core/adt: fix bug in bound simplification by @mpvl in f9e5b6a
- internal/core/adt: revert recent change by @mpvl in 00fa80a
- internal/core/adt: patch performance issue related to error reporting by @mpvl in f1ea2ff
- internal/core/adt: alternative algorithm for splitting trees by @mpvl in 6c86b41
- internal/core/adt: fix closedness bug with patterns by @mpvl in 4ae75f8
- internal/core/adt: pass closeContext to openDebugGraph by @mpvl in 8aa5769
- internal/core/adt: always create new closeContext on reference by @mpvl in 9b61fc0
- cue: use embedding for UnifyAccept in V3 by @mpvl in d471ca1
- internal/core/adt: add various closedness tests by @mpvl in cce50f4
- internal/core/adt: cleanup some todos by @mpvl in 5195004
- internal/core/adt: also handle __no_sharing for V2 by @mpvl in 06cf5f4
- internal/ci: use pull_request_target for PR CI jobs by @mvdan in 5149ebd
- internal/core/adt: fix dropping of field by @mpvl in 432c114
- internal/core/adt: make Conjuncts type ConjunctGroup by @mpvl in 787d04c
- cmd/cue: add regression test for #3616 by @myitcv in f99441a
- internal/core/adt: simplify code by @mpvl in f7d3973
- internal/core/adt: add test for dropped field issue by @mpvl in 4c7ee01
- internal/core/adt: allow selectively turning off sharing by @mpvl in dc1ef63
- cue/parser: always allow predeclared identifiers on RHS by @mpvl in ec9117a
- cmd/cue: deduplicate the use of CUE_EXPERIMENT=evalv3 by @mvdan in 46c1cb2
- internal/core/runtime: consistently follow CUE_DEBUG env var flags by @mvdan in d5527cf
- cmd/cue: add a testscript for CUE_DEBUG=sortfields working with the Go API by @mvdan in 4258e9a
- internal/core/adt: close previously fixed issue by @mpvl in 5ac1b8a
- internal/core/adt: add tests for Issue 3535 by @mpvl in 698da05
- internal/ci: use the new tipdeploy workflow in cuelang.org by @myitcv in 9f217e1
- cue/errors: simplify printError by @mvdan in 4ce128d
- cue: use Value.ctx helper method consistently by @mvdan in 5d8f2cd
- internal/astinternal: make it easier to debug references by @rogpeppe in 0b06bd5
- encoding/jsonschema: remove isSchema field by @rogpeppe in 781f140
- enable and fix "value never used" staticcheck rule by @mvdan in 6ef4f68
- enable and fix "non-generic receiver names" staticcheck rule by @mvdan in 55166dd
- internal/ci: start enforcing staticcheck in CI by @mvdan in 6f1b0a2
- add staticcheck config files to appease the linter by @mvdan in 9d10fe1
- encoding/openapi: simplify looping over CUE fields by @mvdan in afafedb
- cue: rewrite away all uses of Iterator.Label by @mvdan in 671ce60
- encoding/jsonschema: simplify ref logic without changing behaviour by @rogpeppe in c53f32a
- encoding/jsonschema: do not return state from schemaState by @rogpeppe in 6985d38
- encoding/jsonschema: include doc comments for definitions by @rogpeppe in 1f00e31
- encoding/jsonschema: add test for a doc comment on a definition by @rogpeppe in 65b1005
- cue: reenable Allows(AnyDefinition) test case with a TODO by @mvdan in c360ba8
- all: fix "a the", "the a", and "the the" mistakes by @mvdan in b18a322
- cue: remove the deprecated and hidden Value.IsClosed method by @mvdan in e53cb65
- cue: use cue/literal to parse integers out of attributes by @mvdan in 5dee391
- cue: add an attribute test with a non-Go integer literal by @mvdan in 3487155
- cue: make the tests non-chatty by default by @mvdan in 3c11890
- internal/core/adt: inlining simplification by @mpvl in 500ed27
- internal/cuedebug: rename files by @mpvl in 9773dae
- cmd/cue: enable subcommand suggestions when a user makes a typo by @mvdan in e11cbfb
- cmd/cue: add a test case for a subcommand typo by @mvdan in 70e5273
- all: fix testdata remnants of cue/format indenting first lines by @mvdan in 29e0b46
- internal/cueexperiment: remove yamlv3experiment by @mvdan in 5e20434
- internal/core/adt: add compatibility mode for issue 3534 by @mpvl in 2b55328
- internal/core/adt: add tests for issue 3534 by @mpvl in 9b8a10c
- internal/core/adt: add compatibiltiy mode for closedness issue by @mpvl in 0639975
- cue: fix loss or duplication of comments by @haoqixu in 53bbca5
- cmd/cue: add tests for the loss of comments with
cue def
by @haoqixu in b1f4f09
- Revert "cmd/cue: add test for the loss of comments with
cue def
" by @mvdan in ede6de0
- Revert "cue: fix the loss of comments in
Value.Syntax()
" by @mvdan in 974b5d5
- cue: fix the loss of comments in
Value.Syntax()
by @haoqixu in c9d519e
- cmd/cue: add test for the loss of comments with
cue def
by @haoqixu in 43a16ed
- internal/core/adt: improve structure sharing in cycles by @mpvl in c29fd02
- internal/core/adt: add test for perfromance issue 3587 by @mpvl in f054292
- cmd/cue: wire up CUE_DEBUG into the runtime for evalv2 by @mvdan in 4c1eb5c
- cmd/cue: add integration test for CUE_DEBUG=sortfields by @mvdan in e514fb7
- internal/core/adt: disable prep for associative lists by @mpvl in 00ca1c9
- internal/core/adt: fix error checking by @mpvl in 5c9b07f
- internal/core/adt: add tests for disjunction elimination by @mpvl in 64de763
- internal/core/toposort: support sorting fields lexicographically by @cuematthew in d95fd51
- cue/load: support loading a CUE package whose directory ends with .cue by @mvdan in b54e767
- encoding/jsonschema: fix oneOf with unconstrained elements by @rogpeppe in 956a558
- encoding/jsonschema: add test case for issue 3586 by @rogpeppe in 15f57d8
- encoding/jsonschema: close structs and mark fields as required in enum and const by @haoqixu in 0ad2119
- encoding/jsonschema: prevent invalid end position of id tag by @haoqixu in 407cccd
- doc: don't vendor a copy of DCO, as it is under another license by @jas4711 in 07973ae
- encoding/jsonschema: add a test for panicking about invalid pos by @haoqixu in 7d64696
- update txtpbfmt dependency by @mvdan in 8282ca5
- pkg/list: MatchN matches in final mode by @mpvl in a2d428d
- pkg/list: add tests for issue 3519 by @mpvl in 38c6949
- pkg/list: handle incomplete values for UniqueItems by @mpvl in 466b83b
- pkg/list: add tests for UniqueItems by @mpvl in 290f09f
- internal/ci: delete completed TODO about the old registry tokens by @mvdan in 5ed8701
- cue: fix Value.Unify closedness issues for evalv3 by @mpvl in 45e3256
- internal/ci: update Linux to ubuntu-24.04 by @mvdan in 25b7f46
- update golang.org/x dependencies by @mvdan in 18567fa
- internal/tdtest: make compatible with cuetdtest by @mpvl in 672755c
- internal/cueversion: bump LanguageVersion for v0.12 by @mvdan in 44696c3