Skip to content

Commit

Permalink
docs/concept: reflect always-enabled "new" modules
Browse files Browse the repository at this point in the history
This updates the new-vs-old modules FAQ with details of the removal of
the option to revert to old modules using the CUE_EXPERIMENT environment
variable in CUE 0.11 and later.

Preview-Path: /docs/concept/faq/new-modules-vs-old-modules/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: I2e7a9e71c7024277e912f6c8bc6550ed0967c6f8
Dispatch-Trailer: {"type":"trybot","CL":1200689,"patchset":1,"ref":"refs/changes/89/1200689/1","targetBranch":"master"}
  • Loading branch information
jpluscplusm authored and cueckoo committed Sep 4, 2024
1 parent 901aa17 commit 5a72373
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 30 deletions.
25 changes: 10 additions & 15 deletions content/docs/concept/faq/new-modules-vs-old-modules/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,26 @@ a number of design and proposal iterations. These culminated in the
experimental implementation in pre-releases of the v0.8.x series from version
[`v0.8.0-alpha.1`](/releases/v0.8.0-alpha.1) in February 2024.
Old modules remained the default behaviour at this time, but the experimental
implementation could be enabled by setting the
[environment variable `CUE_EXPERIMENT=modules`]({{< relref "/docs/reference/command/cue-help-environment" >}}).
implementation could be enabled by setting the environment variable
`CUE_EXPERIMENT=modules`.

In May 2024, after extensive testing and feedback from users, the modules
proposal v3 was
[accepted](https://github.com/cue-lang/cue/discussions/2939#discussioncomment-9468945).
At this time we started referring to the experimental implementation that
supported the v3 proposal as "new" modules, to reflect the change away from it
being an experiment. The default behaviour was still that of old modules, with
"new" modules being enabled using the same
[environment variable]({{< relref "/docs/reference/command/cue-help-environment" >}})
as before.
"new" modules being enabled using the same `CUE_EXPERIMENT=modules` environment
variable as before.

At the start of June 2024 CUE [v0.9.0](/releases/v0.9.0) was released. It
changed CUE's default behaviour - new modules were now enabled out of the box.
This removed the need to enable them manually, but folks needing old
modules in v0.9.0 or later could set
[`CUE_EXPERIMENT=modules=0`]({{< relref "/docs/reference/command/cue-help-environment" >}})
to revert to old modules behaviour.
This removed the need to enable them manually, but folks needing old modules in
CUE 0.9 or 0.10 could set `CUE_EXPERIMENT=modules=0` to revert to the old
behaviour.

At some point in the future, support for old modules will be removed entirely,
so we encourage you to explore and adopt them before then!
Support for old modules was removed entirely from CUE 0.11 and later, and
setting `CUE_EXPERIMENT=modules=0` now causes an error.

## Modules? Where do I get started?

Expand Down Expand Up @@ -115,10 +113,7 @@ In some cases, the above suggestion to use `cue mod fix` to migrate the
are using the CUE Go API and need to interpret older CUE code. There is now an
`AcceptLegacyModules` field in the `cue/load.Config` struct that can direct the
loader to fix the main module's `module.cue` file automatically without the
need to change it on disk. It is also still possible to disable the modules
experiment and revert to older modules resolution logic throughout by setting
the environment variable `CUE_EXPERIMENT=modules=0`, although this option will
be removed in time.
need to change it on disk.

## Why do I need to specify a source to publish a module?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,26 @@ a number of design and proposal iterations. These culminated in the
experimental implementation in pre-releases of the v0.8.x series from version
[`v0.8.0-alpha.1`](/releases/v0.8.0-alpha.1) in February 2024.
Old modules remained the default behaviour at this time, but the experimental
implementation could be enabled by setting the
[environment variable `CUE_EXPERIMENT=modules`]({{< relref "/docs/reference/command/cue-help-environment" >}}).
implementation could be enabled by setting the environment variable
`CUE_EXPERIMENT=modules`.

In May 2024, after extensive testing and feedback from users, the modules
proposal v3 was
[accepted](https://github.com/cue-lang/cue/discussions/2939#discussioncomment-9468945).
At this time we started referring to the experimental implementation that
supported the v3 proposal as "new" modules, to reflect the change away from it
being an experiment. The default behaviour was still that of old modules, with
"new" modules being enabled using the same
[environment variable]({{< relref "/docs/reference/command/cue-help-environment" >}})
as before.
"new" modules being enabled using the same `CUE_EXPERIMENT=modules` environment
variable as before.

At the start of June 2024 CUE [v0.9.0](/releases/v0.9.0) was released. It
changed CUE's default behaviour - new modules were now enabled out of the box.
This removed the need to enable them manually, but folks needing old
modules in v0.9.0 or later could set
[`CUE_EXPERIMENT=modules=0`]({{< relref "/docs/reference/command/cue-help-environment" >}})
to revert to old modules behaviour.
This removed the need to enable them manually, but folks needing old modules in
CUE 0.9 or 0.10 could set `CUE_EXPERIMENT=modules=0` to revert to the old
behaviour.

At some point in the future, support for old modules will be removed entirely,
so we encourage you to explore and adopt them before then!
Support for old modules was removed entirely from CUE 0.11 and later, and
setting `CUE_EXPERIMENT=modules=0` now causes an error.

## Modules? Where do I get started?

Expand Down Expand Up @@ -115,10 +113,7 @@ In some cases, the above suggestion to use `cue mod fix` to migrate the
are using the CUE Go API and need to interpret older CUE code. There is now an
`AcceptLegacyModules` field in the `cue/load.Config` struct that can direct the
loader to fix the main module's `module.cue` file automatically without the
need to change it on disk. It is also still possible to disable the modules
experiment and revert to older modules resolution logic throughout by setting
the environment variable `CUE_EXPERIMENT=modules=0`, although this option will
be removed in time.
need to change it on disk.

## Why do I need to specify a source to publish a module?

Expand Down

0 comments on commit 5a72373

Please sign in to comment.