Skip to content

v0.8.0-alpha.1

Pre-release
Pre-release
Compare
Choose a tag to compare
@cueckoo cueckoo released this 13 Feb 10:10
· 1209 commits to master since this release

This release includes experimental support for CUE Modules (more details below), as well as a number of improvements and fixes.

More CLs and refactors have also landed for the core evaluator's performance work; they aren't enabled yet as the work isn't complete.

As a reminder: users can register their projects with Unity, our regression and performance testing setup. Unity is used to ensure that a project's CUE evaluations do not unexpectedly stop working, or regress in terms of performance. It continues to catch multiple issues with each release. Adding your project to Unity not only guarantees that we will not break your tests (if we do, we will work with you to fix your CUE code), but it also helps to improve the quality of each CUE release. Follow this link to learn more about Unity, install it, or get in touch with any questions.

Thank you to @4ad, @cedricgc, @jpluscplusm, @martingreber, @mpvl, @mvdan, @myitcv, @nickfiggins, @nnnkkk7, @rogpeppe, and @vikstrous for contributing to this release!

Modules

This release includes experimental support for CUE modules in cmd/cue, as outlined in the Modules and package management proposal. We are also working on v3 of the modules proposal docs to coincide with the release of v0.8.0.

Alongside this release, we have published a tutorial on the new website which shows how to publish and fetch modules with a custom module registry.

We have also published the first version of the Modules reference documentation, the canonical documentation page describing how CUE modules work in detail.

Note that support for CUE modules is still experimental and subject to change, and needs to be explicitly enabled via CUE_EXPERIMENT=modules. See cue help environment for more information on the environment variables used below.

The cue mod tidy command is introduced, which rewrites cue.mod/module.cue in its canonical format, adds any missing module dependency requirements, and removes unused ones.

The cue mod publish command is also added. This publishes a version of the current module to a module registry.

When running commands like cue export with CUE_EXPERIMENT=modules, dependencies are automatically fetched from module registries following $CUE_REGISTRY and cached on disk.

Note that support for fetching modules from OCI registries via cue/load isn't ready yet; support for Go library users will be announced at a later time.

Go API

Note that this version of CUE requires Go 1.21 or later, following our policy to support the latest two stable Go releases just like upstream.

CL 1173271 drops support for legacy pkg directories, which have been deprecated since the transition to a cue.mod directory in 2019.

CL 1174069 replaces a few more uses of the deprecated cue.Instance type with cue.InstanceOrValue.

CL 1175779 deprecates the FileOffset and File.Base APIs in cue/token, which were inherited from go/token but never had any effect.

Language

There are no changes to the language in this version.

Spec

CL 1173197 makes the use of the term "builtin function" consistent across the document.

Core Evaluator

CL 1173262 fixed a regression introduced by v0.7.0's upgrade to github.com/cockroachdb/apd/v3 where some arithmetic operations would result in an extra 0 digit.

Encoders

CL 1173689 fixed the YAML encoder so that strings looking like hexadecimal numbers are properly quoted.

Builtins

CL 1173735 replaces the uses of Go's net package with net/netip when dealing with IP addresses, which makes them immutable, comparable, and take less memory.

CL 1173926 adds an IPv6 API to net to check that a value is a valid IPv6 address, mirroring IPv4 and taking advantage of the switch to the Go net/netip package.

CL 1174339 fixes tool/exec so that it correctly applies env defaults in CUE values.

CL 1174623 fixes tool/exec so that it accepts env list values as documented.

cmd/cue

CL 1173892 adds a cue help environment section to document the environment variables used by the CLI, such as CUE_EXPERIMENT and CUE_REGISTRY.

CL 1176665 fixes cue cmd so that legacy commands always get the corresponding CUE schema unified.

CL 1176194 starts adding a language.version field to cue.mod/module.cue, to start tracking what CUE language version a module's config files were written for. This will become necessary to make future language changes as smooth as possible for CUE users. For example, running cue mod init or cue mod tidy with the future CUE v0.8.0 release should add language: version: "v0.8.0" when the field isn't present.

Full list of changes since v0.7.1