Skip to content

Commit e6faaed

Browse files
Rename nextflow.preview.types feature flag to nextflow.enable.types (#7067)
Co-authored-by: Ben Sherman <bentshermann@gmail.com>
1 parent 5304510 commit e6faaed

35 files changed

Lines changed: 105 additions & 123 deletions

adr/20251017-typed-processes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ Moving topic emissions to a dedicated section allows them to be defined without
245245

246246
## Distinguishing between typed and legacy processes
247247

248-
Typed processes are gated behind the `nextflow.preview.types` feature flag. This flag will be replaced by `nextflow.enable.types` when the feature becomes stable, which will be used to distinguish between typed and legacy processes in the language.
248+
Typed processes are gated behind the `nextflow.enable.types` feature flag, in order to distinguish between typed and legacy processes in the language.
249249

250250
When a script enables this feature flag, its processes are treated as typed processes; otherwise, its processes are treated as legacy processes. This way, typed and legacy processes cannot be mixed in the same script, but they can be used together as long as they are declared in different scripts.
251251

adr/20260306-record-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ process FASTQC {
341341

342342
This approach is syntactically more concise, and it re-uses the typed output syntax that was introduced in Nextflow 25.10.
343343

344-
However, with this approach, the same syntax can have different meanings depending on the surrounding context (e.g. presence/absence of the `nextflow.preview.types` feature flag), which can be confusing for both users and agents.
344+
However, with this approach, the same syntax can have different meanings depending on the surrounding context (e.g. presence/absence of the `nextflow.enable.types` feature flag), which can be confusing for both users and agents.
345345

346346
The `record()` approach works "out of the box", and it isn't much more verbose, so we decided that it is sufficient for now.
347347

adr/20260310-typed-workflows.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ Even the pipe (`|`), which is loved by many users, can rarely be used in its ide
8585

8686
Introduce **typed workflows**, which provide a streamlined syntax for workflows that supports static typing.
8787

88-
Typed workflows can be used with the `nextflow.preview.types` feature flag:
88+
Typed workflows can be used with the `nextflow.enable.types` feature flag:
8989

9090
```groovy
9191
// typed workflow
92-
nextflow.preview.types = true
92+
nextflow.enable.types = true
9393
9494
workflow HELLO {
9595
take:
@@ -131,7 +131,7 @@ The operator library is extended to support static typing and records:
131131

132132
All operators can be used with or without static typing, with some caveats:
133133

134-
- Some operators have stricter semantics when static typing is enabled via `nextflow.preview.types`. These changes are necessary in order to support static typing effectively. They should not affect the majority of existing code.
134+
- Some operators have stricter semantics when static typing is enabled via `nextflow.enable.types`. These changes are necessary in order to support static typing effectively. They should not affect the majority of existing code.
135135

136136
- Some operators are discouraged from use with static typing. While they can still be used, the type checker will not be able to validate them. Users should be encouraged to migrate away from them in favor of the *core operators* that are statically typed.
137137

@@ -219,7 +219,7 @@ This incremental approach was done in contrast to DSL2, which was a monolithic c
219219

220220
Most of the features for static typing are new concepts that can be used alongside existing code. However, typed processes and typed workflows modify existing concepts (`process` and `workflow` definitions), so they require a feature flag.
221221

222-
The `nextflow.enable.types` feature flag (currently in preview as `nextflow.preview.types`) will be used to distinguish between typed and legacy code, indefinitely. It would only be removed if the support for legacy syntax was removed, which is unlikely since DSL2 has been the standard Nextflow syntax for many years.
222+
The `nextflow.enable.types` feature flag will be used to distinguish between typed and legacy code, indefinitely. It would only be removed if the support for legacy syntax was removed, which is unlikely since DSL2 has been the standard Nextflow syntax for many years.
223223

224224
To help distinguish between typed and legacy workflows, the use of type annotations should be allowed only for typed workflows:
225225

@@ -239,7 +239,7 @@ workflow greet {
239239

240240
```groovy
241241
// typed workflow
242-
nextflow.preview.types = true
242+
nextflow.enable.types = true
243243
244244
workflow greet {
245245
take:
@@ -261,7 +261,7 @@ Typed and legacy workflows use different underlying dataflow types:
261261

262262
- **Typed workflows (v2)** use wrapper types: `ChannelImpl` (wraps a `DataflowBroadcast`) and `ValueImpl` (wraps a `DataflowVariable`). These wrappers implement the new operators and integrate with the type system.
263263

264-
While a given script must be entirely typed or entirely legacy (controlled by the `nextflow.preview.types` flag), **typed and legacy workflows can call each other across different scripts**. This interoperability enables incremental migration -- individual scripts can be migrated to static typing without having to update the entire pipeline at once.
264+
While a given script must be entirely typed or entirely legacy (controlled by the `nextflow.enable.types` flag), **typed and legacy workflows can call each other across different scripts**. This interoperability enables incremental migration -- individual scripts can be migrated to static typing without having to update the entire pipeline at once.
265265

266266
### Normalization at call sites
267267

@@ -293,7 +293,7 @@ workflow LEGACY_ALIGN {
293293

294294
**`typed.nf`**
295295
```groovy
296-
nextflow.preview.types = true
296+
nextflow.enable.types = true
297297
298298
include { LEGACY_ALIGN } from './legacy'
299299
@@ -312,7 +312,7 @@ workflow {
312312

313313
**`typed.nf`**
314314
```groovy
315-
nextflow.preview.types = true
315+
nextflow.enable.types = true
316316
317317
workflow TYPED_TRIM {
318318
take:
@@ -371,7 +371,7 @@ workflow LEGACY_QC {
371371

372372
**`typed.nf`**
373373
```groovy
374-
nextflow.preview.types = true
374+
nextflow.enable.types = true
375375
376376
include { LEGACY_QC } from './legacy'
377377

docs/migrations/26-04.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@ See {ref}`script-records` for details. See {ref}`migrating-static-types` for mor
9797
<h3>Static typing (preview)</h3>
9898

9999
:::{note}
100-
Typed processes and typed workflows require the `nextflow.preview.types` feature flag to be enabled in every script that uses them.
100+
Typed processes and typed workflows require the `nextflow.enable.types` feature flag to be enabled in every script that uses them.
101101
:::
102102

103103
Nextflow 26.04 brings full support for static typing with {ref}`typed processes <process-typed-page>` and {ref}`typed workflows <workflow-typed-page>`.
104104

105105
Typed processes can now declare record inputs and outputs:
106106

107107
```nextflow
108-
nextflow.preview.types = true
108+
nextflow.enable.types = true
109109
110110
process FASTQC {
111111
input:
@@ -129,7 +129,7 @@ process FASTQC {
129129
Typed workflows can declare typed inputs and outputs, and provide first-class support for static typing in dataflow logic:
130130

131131
```nextflow
132-
nextflow.preview.types = true
132+
nextflow.enable.types = true
133133
134134
workflow RNASEQ {
135135
take:
@@ -158,6 +158,10 @@ Several operators have been extended to support static typing and records:
158158

159159
Breaking changes from the {ref}`first preview <static-typing-first-preview>`:
160160

161+
- The `nextflow.preview.types` feature flag has been replaced with `nextflow.enable.types`.
162+
163+
- The `nextflow.enable.types` feature flag must be enabled in order to use type annotations in workflow takes/emits.
164+
161165
- The syntax for process tuple inputs has been updated:
162166

163167
```nextflow
@@ -172,8 +176,6 @@ Breaking changes from the {ref}`first preview <static-typing-first-preview>`:
172176

173177
- The method signature for the `stageAs` directive was changed from `(filePattern, value)` to `(value, filePattern)`.
174178

175-
- The `nextflow.preview.types` feature flag must be enabled in order to use type annotations in workflow takes/emits.
176-
177179
See {ref}`migrating-static-types` for more information about migrating to static typing. See {ref}`migrating-static-types-operators` for best practices on using operators with static typing.
178180

179181
## Enhancements

docs/process-typed.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Typed processes are a preview feature. The syntax and behavior may change in fut
1212
Typed processes use a new syntax for inputs and outputs that supports static typing.
1313

1414
```nextflow
15-
nextflow.preview.types = true
15+
nextflow.enable.types = true
1616
1717
process hello {
1818
input:
@@ -36,7 +36,7 @@ To use this feature:
3636
export NXF_SYNTAX_PARSER=v2
3737
```
3838

39-
2. Set `nextflow.preview.types = true` in every script that uses typed processes.
39+
2. Set `nextflow.enable.types = true` in every script that uses typed processes.
4040

4141
See {ref}`syntax-process-typed` for the complete syntax reference and {ref}`migrating-static-types` to migrate existing code to static typing.
4242

docs/reference/channel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ A *topic channel* is a channel that can receive values from many sources *implic
354354
A typed process can emit values to a topic using the `topic:` section:
355355

356356
```nextflow
357-
nextflow.preview.types = true
357+
nextflow.enable.types = true
358358
359359
process hello {
360360
topic:

docs/reference/feature-flags.md

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
# Feature flags
44

5-
Feature flags enable experimental or other opt-in features. They must be specified in the pipeline script.
5+
Feature flags enable opt-in features. They must be specified in the pipeline script.
66

77
:::{warning}
8-
Feature flags with the `nextflow.preview` prefix can cause pipelines run with newer versions of Nextflow to fail due to breaking changes. Always consult the {ref}`migration notes <migrations-page>` before updating to a new Nextflow version.
8+
Feature flags marked as *preview* can cause pipelines run with newer versions of Nextflow to fail due to breaking changes. Always consult the {ref}`migration notes <migrations-page>` before updating to a new Nextflow version.
99
:::
1010

1111
`nextflow.enable.configProcessNamesValidation`
@@ -49,28 +49,8 @@ Feature flags with the `nextflow.preview` prefix can cause pipelines run with ne
4949

5050
- Nextflow will fail if multiple functions and/or processes with the same name are defined in a module script
5151

52-
`nextflow.preview.output`
53-
: :::{versionadded} 24.04.0
54-
:::
55-
: :::{deprecated} 25.10.0
56-
This feature flag is no longer supported. Workflow outputs are out of preview.
57-
:::
58-
: When `true`, enables the use of {ref}`workflow outputs <workflow-output-def>`.
59-
60-
`nextflow.preview.recursion`
61-
: *Preview feature: the syntax and behavior may change in future releases.*
62-
: When `true`, enables {ref}`process and workflow recursion <workflow-recursion>`.
63-
64-
`nextflow.preview.topic`
65-
: :::{versionadded} 24.04.0
66-
:::
67-
: :::{deprecated} 25.04.0
68-
This feature flag is no longer supported. Topic channels are out of preview.
69-
:::
70-
: When `true`, enables the use of {ref}`topic channels <channel-topic>`.
71-
72-
`nextflow.preview.types`
73-
: :::{versionadded} 25.10.0
52+
`nextflow.enable.types`
53+
: :::{versionadded} 26.04.0
7454
:::
7555
: *Preview feature: the syntax and behavior may change in future releases.*
7656
: When `true`, enables the use of {ref}`typed processes <process-typed-page>` and {ref}`typed workflows <workflow-typed-page>`. Must be enabled in every script that uses typed processes/workflows. Legacy processes/workflows cannot be defined in scripts with this flag enabled.

docs/reference/operator.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ The `collect` operator behaves differently from `toList` in the following ways:
208208
- `collect` flattens collected values whereas `toList` does not.
209209

210210
:::{note}
211-
When static typing is enabled via `nextflow.preview.types`, `collect` behaves the same way as `toList`.
211+
When static typing is enabled via `nextflow.enable.types`, `collect` behaves the same way as `toList`.
212212
:::
213213

214214
## collectFile
@@ -527,7 +527,7 @@ When the mapping function returns a map, each key-value pair in the map is emitt
527527
```
528528

529529
:::{note}
530-
When static typing is enabled via `nextflow.preview.types`, `flatMap` does not flatten maps or tuples.
530+
When static typing is enabled via `nextflow.enable.types`, `flatMap` does not flatten maps or tuples.
531531
:::
532532

533533
(operator-flatten)=
@@ -728,7 +728,7 @@ The `map` operator applies a *mapping function* to each item from a source chann
728728
```
729729

730730
:::{note}
731-
By default, null values are not emitted by `map`. When static typing is enabled via `nextflow.preview.types`, null values are emitted.
731+
By default, null values are not emitted by `map`. When static typing is enabled via `nextflow.enable.types`, null values are emitted.
732732
:::
733733

734734
(operator-max)=

docs/reference/process.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ The following task properties are defined in the process body:
6363
:::
6464

6565
:::{note}
66-
Typed processes require the `nextflow.preview.types` feature flag to be enabled in every script that uses them. The syntax and behavior may change in future releases.
66+
Typed processes require the `nextflow.enable.types` feature flag to be enabled in every script that uses them.
6767
:::
6868

6969
### Stage directives

docs/reference/syntax.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ Entry workflow definitions are ignored when a script is included as a module. Th
205205
A typed workflow is a workflow that uses static typing for inputs and outputs:
206206

207207
```nextflow
208-
nextflow.preview.types = true
208+
nextflow.enable.types = true
209209
210210
workflow greet {
211211
take:
@@ -303,7 +303,7 @@ See {ref}`process-page` for more information on the semantics of each process se
303303
A typed process is a process that uses static typing for inputs and outputs:
304304

305305
```nextflow
306-
nextflow.preview.types = true
306+
nextflow.enable.types = true
307307
308308
process greet {
309309
input:

0 commit comments

Comments
 (0)