Skip to content

Commit bbbe023

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 bbbe023

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

doc/api/cli.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3389,8 +3389,6 @@ Any other value will result in colorized output being disabled.
33893389
added: v22.1.0
33903390
-->
33913391

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

doc/api/module.md

Lines changed: 5 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
@@ -451,8 +456,6 @@ separately if the same base directory is used to persist the cache, so they can
451456
added: v22.8.0
452457
-->
453458
454-
> Stability: 1.1 - Active Development
455-
456459
The following constants are returned as the `status` field in the object returned by
457460
[`module.enableCompileCache()`][] to indicate the result of the attempt to enable the
458461
[module compile cache][].
@@ -511,8 +514,6 @@ changes:
511514
description: Rename the unreleased `path` option to `directory` to maintain consistency.
512515
-->
513516
514-
> Stability: 1.1 - Active Development
515-
516517
* `options` {string|Object} Optional. If a string is passed, it is considered to be `options.directory`.
517518
* `directory` {string} Optional. Directory to store the compile cache. If not specified,
518519
the directory specified by the [`NODE_COMPILE_CACHE=dir`][] environment variable
@@ -559,8 +560,6 @@ added:
559560
- v22.10.0
560561
-->
561562
562-
> Stability: 1.1 - Active Development
563-
564563
Flush the [module compile cache][] accumulated from modules already loaded
565564
in the current Node.js instance to disk. This returns after all the flushing
566565
file system operations come to an end, no matter they succeed or not. If there
@@ -573,8 +572,6 @@ interfere with the actual operation of the application.
573572
added: v22.8.0
574573
-->
575574
576-
> Stability: 1.1 - Active Development
577-
578575
* Returns: {string|undefined} Path to the [module compile cache][] directory if it is enabled,
579576
or `undefined` otherwise.
580577

0 commit comments

Comments
 (0)