Skip to content

Commit 6fe701c

Browse files
committed
Add experimental feature warning to stdlib module and language reference
1 parent 475e13f commit 6fe701c

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

docs/modules/language-reference/pages/index.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5951,6 +5951,14 @@ To fully set up mirroring, an HTTP(s) server will need be running, and which mir
59515951
[[references]]
59525952
=== References
59535953

5954+
[WARNING]
5955+
.Experimenal Feature
5956+
====
5957+
The API and semantics of references are subject to change in a future release.
5958+
The Pkl team is soliciting feedback from authors of libraries considering adopting references.
5959+
For questions and feedback, please reach out via https://github.com/apple/pkl/discussions[GitHub Discussions] or https://github.com/apple/pkl/issues/new[create an issue].
5960+
====
5961+
59545962
pkldoc:Reference[pkl:ref]s (provided by the `pkl.ref` module) are an advanced API design tool that serves use cases where configuration must refer to values that are not known at evaluation time.
59555963
This is common in task-based execution systems like CI platforms and Infrastructure as Code (IaC) tools.
59565964
Today, many such systems encode this kind of reference using strings containing an expression language; this approach makes it difficult to write and debug such references, as target systems may not know where in the Pkl source an error occurred.

stdlib/ref.pkl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,23 @@
2020
/// domain-specific references to values that may not be known during evaluation.
2121
/// They are particularly suited for configuring execution systems where tasks have well-typed
2222
/// inputs and output.
23+
///
24+
/// WARNING: The API and semantics of references are subject to change in a future release.
25+
/// The Pkl team is soliciting feedback from authors of libraries considering adopting references.
26+
/// For questions and feedback, please reach out via
27+
/// [GitHub Discussions](https://github.com/apple/pkl/discussions) or
28+
/// [create an issue](https://github.com/apple/pkl/issues/new).
2329
@ModuleInfo { minPklVersion = "0.32.0" }
2430
module pkl.ref
2531

2632
/// Creates a deferred [Reference] to a value of type [class] in the given [domain].
2733
///
34+
/// WARNING: The API and semantics of references are subject to change in a future release.
35+
/// The Pkl team is soliciting feedback from authors of libraries considering adopting references.
36+
/// For questions and feedback, please reach out via
37+
/// [GitHub Discussions](https://github.com/apple/pkl/discussions) or
38+
/// [create an issue](https://github.com/apple/pkl/issues/new).
39+
///
2840
/// References may only be constructed for single, non-generic class types.
2941
/// To create a reference to other types (generic classes, union, nullable, constrained,
3042
/// typealiases, etc.), it may be necessary to create a wrapper class with a property of the desired
@@ -48,6 +60,12 @@ external const function Reference<D, T>(
4860
/// References are an advanced API design tool that enables library authors to express
4961
/// domain-specific references to values that may not be known during evaluation.
5062
///
63+
/// WARNING: The API and semantics of references are subject to change in a future release.
64+
/// The Pkl team is soliciting feedback from authors of libraries considering adopting references.
65+
/// For questions and feedback, please reach out via
66+
/// [GitHub Discussions](https://github.com/apple/pkl/discussions) or
67+
/// [create an issue](https://github.com/apple/pkl/issues/new).
68+
///
5169
/// Instances are created with the [Reference()] constructor method.
5270
/// References consist of four parts:
5371
/// * [Domain]: determines which references are compatible and how references are rendered

0 commit comments

Comments
 (0)