Skip to content

Commit 2fe3d6b

Browse files
committed
module: mark module compile cache as stable
The feature set has been stable without any breaking changes in the past year, and it's been depended enough in the wild by popular packages that we'll likely need to treat any breakages as semver-major in the future anyway. The future TODOs are likely all non-breaking. Potential subtle breakages in implementation details that should not be relied upon (such as the cache layout) are explicitly excluded from the contract. We'll investigate whether it can be enabled by default as a different topic, which can be potentially semver-major.
1 parent 85852a3 commit 2fe3d6b

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

doc/api/cli.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3387,10 +3387,12 @@ Any other value will result in colorized output being disabled.
33873387

33883388
<!-- YAML
33893389
added: v22.1.0
3390+
changes:
3391+
- version: REPLACEME
3392+
pr-url: https://github.com/nodejs/node/pull/60971
3393+
description: This feature is no longer experimental.
33903394
-->
33913395

3392-
> Stability: 1.1 - Active Development
3393-
33943396
Enable the [module compile cache][] for the Node.js instance. See the documentation of
33953397
[module compile cache][] for details.
33963398

doc/api/module.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,11 @@ to disk when the Node.js instance is about to exit. This is subject to change. T
410410
is flushed to disk in case the application wants to spawn other Node.js instances
411411
and let them share the cache long before the parent exits.
412412
413+
The compile cache layout on disk is an implementation detail and should not be
414+
relied upon. The compile cache generated is typically only reusable in the same
415+
version of Node.js, and should be not assumed to be compatible across different
416+
versions of Node.js.
417+
413418
### Portability of the compile cache
414419
415420
By default, caches are invalidated when the absolute paths of the modules being
@@ -449,10 +454,12 @@ separately if the same base directory is used to persist the cache, so they can
449454
450455
<!-- YAML
451456
added: v22.8.0
457+
changes:
458+
- version: REPLACEME
459+
pr-url: https://github.com/nodejs/node/pull/60971
460+
description: This feature is no longer experimental.
452461
-->
453462
454-
> Stability: 1.1 - Active Development
455-
456463
The following constants are returned as the `status` field in the object returned by
457464
[`module.enableCompileCache()`][] to indicate the result of the attempt to enable the
458465
[module compile cache][].
@@ -503,6 +510,9 @@ The following constants are returned as the `status` field in the object returne
503510
<!-- YAML
504511
added: v22.8.0
505512
changes:
513+
- version: REPLACEME
514+
pr-url: https://github.com/nodejs/node/pull/60971
515+
description: This feature is no longer experimental.
506516
- version: v25.0.0
507517
pr-url: https://github.com/nodejs/node/pull/58797
508518
description: Add `portable` option to enable portable compile cache.
@@ -511,8 +521,6 @@ changes:
511521
description: Rename the unreleased `path` option to `directory` to maintain consistency.
512522
-->
513523
514-
> Stability: 1.1 - Active Development
515-
516524
* `options` {string|Object} Optional. If a string is passed, it is considered to be `options.directory`.
517525
* `directory` {string} Optional. Directory to store the compile cache. If not specified,
518526
the directory specified by the [`NODE_COMPILE_CACHE=dir`][] environment variable
@@ -557,10 +565,12 @@ be inherited into the child workers. The directory can be obtained either from t
557565
added:
558566
- v23.0.0
559567
- v22.10.0
568+
changes:
569+
- version: REPLACEME
570+
pr-url: https://github.com/nodejs/node/pull/60971
571+
description: This feature is no longer experimental.
560572
-->
561573
562-
> Stability: 1.1 - Active Development
563-
564574
Flush the [module compile cache][] accumulated from modules already loaded
565575
in the current Node.js instance to disk. This returns after all the flushing
566576
file system operations come to an end, no matter they succeed or not. If there
@@ -571,10 +581,12 @@ interfere with the actual operation of the application.
571581
572582
<!-- YAML
573583
added: v22.8.0
584+
changes:
585+
- version: REPLACEME
586+
pr-url: https://github.com/nodejs/node/pull/60971
587+
description: This feature is no longer experimental.
574588
-->
575589
576-
> Stability: 1.1 - Active Development
577-
578590
* Returns: {string|undefined} Path to the [module compile cache][] directory if it is enabled,
579591
or `undefined` otherwise.
580592

0 commit comments

Comments
 (0)