github cue-lang/cue v0.16.0

5 hours ago

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

Language

As a reminder, we have two ongoing language experiments since v0.15; a replacement for struct embedding and a rework of aliases. Please give these a try and report any issues or feedback!

⚠️ The cmdreferencepkg global experiment is now stable, meaning that CUE_EXPERIMENT=cmdreferencepkg is always enabled.

#"""# is now accepted as a string literal quoting a double quote, ".

Multiline string literals now require a trailing newline, matching the language spec.

The new try experiment

This release introduces the try experiment, which adds a try clause in comprehensions as well as the use of ? in field selectors. This addition to the language is intended to provide a more concise syntax for handling optional fields without the risk of unintentionally swallowing errors.

This experiment also introduces the else clause for if and try comprehensions, and the fallback clause for for comprehensions, which trigger when a comprehension produces zero values.

You can try this experiment by following our how-to guides on the try clause and the else clause. For more information, see the proposal on GitHub and the spec change patch.

Evaluator

Performance

Further improve the use of caching in the typochecker algorithm; this provides speed-ups of up to 80% on some large projects.

Very large structs (tested with 20,000 fields) are up to 80% faster now, as we were repeating some work unnecessarily.

A great deal of effort has gone into reducing the allocations and memory usage across a number of projects. For some of these, memory usage is down by as much as 60%.

These improvements were possible thanks to our Unity service, letting us analyze CUE's performance and test for regressions on third party projects. Contact @mvdan on Discord, Slack, or via the Unity page to ensure that your project is included or you are running into slowness.

A number of changes were made to improve support for using cue.Values concurrently; see Issue #2733 for more details and ongoing progress.

Other changes

Fix a regression introduced in v0.13 where the or built-in with literal arguments could stop behaving like a disjunction.

A number of panics and other bugs in the evaluator which were reported since v0.15.0 have been fixed; thank you to all who reported these.

cmd/cue

Add support for $DOCKER_AUTH_CONFIG to directly provide the contents of $DOCKER_CONFIG/config.json to authenticate with module registries, matching Docker's current behavior.

The --outfile flag now works when given non-regular files such as named pipes or sockets.

⚠️ cue mod publish no longer ignores sub-directories containing a go.mod file.

⚠️ Using cue inside the cue.mod directory now fails consistently with a clear error message to not place CUE code there. Previously, some commands worked while others failed with confusing errors.

⚠️ The global --verbose and --trace flags have been moved to the cue get go and cue trim commands respectively, as they were the only ones actually using those flags, and this could be confusing to users.

Fix a bug where loading ./...:pkgname could lead to loading directories without CUE files as instances, which could cause poor performance for CUE packages with multiple parent directories.

cue exp writefs gains an encoding optional field for regular files, to specify an encoding rather than infer it from the filename extension.

LSP server

Initial LSP support for editing embedded JSON and YAML files. This feature provides completions and hover-docs when editing JSON or YAML files which are embedded into CUE via the @embed attribute. A teaser video is available on YouTube.

Code Actions: two code actions are now provided, Add surrounding struct braces and Remove surrounding struct braces, which convert between

a: b: c

and

a: {
	b: c
}

with the cursor on b.

A complete overhaul of how the LSP server suggests code completions. This solves the previous naïve implementation which would only make suggestions after a field name or path had been started. Now completions are available from within whitespace.

Embedded paths with mutual dependencies: embedded paths with multiple components (e.g. a.b.c) can in some cases only be fully resolved after the resolution of other embedded paths. The LSP server can now correctly handle these dependencies.

The LSP server now implements LSP Document Symbols functionality. This is often used by editors to provide light-weight breadcrumb navigation within a file.

Some preliminary diagnostics are now sent from the LSP server back to the editor. Initially this mainly indicates syntax errors in CUE files, but this can be extended in the future.

Many bug fixes, including better behaviour for files and directories with spaces; improvements for value aliases (foo: L=x); LSP rename now provides placeholder text; improved jump-to-definition behaviour for package-level fields; fixed issues around imports; path resolution; formatting of standalone CUE files; and others.

See our Getting Started wiki page for instructions on how to set it up with your editor.

Please report any bugs or missing features you encounter via the Issue tracker or via the #lsp channels on Discord or Slack.

Encodings

Add support for encoding YAML tags like key: !Custom value by using CUE attributes like key: "value" @yaml(,tag="!Custom").

cue get go now detects which Go packages use Kubernetes type semantics via // +k8s:openapi-gen=true and obeys the field annotations // +optional and // +nullable.

cue get go gains a --codec flag to configure the use and priority of Go struct field tags like json or yaml.

Fix a bug where cue get go could skip over fields whose type implements one of the supported marshaling interfaces.

Fix a few bugs where cue get go could result in invalid or failing CUE code.

JSON Schema's Config.OpenOnlyWhenExplicit option is now exposed for the CLI via the filetype tag jsonschema+openOnlyWhenExplicit.

JSON Schema now properly encodes hash references for better compatibility with other tools.

Standard library

The strconv package adds ParseNumber, like ParseInt or ParseFloat but allowing other CUE number strings such as 1Ki.

The net package adds InCIDR to test whether an IP is contained by a CIDR string.

The net package adds ParseCIDR to extract useful information from a CIDR string.

The net package adds CompareIP to compare two IP addresses, which can be useful for computing with IP ranges.

The net/http package adds Serve as an experimental API to listen on a port and serve HTTP requests.

The tool/file package adds Symlink to create symbolic links.

Go API

cue.Value.Decode now supports the new cue.Unmarshaler interface, allowing Go types to implement their own CUE value decoding logic via an UnmarshalCUE(cue.Value) error method.

The new cue.IsIncomplete function reports whether the given value is a CUE incomplete error.

cue/ast gains the NewPredeclared and Ident.IsPredeclared to mark and detect identifiers referencing predeclared names like error or int rather than fields which may shadow those names in the current scope.

⚠️ cue.Value.Decode now uses cue.IsIncomplete to not treat incomplete errors as fatal, allowing the decoding to continue.

Fix a bug where cue.Value.Decode could behave incorrectly when decoding a CUE null or incomplete value.

⚠️ cue/token.Compare now sorts absolute paths before relative ones, to ensure consistent behavior between Unix-like systems and Windows.

⚠️ The long-deprecated cue/ast.Node.Comments and cue/ast.Node.AddComment interface methods are now removed; use cue/ast.Comments and cue/ast.AddComment respectively.

⚠️ The long-deprecated and unused cue/parser.FromVersion and cue/parser.DeprecationError APIs are now removed.

⚠️ The long-deprecated and hidden cue.Instance.Eval method is now removed.

Full list of changes since v0.15.0
  • internal/ci: use OIDC with the Central Registry for the e2e tests by @mvdan in de47a5e
  • re-enable staticcheck's SA4000 and SA4003 checks by @mvdan in 771e253
  • internal: bump staticcheck to v0.7.0 for Go 1.26 support by @mvdan in e1de78e
  • lsp/eval: correct resolution of package-level fields by @cuematthew in e3306a9
  • lsp/eval: add test showing bad behaviour by @cuematthew in da5d43a
  • lsp/server: make "Remove surrounding struct braces" preferred by @cuematthew in 5f20a71
  • doc/ref: clarify who maintains this document by @mvdan in 3ee970f
  • allow more commands in Claude by @mvdan in 6d50284
  • lspaux/protocol: initial implementation for protocol by @cuematthew in 3ee106b
  • cue/load: check some errors that were ignored by @rogpeppe in 13fdcdb
  • doc/ref: fix three mistakes in the matchIf examples by @mvdan in 000506e
  • cue/load: do not panic when load.Instances(args, nil) fails very early by @mvdan in cd6a481
  • cmd/cue: add a test case for issue 4286 by @mvdan in edc89df
  • lsp/eval: add support for comprehension else/fallback by @cuematthew in e2d8f7b
  • cmd/cue: support explicit encodings in exp writefs by @mvdan in d0eca3f
  • cmd/cue: rewrite exp writefs with internal/filetypes and internal/encoding by @mvdan in 766668d
  • cmd/cue: add first exp writefs testscript by @mvdan in 00eddbf
  • internal/core/adt: missed missing missing by @mpvl in 8732213
  • cue/parser: simplify else/fallback clause rules by @mpvl in 0cbc9a1
  • cue/parser: restrict else to single clause only by @mpvl in 28f0246
  • cue: add fallback keyword for for comprehensions by @mpvl in fe9f503
  • cue/testdata: rename out/eval to out/evalalpha when appropriate by @rogpeppe in c76dc5a
  • cue/build: fix stale identifier resolution across instances by @mvdan in dd7361a
  • cmd/cue: add regression test for issue 4275 by @mvdan in 791e697
  • encoding/yaml: improve ast.StructLit and ListLit positions by @cuematthew in cde471e
  • cmd/cue: be more helpful when publishing a module without source by @mvdan in 3dfa50a
  • encoding/jsonschema: remove net/url.Parse workaround for Go 1.26 by @mvdan in 6cce9bc
  • internal/core/export: fix self-referential lets for recursive definitions by @mvdan in c257634
  • internal/core/compile: avoid double error for invalid optional references by @mpvl in c1be2bb
  • update all dependencies by @mvdan in 9fb0173
  • internal/core/adt: add regression test for error() in pattern constraint keys by @mvdan in 50a0a5e
  • internal/core/adt: fix structural cycle hang with braced selectors by @mvdan in 36702fd
  • cmd/cue: add and unskip tests for invalid task type errors by @mvdan in db4afc1
  • internal/core/dep: fix stack overflow on recursive definitions in dep analysis by @mvdan in 0b49a54
  • internal/core/dep,internal/core/export: fix stack overflow on recursive definitions by @mvdan in d0e2ab6
  • tools/flow: skip phantom tasks from eliminated conditional branches by @mvdan in 7fb912e
  • encoding/gocode: fix test by @rogpeppe in 98ca6e3
  • internal/core: remove import path to instance mapping by @rogpeppe in b3d9ffc
  • doc/spec: use "custom errors" instead of "user errors" by @myitcv in baf8302
  • internal/ci: explicitly set contents permission by @myitcv in 7cde504
  • lsp/eval: Add support for try-clauses and optional path components by @cuematthew in 62de631
  • cue/testdata: update stats for comprehensions/try.txtar by @mvdan in 20c1149
  • internal/core/adt: implement try expressions by @mpvl in f2e8299
  • cue/build: integrate identifier resolution into Complete by @mpvl in 1aeb33e
  • lsp/fscache: ignore ASTs which have no absolute positions by @cuematthew in 2585b3b
  • cue/ast,cue/ast/astutil: add NewPredeclared and IsPredeclared for builtin references by @mpvl in 8405422
  • internal/core/adt: fix else clause duplication in comprehension field splitting by @mvdan in 40356ab
  • cue/load: improve error for major-only version packages outside a module by @mvdan in 7675369
  • cmd/cue/cmd: add test coverage for absolute packages with cue cmd by @mvdan in f5e266a
  • encoding/yaml: add support for YAML tags via @yaml(,tag) attribute by @jonas-meyer in b1a58bd
  • internal/astinternal: omit ILLEGAL tokens in debug print by @mpvl in 23736eb
  • cue: clarify that Schema is only useful for Value.Subsume by @mvdan in bb18d7b
  • lsp/cache: expand completion range of fields in json for double-quotes by @cuematthew in b1c63da
  • all: start using "else" in comprehensions by @mvdan in 3f2f654
  • tweak Claude's allow and deny settings further by @mvdan in ef6bb80
  • internal/ci: disable checkout persist-credentials by default by @myitcv in 069eac9
  • cue/load: do not load non-CUE directories as instances by @rogpeppe in a4d2a6f
  • cue/load: add test case for non-package directories by @rogpeppe in 028411e
  • cmd/cue: deflake cue_after test by @rogpeppe in 4504db0
  • all: use reflect.TypeAssert in three more places by @mvdan in 58cbd0c
  • cue/internal: Make ToFile optionally preserve StructLits by @cuematthew in ec3e289
  • all: re-apply go fix -any=false ./... after Go version bump by @mvdan in 8579c46
  • lsp/cache: completions must not return null items list by @cuematthew in 75ee97a
  • internal/core/export: fix panic in relPathLength for BinaryExpr by @mvdan in 788eeed
  • tools/fix: use ast.Predeclared to avoid shadowing in value alias conversion by @mvdan in 08a7ec3
  • cue/ast,cue/ast/astutil: add Predeclared sentinel for builtin references by @mvdan in 42cc85f
  • tools/fix: add tests for value alias conversion when "self" is in scope by @mvdan in 3dacb0c
  • cue/ast/astutil: fix false positive in label expression check for let clauses by @mvdan in a93bcc1
  • cmd/cue/cmd: add failing test for issue #4202 by @mvdan in 0a4a11a
  • internal/core/export: avoid let name collisions with dependency fields by @mvdan in f2b697a
  • internal/core/export: add failing test for issue #4221 by @mvdan in b690442
  • internal/core/adt: fix undefined field in comprehension with structural cycle by @mvdan in 225a1c4
  • cue/testdata: add regression test for issue #4203 by @mvdan in e3eb948
  • internal/core/adt: fix panic in memory reclamation by @mvdan in 355d6fd
  • internal/core/adt: add else clause to comprehensions by @mpvl in 9e2dec3
  • _scripts: add OpenSpec support for AI-assisted development by @mpvl in 6a78eff
  • lsp/eval: fix field-value aliases by @cuematthew in 29d8be4
  • lsp/eval: add test to show bad behaviour of aliases by @cuematthew in 3e6bee7
  • internal/core/export: fix hidden identifier renaming in for clauses by @mvdan in 2fea4bc
  • internal/core/export: add failing test for issue #4254 by @mvdan in c53993e
  • cue/errors: avoid duplicate path in error list formatting by @mvdan in 487c072
  • pkg/list/testdata: add regression test for issue #4171 by @mvdan in e977cfa
  • internal/lsp: implement ConvertFromStruct code action by @cuematthew in f68f686
  • internal/ci: bump actions/checkout and cue.dev/x/githubactions by @mvdan in f4d1d5a
  • lsp/server: force-load all packages for completions within embedded files by @cuematthew in 5eb5ed9
  • pkg/tools/http: remove valueMu mutex from http.Serve by @mpvl in 95ba1d2
  • internal/core/runtime: add lock protection to loaded map by @mpvl in 6451728
  • internal/core/adt: fix race condition in Vertex.Default() by @mpvl in 854a5b7
  • internal/core/adt: use thread-safe WeakMap for regexp caching by @mpvl in c7797c1
  • pkg/tools/http: experimental implementation of http.Serve by @mpvl in 0badd6d
  • golps/protocol: introduce DocumentURI.Path method by @cuematthew in f04e0fb
  • gopls/protocol: rename DocumentURI.Path to DocumentURI.FilePath by @cuematthew in d8eca4a
  • lsp/eval: process field attributes and specialise queries for embeds by @cuematthew in eb192c6
  • internal/lsp: model embedded files as packages by @cuematthew in fa8946f
  • lsp/fscache: read json and yaml files as CUE by @cuematthew in 6825394
  • lsp/cache: rework package dirtying and reloading by @cuematthew in 22fff24
  • internal/lsp: FileEvaluatorForURI returns lsp/cache.File by @cuematthew in dbf3293
  • lsp/eval: change eval constructor to take Config struct by @cuematthew in 3cd3244
  • interpreter/embed: prepare embed for extension by @cuematthew in a95414a
  • encoding/json: extract PatchExpr to internal/encoding/json by @cuematthew in e5bfcda
  • all: apply the straightforward Go 1.25 or later cleanups by @mvdan in e834a18
  • cmd/cue: rewrite help fmt by @mvdan in 0fa24af
  • all: test and release on Go 1.26, require Go 1.25 or later by @mvdan in 0dc0eac
  • internal/core/compile: fix operator precedence in error() builtin by @mvdan in 70b3f3e
  • cue/testdata/builtins: add test for error() with erroring interpolation by @mvdan in a6070c8
  • internal/core/adt: fix value alias resolution in disjunctions by @mvdan in b053ad5
  • cue/testdata/disjunctions: add regression test for value alias in disjunction by @mvdan in 0c9ed36
  • internal/core/adt: handle EqualOp in SimplifyBounds by @mvdan in 0813460
  • pkg/net: add CompareIP by @mvdan in 174a8b9
  • pkg/encoding/openapi: support marshalSchema builtin for openAPI by @mpvl in 66ea772
  • lsp/fscache: correct path components by @cuematthew in 44a543b
  • integration/workspace: add test showing bad behaviour by @cuematthew in c164d8f
  • add go tool cue and xargs as allowed Claude commands by @mvdan in 4b495fa
  • all: go fix -any=false ./... by @mvdan in 3d3f74b
  • internal/lsp: implement ConvertToStruct code action by @cuematthew in c45f72d
  • internal/core/adt: refine cycle handling in LetReference.resolve by @mvdan in 3e1e745
  • cue/testdata/cycle: add regression test for issue 4244 by @mvdan in eb2c57c
  • lsp/cache: provide placeholder for PrepareRename by @cuematthew in 049d6e1
  • internal/ci: allow steps to influence job permissions by @myitcv in 839f03d
  • cmd/cue: alter flag behavior based on the command name by @mvdan in bc5bd8f
  • cmd/cue: drop --verbose and --trace as global flags by @mvdan in 92afa2e
  • cmd/cue: map constants by go/types.Type directly by @mvdan in dac4e90
  • pkg/tool/file: add Symlink by @sprat in 6618a6f
  • internal/ci: fix release workflow by @myitcv in 9e34d67
  • internal/ci: use new registry-login-action by @myitcv in f595566
  • cue/token: sort absolute positions before relative ones by @mvdan in 46c1f9d
  • cmd/cue: test that cue fmt also formats files with no package clause by @mvdan in d65c829
  • cue: remove Instance.Eval by @mvdan in 60c0505
  • pkg/path: remove osInfo.HasPrefix by @mvdan in 516099a
  • cmd/cue: rewrite help vet by @mvdan in 9488f0c
  • cue: point out cue/format exists in the godoc by @mvdan in ba2ce99
  • cue/load: error when loading packages from inside cue.mod by @mvdan in 52e0dde
  • cmd/cue: add a testscript running commands inside cue.mod by @mvdan in 50aaf7e
  • mod/modzip: check for cue.mod existence, not just directories by @mvdan in 8034cc1
  • mod/modzip: check for cue.mod directories instead of go.mod files by @mvdan in 8957a36
  • mod/modzip: add test for go.mod submodule detection by @mvdan in 3be6c26
  • cue/format: simplify label replacement without astutil.Apply by @mvdan in fdc3f74
  • cmd/cue: clarify the restrictions around @embed file paths by @mvdan in dc9a189
  • .claude: allow more commands by @mvdan in 60b5bd9
  • pkg/net: add ParseCIDR to extract CIDR information by @mvdan in ea83954
  • pkg/net: add InCIDR to check if an IP is within a CIDR range by @mvdan in a3cffd4
  • cue/format: fix comma placement for ellipsis with inline comments by @mvdan in 79305ff
  • cue/format: add test for issue #4238 by @mvdan in 452fbae
  • internal/core/adt: fix spurious error in ForClause.yield key binding by @mvdan in beae55b
  • CLAUDE: discourage "go build" and add a set of "must follow" rules by @mvdan in 6301c2a
  • encoding/json: correct positions of field labels from json by @cuematthew in 8c70d8d
  • internal/cueexperiment: clarify the docs and update the ordering by @mvdan in 46dc5d7
  • cmd/cue: appease gopls in gen_experiments_help.go by @mvdan in 79c8f3a
  • internal/ci: bump Go and goreleaser for v0.16.0-alpha.1 by @mvdan in 29a1c5a
  • update dependencies ahead of v0.16.0-alpha.1 by @mvdan in 14cf3bd
  • doc/ref: clarify the relationship between exported and hidden identifiers by @mvdan in 367bc88
  • internal/core/adt: avoid allocations in matchPattern by @mvdan in 523284f
  • internal/core/adt: remove redundant updateConjunctInfo call by @mvdan in e52024b
  • internal/core/convert: allocate vertices in ensureArcVertex better by @mvdan in e2b85a8
  • pkg/math/bits: avoid an extra allocation per call by @mvdan in 9adb47a
  • internal/core/convert: reuse singleton struct and list marker allocs by @mvdan in d06db86
  • internal/core/adt: remove unused parameters in Vertex.AddStruct by @mvdan in a8d5eef
  • internal/core/convert: avoid repeated OpContext.Env calls by @mvdan in 54e81b3
  • internal/core/convert: avoid an allocation for "small" big.Int values by @mvdan in 72c8aac
  • internal/core/adt: also use strings.ToValidUTF8 over x/text/encoding/unicode by @mvdan in b78f800
  • internal/core/convert: use strings.ToValidUTF8 over x/text/encoding/unicode by @mvdan in 29aca5f
  • cue: add IsIncomplete for checking for incomplete errors by @rogpeppe in 40a5f00
  • cue: add test case for decoding incomplete value by @rogpeppe in c98dca2
  • internal/pkg: avoid repeating the args adt.Value slice in CallCtxt by @mvdan in bcb3559
  • internal/core/adt: place CallContext on the stack by @mvdan in e0e9233
  • internal/core/convert: avoid reflect.Value.Seq2 on maps too by @mvdan in ba1ffbc
  • internal/core/adt: do not allocate a new YieldFunc in processComprehension by @mvdan in bd7fac4
  • internal/core/adt: preallocate CallExpr.evaluate args by @mvdan in 29520c4
  • internal/core/adt: remove last comments about the evalv3 transition by @mvdan in 883158a
  • cmd/cue: relax login --token prefix validation by @rustyx in 98e651d
  • internal/core/adt: fix regression in cycle handling for literal-only calls by @mvdan in ecb33d7
  • cue/testdata/cycle: add test for issue #4230 by @mvdan in 02450bd
  • internal/core/adt: group allocations in ForClause.yield by @mvdan in c9c6652
  • cue/token: Pos.Add should be noop if Pos is not absolute by @cuematthew in de49f5c
  • cue/ast/astutil: fix nil pointer dereference in postfix alias error by @mvdan in 8293c52
  • lsp/eval: rework transitioning through imports by @cuematthew in f2a2319
  • internal/core/debug: fix stack overflow in error formatting by @mvdan in e7616e0
  • lsp/eval: Path resolution must force eval of import specs by @cuematthew in af0cfc1
  • lsp/eval: Correct usages for import specs by @cuematthew in 8e6fb3b
  • internal/lsp: sort results of find-definitions and find-references by @cuematthew in 69bda43
  • cue: simplify unmarshaler logic further a bit by @mvdan in dbf0666
  • cue: refactor how Decode handles custom unmarshalers by @snuxoll in c157e78
  • cue/parser: add test cases for newlines in interpolations by @mvdan in b779ef6
  • cmd/cue: allow non-regular files with --outfile by @mvdan in 0408e0f
  • lsp/eval: correct evaluation of embedded lits by @cuematthew in f1db806
  • lsp/eval: add test showing bad behaviour by @cuematthew in 0aa51c2
  • internal/lsp: overhaul the LSP evaluator by @cuematthew in 48f454c
  • internal/lsp: rename definitions to eval by @cuematthew in e96b5fe
  • cue/ast: Add period position to selector by @cuematthew in 5e3d8da
  • internal/core/adt: remove redundant position code after SimplifyBounds by @mvdan in 4c6c3c4
  • internal/core/adt: simplify disjunctError by @mvdan in ff54443
  • internal/core/adt: remove unused reportFieldMismatch parameter by @mvdan in dd7357f
  • cue/format: fix single import with trailing comment by @myitcv in eaaba8b
  • encoding/jsonschema: correctly encode references by @rogpeppe in 781e23b
  • cue: support custom CUE unmarshalling via Unmarshaler by @snuxoll in 0c6b1ee
  • cmd/cue: correctly parse type=number and type=int tags by @mvdan in 650cce2
  • cmd/cue: add a test for a type=number injection tag by @mvdan in 0ac9d7f
  • encoding/toml: correctly check for duplicate keys with arrays by @mvdan in 3f825a4
  • cue/load: only inject a tag value when it was parsed correctly by @mvdan in 3116c50
  • cmd/cue: add test cases for cue cmd tag injection with more types by @mvdan in 4e6a19f
  • internal/core/adt: fix nil pointer dereference in BinaryExpr.evaluate by @mvdan in cb9da59
  • cmd/cue: reintroduce type: "file" default in exp writefs by @mvdan in 220e7c8
  • cmd/cue: simplify exp writefs example a bit by @mvdan in 02fbd6d
  • internal/ci/base: add a #writefs CUE schema by @mvdan in dd7a23f
  • cmd/cue: rewrite exp writefs to not require go run by @mvdan in 1d15871
  • cmd/cue: add exp writefs moving the code from the cuelang.org repo by @mvdan in 98a60eb
  • internal/ci: bump Go and goreleaser versions by @mvdan in e4c8a12
  • encoding/toml: forget nested arrays when starting a new array element by @mvdan in 09c2e40
  • cmd/cue: avoid panic in get go when an enum has zero named values by @mvdan in e6123b0
  • cmd/cue: get go: expose field name lookup priority by @gdvalle in 7bd151d
  • internal/core/adt: use the pre-validation value kind to report errors by @mvdan in 49e75c7
  • internal/core/adt: remove commented-out error assignment with a TODO by @mvdan in 2a310e9
  • internal/core/adt: remove the docs for evalv2's cycle detection algorithm by @mvdan in fb0e218
  • all: start using slices.DeleteFunc by @mvdan in 77b401f
  • internal/core/adt: remove unnecessary isShared assignment by @mvdan in 3fe89ac
  • internal/core/adt: remove another unused branch with a TODO by @mvdan in f48ba68
  • internal/core/adt: remove unused branch with TODOs by @mvdan in 0b445a5
  • internal/core/adt: remove branch with TODO which never triggers by @mvdan in 46b33b1
  • internal/core/adt: remove now-unnecessary panic workaround by @mvdan in 2e7e48d
  • cmd/cue: test --outfile and --force with named pipes by @mvdan in 51f429e
  • internal/core/adt: shrink CloseInfo fields in nodeContextState by @mvdan in 06f65ae
  • internal/core/adt: shrink scheduler by 40 bytes by @mvdan in 2c35f57
  • all: fix up uses of the deprecated cue.Value.Elem method by @mvdan in c8653bf
  • all: fix up uses of the deprecated cue/ast comment methods by @mvdan in ba4ebbb
  • cue/parser: simplify how we deal with the ancient alias syntax by @mvdan in dd6d201
  • cue/parser: simplify parseComprehensionClauses by @mvdan in 26982e8
  • cue/parser: signal missing tokens via token.NoPos by @mvdan in 97996d2
  • cue/parser: use errorExpected more consistently by @mvdan in 13a79ee
  • cue/parser: balance newlines on multiline composite literals by @mvdan in 9d60910
  • cue/parser: reuse Parser.expect for more tokens by @mvdan in 5064680
  • cue/parser: simplify the expectComma logic by @mvdan in a9613af
  • cue/literal: require multiline literals to end with a newline by @mvdan in 8e4d374
  • cue/literal: add test cases for multiline literals with missing newlines by @mvdan in 5c3e0f5
  • cmd/cue: add support for DOCKER_AUTH_CONFIG OCI registry credentials by @bogdanbojan in b06d4a7
  • internal/core/adt: simplify aStruct field by @mvdan in 4dd731e
  • internal/core/adt: eagerly update kind to StructKind when aStruct is set by @mvdan in fc86988
  • cue/testdata: start a disjunctions/discriminator.txtar file by @mvdan in b66772d
  • internal/core/adt: do not reuse large vertexMap maps by @mvdan in 01ef28d
  • internal/core/adt: reuse vertex maps in overlayContext by @mvdan in 7d8e1f9
  • cue/testdata: add regression test for issue #2685 by @mvdan in 36046aa
  • cue/testdata: add a regression test for issue #3842 by @mvdan in 69c4adb
  • cue/ast: add walkNilable and applyNilable helpers by @mvdan in 8f927f8
  • cmd/cue: remove all "not yet stable" cue mod notes by @mvdan in b408552
  • cmd/cue: quote Go field tags if they are invalid CUE attribute bodies by @mvdan in 602eb31
  • cmd/cue: test how cue get go generates invalid CUE attributes by @mvdan in 034e892
  • cue/cuecontext: write a short package godoc by @mvdan in d7dda01
  • cmd/cue: stabilize mod registry, rename, mirror by @mvdan in aa9f32b
  • cue/ast,mod/modfile: add two more go:fix inline directives by @mvdan in 22bc4bb
  • cue/parser: delay ast.Field allocation in parseField by @mvdan in fa2bca6
  • CONTRIBUTING: fix links and tweak the wording by @mvdan in 0a9e071
  • cue: indirect the Go value before checking for null or noncrete by @mvdan in 2e994df
  • cue: add more test cases to TestDecode by @mvdan in 92e5046
  • cmd/cue: ensure that cue get go results in valid CUE by @mvdan in f7a5764
  • cmd/cue: Go types implementing a supported interface are themselves supported by @mvdan in 8d099aa
  • cue/ast: remove Node.Comments and Node.AddComment by @mvdan in 21abc7f
  • tools/flow: support task results when defined via definitions by @mvdan in 3d8f535
  • cmd/cue: add test case for issue #2633 by @mvdan in 2ae2665
  • cue/literal: accept #"""# as a quoted double quote by @mvdan in 81b11af
  • cmd/cue: fix regression with unsupported named types by @mvdan in 3092bd8
  • cmd/cue: skip over type aliases more precisely by @mvdan in a8553f7
  • cmd/cue: minor get go cleanups by @mvdan in c4464c0
  • cmd/cue: remove types.Invalid checks by @mvdan in 6bb634d
  • internal/ci: remove commit @-mention check by @mvdan in f1f7a95
  • internal/core/adt: fix typo by @rogpeppe in 9e46612
  • internal/core/adt: treat a call on a non-concrete func as incomplete by @rogpeppe in 8c751bd
  • internal/filetypes: support openOnlyWhenExplicit tag by @rogpeppe in 7603138
  • internal/core/adt: join overlayContext's vertices with vertexMap by @mvdan in ac52bda
  • internal/core/toposort: avoid repeating structInfos in nodeToStructMetas by @mvdan in 642b242
  • internal/core/toposort: avoid repeated ast.Node.Pos calls by @mvdan in df8ffc1
  • all: replace cue.Value.Null with IsNull when we just need a bool by @mvdan in 9461bd2
  • internal: remove unnecessary Pos methods by @mvdan in e190842
  • all: use cue/token.Pos.IsValid rather than comparing with NoPos by @mvdan in 550abc9
  • all: make use of adt.Pos consistently by @mvdan in 132e8b9
  • internal/core: various minor cleanups by @mvdan in e018a99
  • cmd/cue: fix non-null map values being detected as nullable by @fionera in 50371eb
  • internal/core/adt: remove Env and CloseInfo from StructInfo by @mvdan in eecd7f7
  • internal/core/adt: deduplicate Vertex.Structs by StructLit by @mvdan in feb4772
  • cue/ast: correct valid values for BasicLit.Kind by @mvdan in 9c4df5d
  • internal/core/adt: apply TODO to remove getArc call from addConstraint by @mvdan in 6423379
  • internal/core/adt: introduce ConflictError by @mvdan in f6ae883
  • cmd/cue: detect kubernetes semantics for get go by @fionera in e527387
  • cmd/cue: add kubernetes semantics test by @fionera in 2b34ff2
  • internal/core/convert: reuse unicode.UTF8.NewEncoder by @mvdan in 2b80cb1
  • .claude: expand the list of allowed commands by @mvdan in 856d441
  • internal/core/adt: check opID before inheriting parent reqSets by @mvdan in 2a257d3
  • internal/core/adt: avoid allocations in Vertex.Default for closed lists by @mvdan in d2bed8d
  • internal/core/adt: track containment positions separately by @mvdan in 5afb0e2
  • internal/core/adt: reuse task objects within an OpContext by @mvdan in 8f38c62
  • internal/core/adt: allocate Vertex with space for one conjunct in getArc by @mvdan in 2e95b2d
  • internal/core/adt: simplify nodeContext.arcMap by @mvdan in a89014d
  • internal/core/adt: store token.Pos rather than Node in containment by @mvdan in 21006f9
  • internal/core/adt: avoid adding replacements with replaceID.from == 0 by @mvdan in 5c715cf
  • internal/core/adt: implement CycleInfo.IsCyclic TODO by @mvdan in 5625367
  • internal/cmd/cue-ast,internal/astinternal: support printing positions by @rogpeppe in 84fc284
  • cue/ast: Correct Interpolation.End() by @cuematthew in 2b9f396
  • update all dependencies by @mvdan in 7f31475
  • internal/core/adt: simplify func declarations now that evalv2 is gone by @mvdan in 174e758
  • internal/core/adt: add reqSets.elemPtrs by @mvdan in c458d79
  • internal/core/adt: use append-like func signatures for reqSets by @mvdan in 8cd77ff
  • internal/core/adt: grow reqSets ahead of time in getReqSets by @mvdan in 8c0dfb2
  • internal/source: return a size when Open is given an os.File as src by @mvdan in 4d54b90
  • internal/encoding: do not grow byte slices when reading source files by @mvdan in 8e672f0
  • internal/source: do not guarantee io.Closer in Open by @mvdan in 95a9687
  • internal/core/convert: do not create new cue/ast source nodes by @mvdan in 4ad2928
  • internal/value: redesign Interface to avoid allocations by @mvdan in b32e411
  • internal/core/convert: avoid reflect.Value.Seq2 for slices by @mvdan in 89f45c0
  • internal/core/convert: grow slices for Go structs and slices by @mvdan in 65503c7
  • internal/core/adt: grow Vertex.Arcs in scheduleStruct by @mvdan in 0f5a5a9
  • internal/core/adt: grow Vertex.Arcs in processListLit by @mvdan in 03bb83a
  • internal/core/convert: avoid making unnecessary vertex copies by @mvdan in fd794c6
  • internal/core/toposort: make Node.sccNodeState a non-pointer by @mvdan in f86ad4c
  • internal/core/adt: reduce allocations further in SimplifyBounds by @mvdan in b7cdff9
  • internal/core/adt: SimplifyBounds can return nil by @mvdan in 4b035f7
  • internal/core/toposort: return a slice of non-pointers in analyseStructs by @mvdan in c01ccba
  • internal/core/toposort: remove Node.Incoming by @mvdan in 35e1c06
  • internal/core/convert: refactor fromGoValue to only use reflect.Value by @mvdan in b871500
  • internal/core/compile: don't panic on an alias cycle with a dynamic field by @mvdan in cfb185d
  • internal/core/adt: reuse a buffer when constructing envDisjunct.disjuncts by @mvdan in 6c5ade3
  • internal/core/adt: simplify filterSets and filterTop a bit by @mvdan in 368a7cb
  • internal/core/adt: use an uint64 key in containsDefIDCache by @mvdan in 561dfd8
  • internal/core/adt: optimize containsDefIDRec with minimum replaceID tracking by @mvdan in 3f6922f
  • internal/core/compile: revert and to use Func instead of RawFunc by @mvdan in 3a51f9d
  • cue/testdata: add test case for #3719 by @mvdan in 018a8e9
  • internal/core/subsume: fix duplicate logic for pattern constraints by @mvdan in 91c5b47
  • internal/core/subsume: add test cases for pattern constraints by @mvdan in 01cf686
  • internal/filetypes: use a less generic bootstrap build tag by @mvdan in 29a4a17
  • lsp/definitions: correct evaluation of import statements by @cuematthew in 99ed6c5
  • lsp/definitions: add test showing bad behaviour for import statements by @cuematthew in b0a088f
  • lsp/definitions: improve UsagesForOffset for imports by @cuematthew in 6df6f67
  • internal/lsp: implement support for LSP Diagnostics by @cuematthew in d078bc3
  • internal/lsp: implement support for LSP DocumentSymbols by @cuematthew in e2c4321
  • internal/core/convert: remove goConverter by @mvdan in 1a6ae7a
  • internal/core/convert: stop setting positions in cue/ast nodes by @mvdan in 8b96db8
  • internal/core/export: add a test to ensure toposort keeps Go field order by @mvdan in 376faa9
  • cmd/cue: do not emit empty CUE files in get go again by @mvdan in e03d16f
  • cmd/cue: test that we don't emit empty CUE files without --outfile by @mvdan in 6532a5d
  • internal/core/adt: check removed scope per conjunct by @mvdan in b9bf6a8
  • cue/testdata: add a test case for #4180 by @mvdan in b0748e0
  • pkg/strconv: re-run CUE_UPDATE=1 go test by @mvdan in 9b36f79
  • internal/core/convert: simplify the top-level FromGoType logic by @mvdan in e623e78
  • internal/core/convert: reduce from 3 func APIs to 2 by @mvdan in 9aec0fd
  • cue: convert.GoValueToValue returns a finalized value by @mvdan in fe628cc
  • internal/core/convert: stop accepting reflect.Value as a Go value by @mvdan in 467f82a
  • pkg/strconv: add ParseNumber builtin by @cjorge-graphops in aec0116
  • cue/parser: remove deprecated integer version APIs by @mvdan in 5e7258e
  • cue: add happy paths to Value.getNum and Value.String by @mvdan in a97a229
  • internal/pkg: add a happy path to CallCtxt.BigInt by @mvdan in 31ca887
  • internal/core/adt: remove support for CUE_EXPERIMENT=keepvalidators=0 by @mvdan in bff5146
  • cmd/cue: stabilize CUE_EXPERIMENT=cmdreferencepkg by @mvdan in fa74fb6
  • cmd/cue: rewrite tool/http test to not rely on an internal httptest server by @mvdan in 9587a47
  • cmd/cue: clarify help wording about filenames containing colons by @mvdan in 1039c59
  • internal/filetypes: support absolute paths with colons on Unix by @mvdan in 196a5d5
  • internal/filetypes: add test cases for absolute paths with colons by @mvdan in 5923272
  • cmd/cue: try to deflake stats test on CI by @mvdan in 8eab7c6
  • cmd/cue: add smoke tests for CUE_STATS_FILE and CUE_BENCH by @mvdan in 2c0184f
  • cmd/cue: reuse fetchStats for CUE_BENCH by @mvdan in 84e3e9c
  • cmd/cue: include syscall.Rusage stats in CUE_STATS by @mvdan in fb96f96
  • cmd/cue: move fetching of Stats numbers into a separate func by @mvdan in 23ef274
  • lsp/fscache: improve removal of phantom package decls by @cuematthew in 1449cca
  • cue/ast: remove deprecated and unhelpful Field node fields by @mvdan in 79b757d
  • internal/lsp: format standalone files without phantom pkg names by @cuematthew in f22fe29
  • cmd/cue: remove the deprecated --strict flag by @mvdan in f0a1fbe
  • lsp/definitions: correct resolution of path roots by @cuematthew in 7ee5478
  • lsp/definitions: add test to show faulty resolution by @cuematthew in b05b992
  • cue: remove the two last evalv2 remnants by @mvdan in 2b1f4ac
  • internal/core/adt: reduce slice allocations in nodeContext.getValidators by @mvdan in d273ee5
  • .claude: allow git grep by @mvdan in 842db84
  • internal/pkg: add happy path shortcuts for CallCtxt argument getters by @mvdan in 86c5472
  • internal/core/adt: reuse more Bool allocations by @mvdan in 8305967
  • internal/core/convert: don't allocate when checking for types.Interface by @mvdan in 7742329
  • internal/core/adt: reduce allocs on BinOp for boolean operators by @mvdan in 5d18599
  • internal/filetypes: make ParseArgs more consistent with ParseFile by @mvdan in 5d64a2b
  • internal/filetypes: clarify empty scope error in ParseFile by @mvdan in eb0f40d
  • internal/filetypes: support Windows absolute paths in ParseFile by @mvdan in f9439f5
  • internal/filetypes: test an empty scope and filename consistently by @mvdan in 003bf39
  • internal/filetypes: add test cases exposing issue 4168 by @mvdan in 1a3fdb8
  • internal/cueversion: bump LanguageVersion to v0.16.0 by @mvdan in 1d77a81
  • lsp/cache: stop nested modules from breaking find-references by @cuematthew in 2c9c7d1
  • internal/core/adt: only do a containsDefIDCache map lookup if caching by @mvdan in 3caae9e
  • internal/core/adt: sort replaceIDs to scan just once in containsDefIDRec by @mvdan in 326891f
  • internal/core/adt: refactor overlayContext.derefDisjunctsEnv away by @mvdan in b08d1d0
  • internal/core/adt: cache containsDefID results in OpContext by @mvdan in ff3c4dc
  • all: go fix -stringsbuilder ./... by @mvdan in 8652b30
  • cmd/cue: go fix -stditerators ./... by @mvdan in 129aff5
  • all: go fix -forvar ./... by @mvdan in 03b6d6e

Don't miss a new cue release

NewReleases is sending notifications on new releases.