diff --git a/pages/v5.x/globals.md b/pages/v5.x/globals.md index ec120c0..dd2cc4b 100644 --- a/pages/v5.x/globals.md +++ b/pages/v5.x/globals.md @@ -362,11 +362,11 @@ After this method has succeeded the cache can only be restored when build depend #### `getChunkMaps(realHash)` +> Stability: 0 - Deprecated + * `realHash` {boolean} * Returns: {ChunkMaps} -##### Deprecated - #### `getChunkModuleMaps(filterFn)` * `filterFn` {object} @@ -957,52 +957,52 @@ After this method has succeeded the cache can only be restored when build depend #### Static method: `clearChunkGraphForChunk(chunk)` +> Stability: 0 - Deprecated + * `chunk` {Chunk} * Returns: {void} -##### Deprecated - #### Static method: `clearChunkGraphForModule(module)` +> Stability: 0 - Deprecated + * `module` {Module} * Returns: {void} -##### Deprecated - #### Static method: `getChunkGraphForChunk(chunk, deprecateMessage, deprecationCode)` +> Stability: 0 - Deprecated + * `chunk` {Chunk} * `deprecateMessage` {string} * `deprecationCode` {string} * Returns: {ChunkGraph} -##### Deprecated - #### Static method: `getChunkGraphForModule(module, deprecateMessage, deprecationCode)` +> Stability: 0 - Deprecated + * `module` {Module} * `deprecateMessage` {string} * `deprecationCode` {string} * Returns: {ChunkGraph} -##### Deprecated - #### Static method: `setChunkGraphForChunk(chunk, chunkGraph)` +> Stability: 0 - Deprecated + * `chunk` {Chunk} * `chunkGraph` {ChunkGraph} * Returns: {void} -##### Deprecated - #### Static method: `setChunkGraphForModule(module, chunkGraph)` +> Stability: 0 - Deprecated + * `module` {Module} * `chunkGraph` {ChunkGraph} * Returns: {void} -##### Deprecated - *** ## Class: `ChunkGroup` @@ -1542,11 +1542,11 @@ If `module` is passed, `loc` and `request` must also be passed. #### `assignDepth(module)` +> Stability: 0 - Deprecated + * `module` {Module} * Returns: {void} -##### Deprecated - #### `assignDepths(modules)` * `modules` {Set} @@ -2272,13 +2272,13 @@ implement this method to allow the occurrence order plugin to count correctly #### `getReference(moduleGraph)` +> Stability: 0 - Deprecated + * `moduleGraph` {ModuleGraph} * Returns: {never} Returns the referenced module and export -##### Deprecated - #### `getReferencedExports(moduleGraph, runtime)` * `moduleGraph` {ModuleGraph} @@ -3350,14 +3350,14 @@ This data will be passed to restoreFromUnsafeCache later. #### `needRebuild(fileTimestamps, contextTimestamps)` +> Stability: 0 - Deprecated + * `fileTimestamps` {Map} * `contextTimestamps` {Map} * Returns: {boolean} Use needBuild instead -##### Deprecated - #### `originalSource()` * Returns: {Source} @@ -3397,6 +3397,8 @@ restore unsafe cache data #### `source(dependencyTemplates, runtimeTemplate[, type])` +> Stability: 0 - Deprecated + * `dependencyTemplates` {DependencyTemplates} * `runtimeTemplate` {RuntimeTemplate} * `type` {string} @@ -3404,8 +3406,6 @@ restore unsafe cache data Use codeGeneration() instead -##### Deprecated - #### `updateCacheModule(module)` * `module` {Module} @@ -3423,13 +3423,13 @@ and properties. #### Static method: `getSourceBasicTypes(module)` +> Stability: 0 - Deprecated + * `module` {Module} * Returns: {ReadonlySet} In webpack 6, call getSourceBasicTypes() directly on the module instance instead of using this static method. -##### Deprecated - *** ## Class: `ExternalsPlugin` @@ -3678,11 +3678,11 @@ Apply the plugin #### `getChunkMaps(realHash)` +> Stability: 0 - Deprecated + * `realHash` {boolean} * Returns: {ChunkMaps} -##### Deprecated - #### `getChunkModuleMaps(filterFn)` * `filterFn` {object} @@ -4500,14 +4500,14 @@ This data will be passed to restoreFromUnsafeCache later. #### `needRebuild(fileTimestamps, contextTimestamps)` +> Stability: 0 - Deprecated + * `fileTimestamps` {Map} * `contextTimestamps` {Map} * Returns: {boolean} Use needBuild instead -##### Deprecated - #### `originalSource()` * Returns: {Source} @@ -4539,6 +4539,8 @@ Use needBuild instead #### `source(dependencyTemplates, runtimeTemplate[, type])` +> Stability: 0 - Deprecated + * `dependencyTemplates` {DependencyTemplates} * `runtimeTemplate` {RuntimeTemplate} * `type` {string} @@ -4546,8 +4548,6 @@ Use needBuild instead Use codeGeneration() instead -##### Deprecated - #### `updateCacheModule(module)` * `module` {Module} @@ -4565,13 +4565,13 @@ and properties. #### Static method: `getSourceBasicTypes(module)` +> Stability: 0 - Deprecated + * `module` {Module} * Returns: {ReadonlySet} In webpack 6, call getSourceBasicTypes() directly on the module instance instead of using this static method. -##### Deprecated - *** ## Class: `ModuleFactory` @@ -4939,28 +4939,28 @@ In webpack 6, call getSourceBasicTypes() directly on the module instance instead #### Static method: `clearModuleGraphForModule(module)` +> Stability: 0 - Deprecated + * `module` {Module} * Returns: {void} -##### Deprecated - #### Static method: `getModuleGraphForModule(module, deprecateMessage, deprecationCode)` +> Stability: 0 - Deprecated + * `module` {Module} * `deprecateMessage` {string} * `deprecationCode` {string} * Returns: {ModuleGraph} -##### Deprecated - #### Static method: `setModuleGraphForModule(module, moduleGraph)` +> Stability: 0 - Deprecated + * `module` {Module} * `moduleGraph` {ModuleGraph} * Returns: {void} -##### Deprecated - *** ## Class: `ModuleGraphConnection` @@ -5108,6 +5108,8 @@ In webpack 6, call getSourceBasicTypes() directly on the module instance instead #### `runWithDependencies(compilers, fn, callback)` +> Stability: 0 - Deprecated + * `compilers` {Compiler[]} * `fn` {object} * `callback` {CallbackWebpackFunction_2} @@ -5115,8 +5117,6 @@ In webpack 6, call getSourceBasicTypes() directly on the module instance instead This method should have been private -##### Deprecated - #### `setDependencies(compiler, dependencies)` * `compiler` {Compiler} @@ -5696,14 +5696,14 @@ This data will be passed to restoreFromUnsafeCache later. #### `needRebuild(fileTimestamps, contextTimestamps)` +> Stability: 0 - Deprecated + * `fileTimestamps` {Map} * `contextTimestamps` {Map} * Returns: {boolean} Use needBuild instead -##### Deprecated - #### `originalSource()` * Returns: {Source} @@ -5749,6 +5749,8 @@ restore unsafe cache data #### `source(dependencyTemplates, runtimeTemplate[, type])` +> Stability: 0 - Deprecated + * `dependencyTemplates` {DependencyTemplates} * `runtimeTemplate` {RuntimeTemplate} * `type` {string} @@ -5756,8 +5758,6 @@ restore unsafe cache data Use codeGeneration() instead -##### Deprecated - #### `updateCacheModule(module)` * `module` {Module} @@ -5785,13 +5785,13 @@ and properties. #### Static method: `getSourceBasicTypes(module)` +> Stability: 0 - Deprecated + * `module` {Module} * Returns: {ReadonlySet} In webpack 6, call getSourceBasicTypes() directly on the module instance instead of using this static method. -##### Deprecated - *** ## Class: `NormalModuleReplacementPlugin` @@ -6517,14 +6517,14 @@ This data will be passed to restoreFromUnsafeCache later. #### `needRebuild(fileTimestamps, contextTimestamps)` +> Stability: 0 - Deprecated + * `fileTimestamps` {Map} * `contextTimestamps` {Map} * Returns: {boolean} Use needBuild instead -##### Deprecated - #### `originalSource()` * Returns: {Source} @@ -6560,6 +6560,8 @@ Use needBuild instead #### `source(dependencyTemplates, runtimeTemplate[, type])` +> Stability: 0 - Deprecated + * `dependencyTemplates` {DependencyTemplates} * `runtimeTemplate` {RuntimeTemplate} * `type` {string} @@ -6567,8 +6569,6 @@ Use needBuild instead Use codeGeneration() instead -##### Deprecated - #### `updateCacheModule(module)` * `module` {Module} @@ -6586,13 +6586,13 @@ and properties. #### Static method: `getSourceBasicTypes(module)` +> Stability: 0 - Deprecated + * `module` {Module} * Returns: {ReadonlySet} In webpack 6, call getSourceBasicTypes() directly on the module instance instead of using this static method. -##### Deprecated - *** ## Class: `SourceMapDevToolPlugin` @@ -6959,10 +6959,6 @@ a(); * `stackTraces` {CallSite[]} * Returns: {any} -##### See - -https://v8.dev/docs/stack-trace-api#customizing-stack-traces - *** ## Class: `WebpackOptionsApply` @@ -7133,10 +7129,6 @@ a(); * `stackTraces` {CallSite[]} * Returns: {any} -##### See - -https://v8.dev/docs/stack-trace-api#customizing-stack-traces - *** ## Interface: `Argument` diff --git a/pages/v5.x/webpack/namespaces/dependencies.md b/pages/v5.x/webpack/namespaces/dependencies.md index cf09df8..58c1ea1 100644 --- a/pages/v5.x/webpack/namespaces/dependencies.md +++ b/pages/v5.x/webpack/namespaces/dependencies.md @@ -125,13 +125,13 @@ implement this method to allow the occurrence order plugin to count correctly #### `getReference(moduleGraph)` +> Stability: 0 - Deprecated + * `moduleGraph` {ModuleGraph} * Returns: {never} Returns the referenced module and export -##### Deprecated - #### `getReferencedExports(moduleGraph, runtime)` * `moduleGraph` {ModuleGraph} @@ -333,13 +333,13 @@ implement this method to allow the occurrence order plugin to count correctly #### `getReference(moduleGraph)` +> Stability: 0 - Deprecated + * `moduleGraph` {ModuleGraph} * Returns: {never} Returns the referenced module and export -##### Deprecated - #### `getReferencedExports(moduleGraph, runtime)` * `moduleGraph` {ModuleGraph} @@ -516,13 +516,13 @@ implement this method to allow the occurrence order plugin to count correctly #### `getReference(moduleGraph)` +> Stability: 0 - Deprecated + * `moduleGraph` {ModuleGraph} * Returns: {never} Returns the referenced module and export -##### Deprecated - #### `getReferencedExports(moduleGraph, runtime)` * `moduleGraph` {ModuleGraph} @@ -693,13 +693,13 @@ implement this method to allow the occurrence order plugin to count correctly #### `getReference(moduleGraph)` +> Stability: 0 - Deprecated + * `moduleGraph` {ModuleGraph} * Returns: {never} Returns the referenced module and export -##### Deprecated - #### `getReferencedExports(moduleGraph, runtime)` * `moduleGraph` {ModuleGraph} diff --git a/pages/v5.x/webpack/namespaces/esm.md b/pages/v5.x/webpack/namespaces/esm.md index 509f9a3..45016dc 100644 --- a/pages/v5.x/webpack/namespaces/esm.md +++ b/pages/v5.x/webpack/namespaces/esm.md @@ -469,14 +469,14 @@ This data will be passed to restoreFromUnsafeCache later. #### `needRebuild(fileTimestamps, contextTimestamps)` +> Stability: 0 - Deprecated + * `fileTimestamps` {Map} * `contextTimestamps` {Map} * Returns: {boolean} Use needBuild instead -##### Deprecated - #### `originalSource()` * Returns: {Source} @@ -512,6 +512,8 @@ Use needBuild instead #### `source(dependencyTemplates, runtimeTemplate[, type])` +> Stability: 0 - Deprecated + * `dependencyTemplates` {DependencyTemplates} * `runtimeTemplate` {RuntimeTemplate} * `type` {string} @@ -519,8 +521,6 @@ Use needBuild instead Use codeGeneration() instead -##### Deprecated - #### `updateCacheModule(module)` * `module` {Module} @@ -543,9 +543,9 @@ and properties. #### Static method: `getSourceBasicTypes(module)` +> Stability: 0 - Deprecated + * `module` {Module} * Returns: {ReadonlySet} In webpack 6, call getSourceBasicTypes() directly on the module instance instead of using this static method. - -##### Deprecated diff --git a/pages/v5.x/webpack/namespaces/javascript.md b/pages/v5.x/webpack/namespaces/javascript.md index b9cfdcc..9d02516 100644 --- a/pages/v5.x/webpack/namespaces/javascript.md +++ b/pages/v5.x/webpack/namespaces/javascript.md @@ -353,12 +353,12 @@ Block pre walking iterates the scope for block variable declarations #### `inScope(params, fn)` +> Stability: 0 - Deprecated + * `params` {string|Identifier|Property|MemberExpression|ObjectPattern|ArrayPattern|RestElement|AssignmentPattern[]} * `fn` {object} * Returns: {void} -##### Deprecated - #### `isAsiPosition(pos)` * `pos` {number} diff --git a/pages/v5.x/webpack/namespaces/runtime.md b/pages/v5.x/webpack/namespaces/runtime.md index 29075ca..115bf92 100644 --- a/pages/v5.x/webpack/namespaces/runtime.md +++ b/pages/v5.x/webpack/namespaces/runtime.md @@ -477,14 +477,14 @@ This data will be passed to restoreFromUnsafeCache later. #### `needRebuild(fileTimestamps, contextTimestamps)` +> Stability: 0 - Deprecated + * `fileTimestamps` {Map} * `contextTimestamps` {Map} * Returns: {boolean} Use needBuild instead -##### Deprecated - #### `originalSource()` * Returns: {Source} @@ -520,6 +520,8 @@ Use needBuild instead #### `source(dependencyTemplates, runtimeTemplate[, type])` +> Stability: 0 - Deprecated + * `dependencyTemplates` {DependencyTemplates} * `runtimeTemplate` {RuntimeTemplate} * `type` {string} @@ -527,8 +529,6 @@ Use needBuild instead Use codeGeneration() instead -##### Deprecated - #### `updateCacheModule(module)` * `module` {Module} @@ -546,13 +546,13 @@ and properties. #### Static method: `getSourceBasicTypes(module)` +> Stability: 0 - Deprecated + * `module` {Module} * Returns: {ReadonlySet} In webpack 6, call getSourceBasicTypes() directly on the module instance instead of using this static method. -##### Deprecated - *** ## Class: `LoadScriptRuntimeModule` @@ -1025,14 +1025,14 @@ This data will be passed to restoreFromUnsafeCache later. #### `needRebuild(fileTimestamps, contextTimestamps)` +> Stability: 0 - Deprecated + * `fileTimestamps` {Map} * `contextTimestamps` {Map} * Returns: {boolean} Use needBuild instead -##### Deprecated - #### `originalSource()` * Returns: {Source} @@ -1068,6 +1068,8 @@ Use needBuild instead #### `source(dependencyTemplates, runtimeTemplate[, type])` +> Stability: 0 - Deprecated + * `dependencyTemplates` {DependencyTemplates} * `runtimeTemplate` {RuntimeTemplate} * `type` {string} @@ -1075,8 +1077,6 @@ Use needBuild instead Use codeGeneration() instead -##### Deprecated - #### `updateCacheModule(module)` * `module` {Module} @@ -1099,9 +1099,9 @@ and properties. #### Static method: `getSourceBasicTypes(module)` +> Stability: 0 - Deprecated + * `module` {Module} * Returns: {ReadonlySet} In webpack 6, call getSourceBasicTypes() directly on the module instance instead of using this static method. - -##### Deprecated diff --git a/pages/v5.x/webpack/namespaces/web.md b/pages/v5.x/webpack/namespaces/web.md index 3e5c7f2..187e70f 100644 --- a/pages/v5.x/webpack/namespaces/web.md +++ b/pages/v5.x/webpack/namespaces/web.md @@ -469,14 +469,14 @@ This data will be passed to restoreFromUnsafeCache later. #### `needRebuild(fileTimestamps, contextTimestamps)` +> Stability: 0 - Deprecated + * `fileTimestamps` {Map} * `contextTimestamps` {Map} * Returns: {boolean} Use needBuild instead -##### Deprecated - #### `originalSource()` * Returns: {Source} @@ -512,6 +512,8 @@ Use needBuild instead #### `source(dependencyTemplates, runtimeTemplate[, type])` +> Stability: 0 - Deprecated + * `dependencyTemplates` {DependencyTemplates} * `runtimeTemplate` {RuntimeTemplate} * `type` {string} @@ -519,8 +521,6 @@ Use needBuild instead Use codeGeneration() instead -##### Deprecated - #### `updateCacheModule(module)` * `module` {Module} @@ -543,13 +543,13 @@ and properties. #### Static method: `getSourceBasicTypes(module)` +> Stability: 0 - Deprecated + * `module` {Module} * Returns: {ReadonlySet} In webpack 6, call getSourceBasicTypes() directly on the module instance instead of using this static method. -##### Deprecated - *** ## Class: `FetchCompileAsyncWasmPlugin` @@ -1064,14 +1064,14 @@ This data will be passed to restoreFromUnsafeCache later. #### `needRebuild(fileTimestamps, contextTimestamps)` +> Stability: 0 - Deprecated + * `fileTimestamps` {Map} * `contextTimestamps` {Map} * Returns: {boolean} Use needBuild instead -##### Deprecated - #### `originalSource()` * Returns: {Source} @@ -1107,6 +1107,8 @@ Use needBuild instead #### `source(dependencyTemplates, runtimeTemplate[, type])` +> Stability: 0 - Deprecated + * `dependencyTemplates` {DependencyTemplates} * `runtimeTemplate` {RuntimeTemplate} * `type` {string} @@ -1114,8 +1116,6 @@ Use needBuild instead Use codeGeneration() instead -##### Deprecated - #### `updateCacheModule(module)` * `module` {Module} @@ -1138,13 +1138,13 @@ and properties. #### Static method: `getSourceBasicTypes(module)` +> Stability: 0 - Deprecated + * `module` {Module} * Returns: {ReadonlySet} In webpack 6, call getSourceBasicTypes() directly on the module instance instead of using this static method. -##### Deprecated - *** ## Class: `JsonpTemplatePlugin` @@ -1166,9 +1166,9 @@ Apply the plugin #### Static method: `getCompilationHooks(compilation)` +> Stability: 0 - Deprecated + * `compilation` {Compilation} * Returns: {JsonpCompilationPluginHooks} use JsonpChunkLoadingRuntimeModule.getCompilationHooks instead - -##### Deprecated diff --git a/plugins/theme/helpers/index.mjs b/plugins/theme/helpers/index.mjs index 4847191..880933e 100644 --- a/plugins/theme/helpers/index.mjs +++ b/plugins/theme/helpers/index.mjs @@ -30,4 +30,38 @@ export default (ctx) => ({ typedList(entries) { return entries.map(ctx.helpers.typedListItem).join("\n"); }, + + stabilityBlockquote(comment) { + if (!comment) return null; + + const deprecated = comment.blockTags?.find((t) => t.tag === "@deprecated"); + const isExperimental = + comment.modifierTags?.has("@experimental") || + comment.modifierTags?.has("@beta"); + const legacy = comment.blockTags?.find((t) => t.tag === "@legacy"); + + if (deprecated) { + const message = deprecated.content?.length + ? ctx.helpers.getCommentParts(deprecated.content).trim() + : ""; + return message + ? `> Stability: 0 - Deprecated: ${message}` + : `> Stability: 0 - Deprecated`; + } + + if (isExperimental) { + return `> Stability: 1 - Experimental`; + } + + if (legacy) { + const message = legacy.content?.length + ? ctx.helpers.getCommentParts(legacy.content).trim() + : ""; + return message + ? `> Stability: 3 - Legacy: ${message}` + : `> Stability: 3 - Legacy`; + } + + return null; + }, }); diff --git a/plugins/theme/partials/index.mjs b/plugins/theme/partials/index.mjs index 22ccd56..56463fb 100644 --- a/plugins/theme/partials/index.mjs +++ b/plugins/theme/partials/index.mjs @@ -36,7 +36,11 @@ export default (ctx) => ({ ? model.comment : model.comment || model.parent?.comment; + const stability = ctx.helpers.stabilityBlockquote(comment); + return [ + stability, + stability && "", model.typeParameters?.length && ctx.partials.typeParametersList(model.typeParameters, { headingLevel: options.headingLevel, @@ -54,9 +58,10 @@ export default (ctx) => ({ comment && ctx.partials.comment(comment, { headingLevel: options.headingLevel, + showTags: false, }), ] - .filter((x) => (typeof x === "string" ? x : Boolean(x))) + .filter((x) => typeof x === "string" || Boolean(x)) .join("\n"); },