Skip to content

Commit 4407709

Browse files
pditommasoclaude
andcommitted
Rename nextflow.preview.types flag to nextflow.enable.types
Renames the static-typing feature flag and associated field (`previewTypes` → `enableTypes`) across sources, tests, integration `.nf` scripts, and documentation. The existing `log.warn` in `BaseScript.enableTyping()` still clarifies that static typing remains a preview feature. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
1 parent da06e9a commit 4407709

36 files changed

Lines changed: 94 additions & 94 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. 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.
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 (currently in preview as `nextflow.enable.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.
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/25-10.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def isSraId(id: String) -> Boolean {
100100
}
101101
102102
// feature flag required for typed processes
103-
nextflow.preview.types = true
103+
nextflow.enable.types = true
104104
105105
process fastqc {
106106
input:

docs/migrations/26-04.md

Lines changed: 4 additions & 4 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:
@@ -172,7 +172,7 @@ Breaking changes from the {ref}`first preview <static-typing-first-preview>`:
172172

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

175-
- The `nextflow.preview.types` feature flag must be enabled in order to use type annotations in workflow takes/emits.
175+
- The `nextflow.enable.types` feature flag must be enabled in order to use type annotations in workflow takes/emits.
176176

177177
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.
178178

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Feature flags with the `nextflow.preview` prefix can cause pipelines run with ne
6969
:::
7070
: When `true`, enables the use of {ref}`topic channels <channel-topic>`.
7171

72-
`nextflow.preview.types`
72+
`nextflow.enable.types`
7373
: :::{versionadded} 25.10.0
7474
:::
7575
: *Preview feature: the syntax and behavior may change in future releases.*

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. The syntax and behavior may change in future releases.
6767
:::
6868

6969
### Stage directives

0 commit comments

Comments
 (0)