github cue-lang/cue v0.13.0-alpha.4

latest releases: v0.15.1, v0.15.0, v0.16.0-0.dev...
pre-release7 months ago

This release adds further fixes and optimizations to the new evaluator, and introduces an experimental XML encoding for CUE.

Changes which may break some users are marked below with: ⚠️

Evaluator

The new evaluator is improved to fix a few more regressions which led to incorrect errors. Since the last alpha release, one more project in Unity is fully working with evalv3, and just one remains with a breakage compared to evalv2.

Performance work for the new evaluator is ongoing; a number of changes in this release led to performance improvements of between 5% and 70% for a variety of projects. For more details, see Marcel's last performance update.

As a reminder, the old evaluator is still accessible via CUE_EXPERIMENT=evalv3=0. If you encounter any errors or other problems, please file an issue with details.

Filenames beginning with a dot can now be embedded as long as the glob pattern uses an explicit dot, such as @embed(glob="dir/.data_*.json").

⚠️ @embed(glob="pattern...") directives whose file globbing results in zero files now result in an error, to avoid situations where a glob pattern silently stops working as intended.

⚠️ The CUE_DEBUG=openinline evaluator debug flag is removed, now that evalv3's closedness implementation closely matches the semantics of evalv2.

cmd/cue

cue mod tidy now preserves the top-level custom field as intended.

cue get go now interprets Go fields with the new json:",omitzero" struct tag as CUE optional fields.

cue cmd now fails if no tasks were actually defined, to avoid situations where a user is misled into thinking a task was defined when it was not.

Builtins

⚠️ The uuid.ToString function is removed, given that it never did anything useful and could mislead users into thinking it did.

tool/http gained a followRedirects option to let the user disable HTTP redirection.

Encodings

The XML "Koala" encoding proposed in February is now available via an experimental implementation. Try it out via the CLI like cue export xml+koala: data.xml, or via its Go API.

Full list of changes since v0.13.0-alpha.3
  • internal/ci: bump Go and goreleaser for the next alpha release by @mvdan in d1fb074
  • internal/golangorgx: cuelsp: remove unneeded code by @cuematthew in e223de9
  • cue/interpreter/embed: fix "glob" typo by @mvdan in 2666081
  • cue/interpreter/embed: fail when glob pattern has no matches by @rogpeppe in b6d7332
  • interpreter/embed: allow glob to match explicit dot files by @rogpeppe in 6741c90
  • cmd/cue/cmd: add test case for embedding a pattern with an explicit dot file by @rogpeppe in 572a6cc
  • pkg/tool/http: allow configuration of following redirects by @myitcv in acc06c5
  • cmd/cue: error on useless commands by @myitcv in 4b5dd6b
  • cmd/cue: remove test files related to old old closedness by @myitcv in 93e82f2
  • internal/core/adt: cache reqSets in nodeContext by @mpvl in fac9a30
  • internal/core/adt: add benchmark for 3881 by @mpvl in 3eef4dd
  • internal/core/adt: add stats for new closedness algo by @mpvl in 5f329ce
  • internal/core/adt: fix Vertex dereferencing for disjunctions by @mpvl in 96e0ebc
  • internal/core/adt: add tests for 3850 and 3875 by @mpvl in 7cfe774
  • internal/core/adt: fix test names by @mpvl in 5dcc768
  • internal/core/topsort: prevent duplicates in nodeToStructMeta by @mvdan in a753c37
  • internal/core/adt: remove unused nodeContext fields by @mvdan in b12e201
  • internal/core/adt: show correct path for incomplete values by @mpvl in e714489
  • internal/core/adt: skip work in checkTypos when a vertex has no arcs by @mvdan in 3c149f1
  • internal/core/adt: reuse a local buffer in checkTypos by @mvdan in ab8bd45
  • internal/golangorgx/gopls: Use the correct error. by @alingse in 19403a4
  • internal/core/adt: avoid more allocations when LogEval is disabled by @mvdan in 34a512f
  • internal/core/adt: remove unused code low-hanging fruit by @mvdan in 8fef4d3
  • cmd/cue: convert examples to 'cue vet -c' by @myitcv in 08c3542
  • internal/golangorgx/gopls: Get cue lsp to initialize with emacs lsp by @cuematthew in c54251d
  • internal/core/adt: do not activate ids for non-definitions by @mpvl in 2824405
  • internal/core/adt: add tests for 3858 by @mpvl in eec6a2a
  • internal/core/adt: reuse reqSets slices via OpContext by @mvdan in 1d028fc
  • internal/core/adt: prevent logging overhead when disabled by @mvdan in e778137
  • internal/cuedebug: drop openinline flag by @mvdan in a09a38b
  • pkg/uuid: remove ToString by @mvdan in f836184
  • cmd/cue: go get Go fields with the json omitempty tag as optional by @mvdan in d9da212
  • cmd/cue: add get go test case with the new omitzero json tag by @mvdan in be6c3db
  • internal/encoding/yaml: support alias to scalars as map keys by @OmriSteiner in a6fff27
  • cmd/cue: actually update the _gen.go.want gengotypes testscript files by @mvdan in 52d9689
  • update golang.org/x/... dependencies by @mvdan in 433ac2c
  • update pelletier/go-toml to drop testify by @mvdan in 9b5b10f
  • cmd/cue: wire up xml+koala via encoding/xml/koala by @mvdan in 096a114
  • internal/encoding/gotypes: generate valid json tags for quoted fields by @trumant in 93c1421
  • internal/mod/modload: preserve custom struct in module when tidying requirements by @snuxoll in e058014
  • encoding/xml/koala: introduce the first experimental XML encoder by @matts85 in ebf42e5

Don't miss a new cue release

NewReleases is sending notifications on new releases.