diff --git a/packages/core/src/lib/Types.ts b/packages/core/src/lib/Types.ts index 09391515..b40c16a6 100644 --- a/packages/core/src/lib/Types.ts +++ b/packages/core/src/lib/Types.ts @@ -404,13 +404,14 @@ export interface ILeakFilter { * be used to initialize some data stores or any one-off * preprocessings. * - * * **Parameters**: - * * snapshot: `IHeapSnapshot` | the final heap snapshot taken after - * all browser interactions are done. - * Check out {@link IHeapSnapshot} for more APIs that queries the heap snapshot. - * * leakedNodeIds: `Set` | the set of ids of all JS heap objects - * allocated by the `action` call but not released after the `back` call - * in browser. + * * * **Parameters**: + * * `snapshot`: {@link IHeapSnapshot} | the final heap + * snapshot taken after all browser interactions are done. + * Check out {@link IHeapSnapshot} for more APIs that queries the + * heap snapshot. + * * `leakedNodeIds`: `Set` | the set of ids of all JS heap objects + * allocated by the `action` call but not released after the `back` call + * in browser. * * * **Examples**: * ```javascript @@ -441,13 +442,16 @@ export interface ILeakFilter { * memory leaks. * * * **Parameters**: - * * node: `IHeapNode` | one of the heap object allocated but not released. - * * snapshot: `IHeapSnapshot` | the final heap snapshot taken after - * all browser interactions are done. - * Check out {@link IHeapSnapshot} for more APIs that queries the heap snapshot. - * * leakedNodeIds: `Set` | the set of ids of all JS heap objects - * allocated by the `action` call but not released after the `back` call - * in browser. + * * `node`: {@link IHeapNode} | the heap object + * allocated but not released. This filter callback will be applied + * to each node allocated but not released in the heap snapshot. + * * `snapshot`: {@link IHeapSnapshot} | the final heap + * snapshot taken after all browser interactions are done. + * Check out {@link IHeapSnapshot} for more APIs that queries the + * heap snapshot. + * * `leakedNodeIds`: `Set` | the set of ids of all JS heap objects + * allocated by the `action` call but not released after the `back` call + * in browser. * * * **Returns**: the boolean value indicating whether the given node in * the snapshot should be considered as leaked. @@ -482,13 +486,16 @@ export interface ILeakFilter { * For concrete examples, check out {@link leakFilter}. * * * **Parameters**: - * * edge - the reference (edge) that is considered - * for calcualting the retainer trace - * * snapshot - the snapshot of target interaction - * * isReferenceUsedByDefault - MemLab has its own default logic for - * whether a reference should be considered as part of the retainer trace, - * if this parameter is true, it means MemLab will consider this reference - * when calculating the retainer trace. + * * `edge` : {@link IHeapEdge} | the reference (edge) + * that is considered for calcualting the retainer trace + * * `snapshot`: {@link IHeapSnapshot} | the final heap + * snapshot taken after all browser interactions are done. + * Check out {@link IHeapSnapshot} for more APIs that queries the + * heap snapshot. + * * `isReferenceUsedByDefault`: `boolean` | MemLab has its own default + * logic for whether a reference should be considered as part of the + * retainer trace, if this parameter is true, it means MemLab will + * consider this reference when calculating the retainer trace. * * * **Returns**: the value indicating whether the given reference should be * considered when calculating the retainer trace. Note that when this @@ -580,7 +587,8 @@ export type LeakFilterCallback = ( * * @param edge - the reference (edge) that is considered * for calcualting the retainer trace - * @param snapshot - the snapshot of target interaction + * @param snapshot - the final snapshot taken after all browser + * interactions are done. * @param isReferenceUsedByDefault - MemLab has its own default logic for * whether a reference should be filtered (included), if this parameter is true, * it means MemLab will consider this reference for inclusion @@ -699,7 +707,8 @@ export interface IScenario { * the HTTP headers or to prepare data before loading the web page. * * * **Parameters**: - * * page: `Page` | the puppeteer [`Page`](https://pptr.dev/api/puppeteer.page) + * * `page`: {@link Page} | the puppeteer + * [`Page`](https://pptr.dev/api/puppeteer.page) * object, which provides APIs to interact with the web browser. To import * this type, check out {@link Page}. * @@ -747,7 +756,8 @@ export interface IScenario { * or to prepare data before the {@link action} call. * * * **Parameters**: - * * page: `Page` | the puppeteer [`Page`](https://pptr.dev/api/puppeteer.page) + * * `page`: {@link Page} | the puppeteer + * [`Page`](https://pptr.dev/api/puppeteer.page) * object, which provides APIs to interact with the web browser. To import * this type, check out {@link Page}. * @@ -777,7 +787,8 @@ export interface IScenario { * from the `action` callback will be candidates for memory leak filtering. * * * **Parameters**: - * * page: `Page` | the puppeteer [`Page`](https://pptr.dev/api/puppeteer.page) + * * `page`: {@link Page} | the puppeteer + * [`Page`](https://pptr.dev/api/puppeteer.page) * object, which provides APIs to interact with the web browser. To import * this type, check out {@link Page}. * @@ -821,7 +832,8 @@ export interface IScenario { * back/revert the `action` callback. Think of it as an undo action. * * * **Parameters**: - * * page: `Page` | the puppeteer [`Page`](https://pptr.dev/api/puppeteer.page) + * * `page`: {@link Page} | the puppeteer + * [`Page`](https://pptr.dev/api/puppeteer.page) * object, which provides APIs to interact with the web browser. To import * this type, check out {@link Page}. * @@ -842,7 +854,11 @@ export interface IScenario { */ back?: InteractionsCallback; /** - * Specifies how many **extra** `action` and `back` actions performed by memlab. + * Specifies how many **extra** `action` and `back` actions performed + * by memlab. + * + * * **Returns**: a number value specifies the number of extra actions. + * * * **Examples**: * ```typescript * module.exports = { @@ -865,13 +881,16 @@ export interface IScenario { * connections for at least 500ms. * * * **Parameters**: - * * page: `Page` | the puppeteer [`Page`](https://pptr.dev/api/puppeteer.page) + * * `page`: {@link Page} | the puppeteer + * [`Page`](https://pptr.dev/api/puppeteer.page) * object, which provides APIs to interact with the web browser. To import * this type, check out {@link Page}. + * * * **Returns**: a boolean value, if it returns `true`, memlab will consider * the navigation completes, if it returns `false`, memlab will keep calling * this callback until it returns `true`. This is an async callback, you can * also `await` and returns `true` until some async logic is resolved. + * * * **Examples**: * ```typescript * module.exports = { @@ -899,12 +918,13 @@ export interface IScenario { * preprocessings. * * * **Parameters**: - * * snapshot: `IHeapSnapshot` | the final heap snapshot taken after - * all browser interactions are done. - * Check out {@link IHeapSnapshot} for more APIs that queries the heap snapshot. - * * leakedNodeIds: `Set` | the set of ids of all JS heap objects - * allocated by the `action` call but not released after the `back` call - * in browser. + * * `snapshot`: {@link IHeapSnapshot} | the final heap + * snapshot taken after all browser interactions are done. + * Check out {@link IHeapSnapshot} for more APIs that queries the + * heap snapshot. + * * `leakedNodeIds`: `Set` | the set of ids of all JS heap objects + * allocated by the `action` call but not released after the `back` call + * in browser. * * * **Examples**: * ```typescript @@ -935,13 +955,16 @@ export interface IScenario { * memory leaks. * * * **Parameters**: - * * node: `IHeapNode` | one of the heap object allocated but not released. - * * snapshot: `IHeapSnapshot` | the final heap snapshot taken after - * all browser interactions are done. - * Check out {@link IHeapSnapshot} for more APIs that queries the heap snapshot. - * * leakedNodeIds: `Set` | the set of ids of all JS heap objects - * allocated by the `action` call but not released after the `back` call - * in browser. + * * `node`: {@link IHeapNode} | the heap object + * allocated but not released. This filter callback will be applied + * to each node allocated but not released in the heap snapshot. + * * `snapshot`: {@link IHeapSnapshot} | the final heap + * snapshot taken after all browser interactions are done. + * Check out {@link IHeapSnapshot} for more APIs that queries the + * heap snapshot. + * * `leakedNodeIds`: `Set` | the set of ids of all JS heap objects + * allocated by the `action` call but not released after the `back` call + * in browser. * * * **Returns**: the boolean value indicating whether the given node in * the snapshot should be considered as leaked. @@ -969,13 +992,16 @@ export interface IScenario { * For concrete examples, check out {@link leakFilter}. * * * **Parameters**: - * * edge - the reference (edge) that is considered - * for calcualting the retainer trace - * * snapshot - the snapshot of target interaction - * * isReferenceUsedByDefault - MemLab has its own default logic for - * whether a reference should be considered as part of the retainer trace, - * if this parameter is true, it means MemLab will consider this reference - * when calculating the retainer trace. + * * `edge` : {@link IHeapEdge} | the reference (edge) + * that is considered for calcualting the retainer trace + * * `snapshot`: {@link IHeapSnapshot} | the heap snapshot + * taken after all browser interactions are done. + * Check out {@link IHeapSnapshot} for more APIs that queries the + * heap snapshot. + * * `isReferenceUsedByDefault`: `boolean` | MemLab has its own default + * logic for whether a reference should be considered as part of the + * retainer trace, if this parameter is true, it means MemLab will + * consider this reference when calculating the retainer trace. * * * **Returns**: the value indicating whether the given reference should be * considered when calculating the retainer trace. Note that when this @@ -1557,8 +1583,11 @@ export interface IHeapLocation { /** * convert to a concise readable string output * (like calling `JSON.stringify(node, ...args)`). - * Note: calling `JSON.stringify(node, ...args)` will not work - * since the string is too large and not readable. + * + * Note: Please be aware that using `JSON.stringify(node, ...args)` is + * not recommended as it will generate a JSON representation of the host + * object that is too large to be easily readable due to its connections + * to other parts of the data structures within the heap snapshot. * * This API does not completely serialize all the information * captured by the hosting object. @@ -1641,8 +1670,11 @@ export interface IHeapEdge extends IHeapEdgeBasic { /** * convert to a concise readable string output * (like calling `JSON.stringify(node, ...args)`). - * Note: calling `JSON.stringify(node, ...args)` will not work - * since the string is too large and not readable. + * + * Note: Please be aware that using `JSON.stringify(node, ...args)` is + * not recommended as it will generate a JSON representation of the host + * object that is too large to be easily readable due to its connections + * to other parts of the data structures within the heap snapshot. * * This API does not completely serialize all the information * captured by the hosting object. @@ -1863,8 +1895,11 @@ export interface IHeapNode extends IHeapNodeBasic { /** * convert to a concise readable string output * (like calling `JSON.stringify(node, ...args)`). - * Note: calling `JSON.stringify(node, ...args)` will not work - * since the string is too large and not readable. + * + * Note: Please be aware that using `JSON.stringify(node, ...args)` is + * not recommended as it will generate a JSON representation of the host + * object that is too large to be easily readable due to its connections + * to other parts of the data structures within the heap snapshot. * * This API does not completely serialize all the information * captured by the hosting object. diff --git a/website/docs/api/interfaces/core_src.IBrowserInfo.md b/website/docs/api/interfaces/core_src.IBrowserInfo.md index dc364a1c..ab6d435e 100644 --- a/website/docs/api/interfaces/core_src.IBrowserInfo.md +++ b/website/docs/api/interfaces/core_src.IBrowserInfo.md @@ -16,7 +16,7 @@ through [RunMetaInfo](../modules/core_src.md#runmetainfo). browser version * **Source**: - * core/src/lib/Types.ts:1194 + * core/src/lib/Types.ts:1220 ___ @@ -25,7 +25,7 @@ ___ all web console output * **Source**: - * core/src/lib/Types.ts:1202 + * core/src/lib/Types.ts:1228 ___ @@ -34,4 +34,4 @@ ___ configuration for puppeteer * **Source**: - * core/src/lib/Types.ts:1198 + * core/src/lib/Types.ts:1224 diff --git a/website/docs/api/interfaces/core_src.IHeapEdge.md b/website/docs/api/interfaces/core_src.IHeapEdge.md index a3dfcb02..d0cfa626 100644 --- a/website/docs/api/interfaces/core_src.IHeapEdge.md +++ b/website/docs/api/interfaces/core_src.IHeapEdge.md @@ -45,7 +45,7 @@ import {getFullHeapFromFile} from '@memlab/heap-analysis'; index of this JS reference inside the `edge.snapshot.edges` pseudo array * **Source**: - * core/src/lib/Types.ts:1619 + * core/src/lib/Types.ts:1648 ___ @@ -55,7 +55,7 @@ returns an [IHeapNode](core_src.IHeapNode.md) instance representing the hosting JS heap object where this reference starts * **Source**: - * core/src/lib/Types.ts:1640 + * core/src/lib/Types.ts:1669 ___ @@ -67,7 +67,7 @@ otherwise this is a reference with a string name (`edge.name_or_index` will return a string) * **Source**: - * core/src/lib/Types.ts:1626 + * core/src/lib/Types.ts:1655 ___ @@ -77,7 +77,7 @@ name of the JS reference. If this is a reference to an array element or internal table element, it is an numeric index * **Source**: - * core/src/lib/Types.ts:1575 + * core/src/lib/Types.ts:1604 ___ @@ -86,7 +86,7 @@ ___ get the [IHeapSnapshot](core_src.IHeapSnapshot.md) containing this JS reference * **Source**: - * core/src/lib/Types.ts:1615 + * core/src/lib/Types.ts:1644 ___ @@ -96,7 +96,7 @@ returns an [IHeapNode](core_src.IHeapNode.md) instance representing the JS heap pointed to by this reference * **Source**: - * core/src/lib/Types.ts:1635 + * core/src/lib/Types.ts:1664 ___ @@ -105,7 +105,7 @@ ___ the index of the JS heap object pointed to by this reference * **Source**: - * core/src/lib/Types.ts:1630 + * core/src/lib/Types.ts:1659 ___ @@ -115,7 +115,7 @@ type of the JS reference, all types: `context`, `element`, `property`, `internal`, `hidden`, `shortcut`, `weak` * **Source**: - * core/src/lib/Types.ts:1580 + * core/src/lib/Types.ts:1609 ## Methods @@ -123,8 +123,11 @@ type of the JS reference, all types: convert to a concise readable string output (like calling `JSON.stringify(node, ...args)`). -Note: calling `JSON.stringify(node, ...args)` will not work -since the string is too large and not readable. + +Note: Please be aware that using `JSON.stringify(node, ...args)` is +not recommended as it will generate a JSON representation of the host +object that is too large to be easily readable due to its connections +to other parts of the data structures within the heap snapshot. This API does not completely serialize all the information captured by the hosting object. @@ -133,4 +136,4 @@ captured by the hosting object. * `...args`: `any`[] * **Returns**: `string` * **Source**: - * core/src/lib/Types.ts:1650 + * core/src/lib/Types.ts:1682 diff --git a/website/docs/api/interfaces/core_src.IHeapEdges.md b/website/docs/api/interfaces/core_src.IHeapEdges.md index 5b177563..6a1164c5 100644 --- a/website/docs/api/interfaces/core_src.IHeapEdges.md +++ b/website/docs/api/interfaces/core_src.IHeapEdges.md @@ -41,7 +41,7 @@ The total number of edges in heap graph (or JS references in heap snapshot). * **Source**: - * core/src/lib/Types.ts:1687 + * core/src/lib/Types.ts:1719 ## Methods @@ -54,7 +54,7 @@ to each element in ascending order of element index. * `callback`: (`edge`: [`IHeapEdge`](core_src.IHeapEdge.md), `index`: `number`) => `boolean` \| `void` | the callback does not need to return any value, if the callback returns `false` when iterating on element at index `i`, then all elements after `i` won't be iterated. * **Returns**: `void` * **Source**: - * core/src/lib/Types.ts:1703 + * core/src/lib/Types.ts:1735 ___ @@ -68,4 +68,4 @@ get an [IHeapEdge](core_src.IHeapEdge.md) element at the specified index at the specified index, otherwise it returns `null`. * **Source**: - * core/src/lib/Types.ts:1695 + * core/src/lib/Types.ts:1727 diff --git a/website/docs/api/interfaces/core_src.IHeapLocation.md b/website/docs/api/interfaces/core_src.IHeapLocation.md index 7a3e0727..a137cc60 100644 --- a/website/docs/api/interfaces/core_src.IHeapLocation.md +++ b/website/docs/api/interfaces/core_src.IHeapLocation.md @@ -43,7 +43,7 @@ import {getFullHeapFromFile} from '@memlab/heap-analysis'; get the column number * **Source**: - * core/src/lib/Types.ts:1556 + * core/src/lib/Types.ts:1582 ___ @@ -52,7 +52,7 @@ ___ get the line number * **Source**: - * core/src/lib/Types.ts:1552 + * core/src/lib/Types.ts:1578 ___ @@ -61,7 +61,7 @@ ___ get the heap object this location this location represents * **Source**: - * core/src/lib/Types.ts:1544 + * core/src/lib/Types.ts:1570 ___ @@ -70,7 +70,7 @@ ___ get the script ID of the source file * **Source**: - * core/src/lib/Types.ts:1548 + * core/src/lib/Types.ts:1574 ___ @@ -79,7 +79,7 @@ ___ get the [IHeapSnapshot](core_src.IHeapSnapshot.md) containing this location instance * **Source**: - * core/src/lib/Types.ts:1540 + * core/src/lib/Types.ts:1566 ## Methods @@ -87,8 +87,11 @@ get the [IHeapSnapshot](core_src.IHeapSnapshot.md) containing this location inst convert to a concise readable string output (like calling `JSON.stringify(node, ...args)`). -Note: calling `JSON.stringify(node, ...args)` will not work -since the string is too large and not readable. + +Note: Please be aware that using `JSON.stringify(node, ...args)` is +not recommended as it will generate a JSON representation of the host +object that is too large to be easily readable due to its connections +to other parts of the data structures within the heap snapshot. This API does not completely serialize all the information captured by the hosting object. @@ -97,4 +100,4 @@ captured by the hosting object. * `...args`: `any`[] * **Returns**: `string` * **Source**: - * core/src/lib/Types.ts:1566 + * core/src/lib/Types.ts:1595 diff --git a/website/docs/api/interfaces/core_src.IHeapNode.md b/website/docs/api/interfaces/core_src.IHeapNode.md index b41eb354..9211c81b 100644 --- a/website/docs/api/interfaces/core_src.IHeapNode.md +++ b/website/docs/api/interfaces/core_src.IHeapNode.md @@ -52,7 +52,7 @@ For more information on what a dominator node is, please check out [this doc](https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#dominators). * **Source**: - * core/src/lib/Types.ts:1844 + * core/src/lib/Types.ts:1876 ___ @@ -62,7 +62,7 @@ The total number of outgoing JS references (including engine-internal, native, and JS references). * **Source**: - * core/src/lib/Types.ts:1798 + * core/src/lib/Types.ts:1830 ___ @@ -72,7 +72,7 @@ returns true if the heap node has been set an incoming edge which leads to the parent node on the shortest path to GC root. * **Source**: - * core/src/lib/Types.ts:1820 + * core/src/lib/Types.ts:1852 ___ @@ -81,7 +81,7 @@ ___ unique id of the heap object * **Source**: - * core/src/lib/Types.ts:1725 + * core/src/lib/Types.ts:1757 ___ @@ -91,7 +91,7 @@ check if this a string node (normal string node, concatenated string node or sliced string node) * **Source**: - * core/src/lib/Types.ts:1856 + * core/src/lib/Types.ts:1888 ___ @@ -104,7 +104,7 @@ from the React Fiber tree, `is_detached` will be `true`; otherwise it will be `false` * **Source**: - * core/src/lib/Types.ts:1780 + * core/src/lib/Types.ts:1812 ___ @@ -114,7 +114,7 @@ source location information of this heap object (if it is recorded by the heap snapshot). * **Source**: - * core/src/lib/Types.ts:1849 + * core/src/lib/Types.ts:1881 ___ @@ -125,7 +125,7 @@ for JS object instances (type `object`), `name` is the constructor's name of the object instance. for `string`, `name` is the string value. * **Source**: - * core/src/lib/Types.ts:1721 + * core/src/lib/Types.ts:1753 ___ @@ -134,7 +134,7 @@ ___ index of this heap object inside the `node.snapshot.nodes` pseudo array * **Source**: - * core/src/lib/Types.ts:1829 + * core/src/lib/Types.ts:1861 ___ @@ -144,7 +144,7 @@ Get the number of all incoming references pointing to this heap object (including engine-internal, native, and JS references). * **Source**: - * core/src/lib/Types.ts:1815 + * core/src/lib/Types.ts:1847 ___ @@ -154,7 +154,7 @@ The incoming edge which leads to the parent node on the shortest path to GC root. * **Source**: - * core/src/lib/Types.ts:1825 + * core/src/lib/Types.ts:1857 ___ @@ -164,7 +164,7 @@ Get a JS array containing all outgoing JS references from this heap object (including engine-internal, native, and JS references). * **Source**: - * core/src/lib/Types.ts:1805 + * core/src/lib/Types.ts:1837 ___ @@ -174,7 +174,7 @@ Get a JS array containing all incoming JS references pointing to this heap object (including engine-internal, native, and JS references). * **Source**: - * core/src/lib/Types.ts:1810 + * core/src/lib/Types.ts:1842 ___ @@ -186,7 +186,7 @@ could be released if this object is released). For difference between [this doc](https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#object_sizes). * **Source**: - * core/src/lib/Types.ts:1836 + * core/src/lib/Types.ts:1868 ___ @@ -198,7 +198,7 @@ by the object itself.). For difference between **shallow size** and [this doc](https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#object_sizes). * **Source**: - * core/src/lib/Types.ts:1793 + * core/src/lib/Types.ts:1825 ___ @@ -207,7 +207,7 @@ ___ get the [IHeapSnapshot](core_src.IHeapSnapshot.md) containing this heap object * **Source**: - * core/src/lib/Types.ts:1772 + * core/src/lib/Types.ts:1804 ___ @@ -220,7 +220,7 @@ This is engine-specific, for example all types in V8: `symbol`, `bigint` * **Source**: - * core/src/lib/Types.ts:1715 + * core/src/lib/Types.ts:1747 ## Methods @@ -244,7 +244,7 @@ const reference = node.findAnyReference((edge: IHeapEdge) => { ``` * **Source**: - * core/src/lib/Types.ts:1925 + * core/src/lib/Types.ts:1960 ___ @@ -268,7 +268,7 @@ const referrer = node.findAnyReferrer((edge: IHeapEdge) => { ``` * **Source**: - * core/src/lib/Types.ts:1942 + * core/src/lib/Types.ts:1977 ___ @@ -293,7 +293,7 @@ const referrer = node.findAnyReferrerNode((node: IHeapNode) => { ``` * **Source**: - * core/src/lib/Types.ts:1960 + * core/src/lib/Types.ts:1995 ___ @@ -318,7 +318,7 @@ const referrerNodes = node.findReferrerNodes((node: IHeapNode) => { ``` * **Source**: - * core/src/lib/Types.ts:1995 + * core/src/lib/Types.ts:2030 ___ @@ -342,7 +342,7 @@ const referrers = node.findReferrers((edge: IHeapEdge) => { ``` * **Source**: - * core/src/lib/Types.ts:1977 + * core/src/lib/Types.ts:2012 ___ @@ -367,7 +367,7 @@ node.forEachReference((edge: IHeapEdge) => { ``` * **Source**: - * core/src/lib/Types.ts:1890 + * core/src/lib/Types.ts:1925 ___ @@ -392,7 +392,7 @@ node.forEachReferrer((edge: IHeapEdge) => { ``` * **Source**: - * core/src/lib/Types.ts:1908 + * core/src/lib/Types.ts:1943 ___ @@ -413,7 +413,7 @@ const reference = node.getAnyReferrer('ref', 'property'); ``` * **Source**: - * core/src/lib/Types.ts:2050 + * core/src/lib/Types.ts:2085 ___ @@ -439,7 +439,7 @@ const n2 = node.getAnyReferrer('ref', 'property')?.fromNode; ``` * **Source**: - * core/src/lib/Types.ts:2073 + * core/src/lib/Types.ts:2108 ___ @@ -460,7 +460,7 @@ const reference = node.getReference('map', 'hidden'); ``` * **Source**: - * core/src/lib/Types.ts:2010 + * core/src/lib/Types.ts:2045 ___ @@ -485,7 +485,7 @@ const hiddenClassNode2 = node.getReference('map', 'hidden')?.toNode; ``` * **Source**: - * core/src/lib/Types.ts:2032 + * core/src/lib/Types.ts:2067 ___ @@ -512,7 +512,7 @@ const nodes2 = node.getReferrers('ref', 'property') ``` * **Source**: - * core/src/lib/Types.ts:2113 + * core/src/lib/Types.ts:2148 ___ @@ -534,7 +534,7 @@ const referrers = node.getReferrers('ref', 'property'); ``` * **Source**: - * core/src/lib/Types.ts:2092 + * core/src/lib/Types.ts:2127 ___ @@ -542,8 +542,11 @@ ___ convert to a concise readable string output (like calling `JSON.stringify(node, ...args)`). -Note: calling `JSON.stringify(node, ...args)` will not work -since the string is too large and not readable. + +Note: Please be aware that using `JSON.stringify(node, ...args)` is +not recommended as it will generate a JSON representation of the host +object that is too large to be easily readable due to its connections +to other parts of the data structures within the heap snapshot. This API does not completely serialize all the information captured by the hosting object. @@ -552,7 +555,7 @@ captured by the hosting object. * `...args`: `any`[] * **Returns**: `string` * **Source**: - * core/src/lib/Types.ts:1872 + * core/src/lib/Types.ts:1907 ___ @@ -564,4 +567,4 @@ inside the string node. * **Returns**: [`Nullable`](../modules/core_src.md#nullable)<[`IHeapStringNode`](core_src.IHeapStringNode.md)\> * **Source**: - * core/src/lib/Types.ts:1862 + * core/src/lib/Types.ts:1894 diff --git a/website/docs/api/interfaces/core_src.IHeapNodes.md b/website/docs/api/interfaces/core_src.IHeapNodes.md index 48bb11ec..94b71359 100644 --- a/website/docs/api/interfaces/core_src.IHeapNodes.md +++ b/website/docs/api/interfaces/core_src.IHeapNodes.md @@ -41,7 +41,7 @@ The total number of nodes in heap graph (or JS objects in heap snapshot). * **Source**: - * core/src/lib/Types.ts:2191 + * core/src/lib/Types.ts:2226 ## Methods @@ -54,7 +54,7 @@ to each element in ascending order of element index. * `callback`: (`node`: [`IHeapNode`](core_src.IHeapNode.md), `index`: `number`) => `boolean` \| `void` | the callback does not need to return any value, if the callback returns `false` when iterating on element at index `i`, then all elements after `i` won't be iterated. * **Returns**: `void` * **Source**: - * core/src/lib/Types.ts:2207 + * core/src/lib/Types.ts:2242 ___ @@ -68,4 +68,4 @@ get an [IHeapNode](core_src.IHeapNode.md) element at the specified index at the specified index, otherwise it returns `null`. * **Source**: - * core/src/lib/Types.ts:2199 + * core/src/lib/Types.ts:2234 diff --git a/website/docs/api/interfaces/core_src.IHeapSnapshot.md b/website/docs/api/interfaces/core_src.IHeapSnapshot.md index d4e138a8..b613634e 100644 --- a/website/docs/api/interfaces/core_src.IHeapSnapshot.md +++ b/website/docs/api/interfaces/core_src.IHeapSnapshot.md @@ -39,7 +39,7 @@ import {getFullHeapFromFile} from '@memlab/heap-analysis'; ``` * **Source**: - * core/src/lib/Types.ts:1294 + * core/src/lib/Types.ts:1320 ___ @@ -70,7 +70,7 @@ import {getFullHeapFromFile} from '@memlab/heap-analysis'; ``` * **Source**: - * core/src/lib/Types.ts:1268 + * core/src/lib/Types.ts:1294 ## Methods @@ -105,7 +105,7 @@ class TestObject { ``` * **Source**: - * core/src/lib/Types.ts:1435 + * core/src/lib/Types.ts:1461 ___ @@ -134,7 +134,7 @@ import {getFullHeapFromFile} from '@memlab/heap-analysis'; ``` * **Source**: - * core/src/lib/Types.ts:1316 + * core/src/lib/Types.ts:1342 ___ @@ -166,7 +166,7 @@ import {getFullHeapFromFile} from '@memlab/heap-analysis'; ``` * **Source**: - * core/src/lib/Types.ts:1368 + * core/src/lib/Types.ts:1394 ___ @@ -198,7 +198,7 @@ import {getFullHeapFromFile} from '@memlab/heap-analysis'; ``` * **Source**: - * core/src/lib/Types.ts:1342 + * core/src/lib/Types.ts:1368 ___ @@ -244,7 +244,7 @@ test('memory test with heap assertion', async () => { ``` * **Source**: - * core/src/lib/Types.ts:1407 + * core/src/lib/Types.ts:1433 ___ @@ -276,7 +276,7 @@ import {getFullHeapFromFile} from '@memlab/heap-analysis'; ``` * **Source**: - * core/src/lib/Types.ts:1461 + * core/src/lib/Types.ts:1487 ___ @@ -320,4 +320,4 @@ test('memory test', async () => { ``` * **Source**: - * core/src/lib/Types.ts:1499 + * core/src/lib/Types.ts:1525 diff --git a/website/docs/api/interfaces/core_src.IHeapStringNode.md b/website/docs/api/interfaces/core_src.IHeapStringNode.md index 313deaf4..aaa35ce0 100644 --- a/website/docs/api/interfaces/core_src.IHeapStringNode.md +++ b/website/docs/api/interfaces/core_src.IHeapStringNode.md @@ -51,7 +51,7 @@ For more information on what a dominator node is, please check out [this doc](https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#dominators). * **Source**: - * core/src/lib/Types.ts:1844 + * core/src/lib/Types.ts:1876 ___ @@ -61,7 +61,7 @@ The total number of outgoing JS references (including engine-internal, native, and JS references). * **Source**: - * core/src/lib/Types.ts:1798 + * core/src/lib/Types.ts:1830 ___ @@ -71,7 +71,7 @@ returns true if the heap node has been set an incoming edge which leads to the parent node on the shortest path to GC root. * **Source**: - * core/src/lib/Types.ts:1820 + * core/src/lib/Types.ts:1852 ___ @@ -80,7 +80,7 @@ ___ unique id of the heap object * **Source**: - * core/src/lib/Types.ts:1725 + * core/src/lib/Types.ts:1757 ___ @@ -90,7 +90,7 @@ check if this a string node (normal string node, concatenated string node or sliced string node) * **Source**: - * core/src/lib/Types.ts:1856 + * core/src/lib/Types.ts:1888 ___ @@ -103,7 +103,7 @@ from the React Fiber tree, `is_detached` will be `true`; otherwise it will be `false` * **Source**: - * core/src/lib/Types.ts:1780 + * core/src/lib/Types.ts:1812 ___ @@ -113,7 +113,7 @@ source location information of this heap object (if it is recorded by the heap snapshot). * **Source**: - * core/src/lib/Types.ts:1849 + * core/src/lib/Types.ts:1881 ___ @@ -124,7 +124,7 @@ for JS object instances (type `object`), `name` is the constructor's name of the object instance. for `string`, `name` is the string value. * **Source**: - * core/src/lib/Types.ts:1721 + * core/src/lib/Types.ts:1753 ___ @@ -133,7 +133,7 @@ ___ index of this heap object inside the `node.snapshot.nodes` pseudo array * **Source**: - * core/src/lib/Types.ts:1829 + * core/src/lib/Types.ts:1861 ___ @@ -143,7 +143,7 @@ Get the number of all incoming references pointing to this heap object (including engine-internal, native, and JS references). * **Source**: - * core/src/lib/Types.ts:1815 + * core/src/lib/Types.ts:1847 ___ @@ -153,7 +153,7 @@ The incoming edge which leads to the parent node on the shortest path to GC root. * **Source**: - * core/src/lib/Types.ts:1825 + * core/src/lib/Types.ts:1857 ___ @@ -163,7 +163,7 @@ Get a JS array containing all outgoing JS references from this heap object (including engine-internal, native, and JS references). * **Source**: - * core/src/lib/Types.ts:1805 + * core/src/lib/Types.ts:1837 ___ @@ -173,7 +173,7 @@ Get a JS array containing all incoming JS references pointing to this heap object (including engine-internal, native, and JS references). * **Source**: - * core/src/lib/Types.ts:1810 + * core/src/lib/Types.ts:1842 ___ @@ -185,7 +185,7 @@ could be released if this object is released). For difference between [this doc](https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#object_sizes). * **Source**: - * core/src/lib/Types.ts:1836 + * core/src/lib/Types.ts:1868 ___ @@ -197,7 +197,7 @@ by the object itself.). For difference between **shallow size** and [this doc](https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#object_sizes). * **Source**: - * core/src/lib/Types.ts:1793 + * core/src/lib/Types.ts:1825 ___ @@ -206,7 +206,7 @@ ___ get the [IHeapSnapshot](core_src.IHeapSnapshot.md) containing this heap object * **Source**: - * core/src/lib/Types.ts:1772 + * core/src/lib/Types.ts:1804 ___ @@ -216,7 +216,7 @@ get the string value of the JS string heap object associated with this `IHeapStringNode` instance in heap * **Source**: - * core/src/lib/Types.ts:2154 + * core/src/lib/Types.ts:2189 ___ @@ -229,7 +229,7 @@ This is engine-specific, for example all types in V8: `symbol`, `bigint` * **Source**: - * core/src/lib/Types.ts:1715 + * core/src/lib/Types.ts:1747 ## Methods @@ -253,7 +253,7 @@ const reference = node.findAnyReference((edge: IHeapEdge) => { ``` * **Source**: - * core/src/lib/Types.ts:1925 + * core/src/lib/Types.ts:1960 ___ @@ -277,7 +277,7 @@ const referrer = node.findAnyReferrer((edge: IHeapEdge) => { ``` * **Source**: - * core/src/lib/Types.ts:1942 + * core/src/lib/Types.ts:1977 ___ @@ -302,7 +302,7 @@ const referrer = node.findAnyReferrerNode((node: IHeapNode) => { ``` * **Source**: - * core/src/lib/Types.ts:1960 + * core/src/lib/Types.ts:1995 ___ @@ -327,7 +327,7 @@ const referrerNodes = node.findReferrerNodes((node: IHeapNode) => { ``` * **Source**: - * core/src/lib/Types.ts:1995 + * core/src/lib/Types.ts:2030 ___ @@ -351,7 +351,7 @@ const referrers = node.findReferrers((edge: IHeapEdge) => { ``` * **Source**: - * core/src/lib/Types.ts:1977 + * core/src/lib/Types.ts:2012 ___ @@ -376,7 +376,7 @@ node.forEachReference((edge: IHeapEdge) => { ``` * **Source**: - * core/src/lib/Types.ts:1890 + * core/src/lib/Types.ts:1925 ___ @@ -401,7 +401,7 @@ node.forEachReferrer((edge: IHeapEdge) => { ``` * **Source**: - * core/src/lib/Types.ts:1908 + * core/src/lib/Types.ts:1943 ___ @@ -422,7 +422,7 @@ const reference = node.getAnyReferrer('ref', 'property'); ``` * **Source**: - * core/src/lib/Types.ts:2050 + * core/src/lib/Types.ts:2085 ___ @@ -448,7 +448,7 @@ const n2 = node.getAnyReferrer('ref', 'property')?.fromNode; ``` * **Source**: - * core/src/lib/Types.ts:2073 + * core/src/lib/Types.ts:2108 ___ @@ -469,7 +469,7 @@ const reference = node.getReference('map', 'hidden'); ``` * **Source**: - * core/src/lib/Types.ts:2010 + * core/src/lib/Types.ts:2045 ___ @@ -494,7 +494,7 @@ const hiddenClassNode2 = node.getReference('map', 'hidden')?.toNode; ``` * **Source**: - * core/src/lib/Types.ts:2032 + * core/src/lib/Types.ts:2067 ___ @@ -521,7 +521,7 @@ const nodes2 = node.getReferrers('ref', 'property') ``` * **Source**: - * core/src/lib/Types.ts:2113 + * core/src/lib/Types.ts:2148 ___ @@ -543,7 +543,7 @@ const referrers = node.getReferrers('ref', 'property'); ``` * **Source**: - * core/src/lib/Types.ts:2092 + * core/src/lib/Types.ts:2127 ___ @@ -551,8 +551,11 @@ ___ convert to a concise readable string output (like calling `JSON.stringify(node, ...args)`). -Note: calling `JSON.stringify(node, ...args)` will not work -since the string is too large and not readable. + +Note: Please be aware that using `JSON.stringify(node, ...args)` is +not recommended as it will generate a JSON representation of the host +object that is too large to be easily readable due to its connections +to other parts of the data structures within the heap snapshot. This API does not completely serialize all the information captured by the hosting object. @@ -561,7 +564,7 @@ captured by the hosting object. * `...args`: `any`[] * **Returns**: `string` * **Source**: - * core/src/lib/Types.ts:1872 + * core/src/lib/Types.ts:1907 ___ @@ -573,4 +576,4 @@ inside the string node. * **Returns**: [`Nullable`](../modules/core_src.md#nullable)<[`IHeapStringNode`](core_src.IHeapStringNode.md)\> * **Source**: - * core/src/lib/Types.ts:1862 + * core/src/lib/Types.ts:1894 diff --git a/website/docs/api/interfaces/core_src.ILeakFilter.md b/website/docs/api/interfaces/core_src.ILeakFilter.md index 6aa10ea1..ba189324 100644 --- a/website/docs/api/interfaces/core_src.ILeakFilter.md +++ b/website/docs/api/interfaces/core_src.ILeakFilter.md @@ -71,13 +71,14 @@ the subsequent `leakFilter` function calls. This callback could be used to initialize some data stores or any one-off preprocessings. -* **Parameters**: - * snapshot: `IHeapSnapshot` | the final heap snapshot taken after - all browser interactions are done. - Check out [IHeapSnapshot](core_src.IHeapSnapshot.md) for more APIs that queries the heap snapshot. - * leakedNodeIds: `Set` | the set of ids of all JS heap objects - allocated by the `action` call but not released after the `back` call - in browser. +* * **Parameters**: + * `snapshot`: [IHeapSnapshot](core_src.IHeapSnapshot.md) | the final heap + snapshot taken after all browser interactions are done. + Check out [IHeapSnapshot](core_src.IHeapSnapshot.md) for more APIs that queries the + heap snapshot. + * `leakedNodeIds`: `Set` | the set of ids of all JS heap objects + allocated by the `action` call but not released after the `back` call + in browser. * **Examples**: ```javascript @@ -92,7 +93,7 @@ module.exports = { ``` * **Source**: - * core/src/lib/Types.ts:427 + * core/src/lib/Types.ts:428 ___ @@ -113,13 +114,16 @@ and unmounted Fiber nodes (detached from React Fiber tree) as memory leaks. * **Parameters**: - * node: `IHeapNode` | one of the heap object allocated but not released. - * snapshot: `IHeapSnapshot` | the final heap snapshot taken after - all browser interactions are done. - Check out [IHeapSnapshot](core_src.IHeapSnapshot.md) for more APIs that queries the heap snapshot. - * leakedNodeIds: `Set` | the set of ids of all JS heap objects - allocated by the `action` call but not released after the `back` call - in browser. + * `node`: [IHeapNode](core_src.IHeapNode.md) | the heap object + allocated but not released. This filter callback will be applied + to each node allocated but not released in the heap snapshot. + * `snapshot`: [IHeapSnapshot](core_src.IHeapSnapshot.md) | the final heap + snapshot taken after all browser interactions are done. + Check out [IHeapSnapshot](core_src.IHeapSnapshot.md) for more APIs that queries the + heap snapshot. + * `leakedNodeIds`: `Set` | the set of ids of all JS heap objects + allocated by the `action` call but not released after the `back` call + in browser. * **Returns**: the boolean value indicating whether the given node in the snapshot should be considered as leaked. @@ -146,7 +150,7 @@ memlab run --scenario --leak-filter ``` * **Source**: - * core/src/lib/Types.ts:476 + * core/src/lib/Types.ts:480 ___ @@ -159,13 +163,16 @@ The callback is called for every reference (edge) in the heap snapshot. For concrete examples, check out [leakFilter](core_src.ILeakFilter.md#leakfilter). * **Parameters**: - * edge - the reference (edge) that is considered - for calcualting the retainer trace - * snapshot - the snapshot of target interaction - * isReferenceUsedByDefault - MemLab has its own default logic for - whether a reference should be considered as part of the retainer trace, - if this parameter is true, it means MemLab will consider this reference - when calculating the retainer trace. + * `edge` : [IHeapEdge](core_src.IHeapEdge.md) | the reference (edge) + that is considered for calcualting the retainer trace + * `snapshot`: [IHeapSnapshot](core_src.IHeapSnapshot.md) | the final heap + snapshot taken after all browser interactions are done. + Check out [IHeapSnapshot](core_src.IHeapSnapshot.md) for more APIs that queries the + heap snapshot. + * `isReferenceUsedByDefault`: `boolean` | MemLab has its own default + logic for whether a reference should be considered as part of the + retainer trace, if this parameter is true, it means MemLab will + consider this reference when calculating the retainer trace. * **Returns**: the value indicating whether the given reference should be considered when calculating the retainer trace. Note that when this @@ -205,4 +212,4 @@ memlab run --scenario --leak-filter ``` * **Source**: - * core/src/lib/Types.ts:530 + * core/src/lib/Types.ts:537 diff --git a/website/docs/api/interfaces/core_src.IScenario.md b/website/docs/api/interfaces/core_src.IScenario.md index 2bab7caf..6e2a97e8 100644 --- a/website/docs/api/interfaces/core_src.IScenario.md +++ b/website/docs/api/interfaces/core_src.IScenario.md @@ -50,7 +50,8 @@ All JS objects in browser allocated by the browser interactions triggered from the `action` callback will be candidates for memory leak filtering. * **Parameters**: - * page: `Page` | the puppeteer [`Page`](https://pptr.dev/api/puppeteer.page) + * `page`: [Page](../modules/core_src.md#page) | the puppeteer + [`Page`](https://pptr.dev/api/puppeteer.page) object, which provides APIs to interact with the web browser. To import this type, check out [Page](../modules/core_src.md#page). @@ -89,7 +90,7 @@ module.exports = scenario; ``` * **Source**: - * core/src/lib/Types.ts:818 + * core/src/lib/Types.ts:829 ___ @@ -99,7 +100,8 @@ ___ back/revert the `action` callback. Think of it as an undo action. * **Parameters**: - * page: `Page` | the puppeteer [`Page`](https://pptr.dev/api/puppeteer.page) + * `page`: [Page](../modules/core_src.md#page) | the puppeteer + [`Page`](https://pptr.dev/api/puppeteer.page) object, which provides APIs to interact with the web browser. To import this type, check out [Page](../modules/core_src.md#page). @@ -119,7 +121,7 @@ Check out [this page](/docs/how-memlab-works) on why memlab needs to undo/revert the `action` callback. * **Source**: - * core/src/lib/Types.ts:843 + * core/src/lib/Types.ts:855 ___ @@ -130,7 +132,8 @@ once before the initial page load. This callback can be used to set up the HTTP headers or to prepare data before loading the web page. * **Parameters**: - * page: `Page` | the puppeteer [`Page`](https://pptr.dev/api/puppeteer.page) + * `page`: [Page](../modules/core_src.md#page) | the puppeteer + [`Page`](https://pptr.dev/api/puppeteer.page) object, which provides APIs to interact with the web browser. To import this type, check out [Page](../modules/core_src.md#page). @@ -153,7 +156,7 @@ module.exports = scenario; ``` * **Source**: - * core/src/lib/Types.ts:724 + * core/src/lib/Types.ts:733 ___ @@ -165,12 +168,13 @@ be used to initialize some data stores or to any one-off preprocessings. * **Parameters**: - * snapshot: `IHeapSnapshot` | the final heap snapshot taken after - all browser interactions are done. - Check out [IHeapSnapshot](core_src.IHeapSnapshot.md) for more APIs that queries the heap snapshot. - * leakedNodeIds: `Set` | the set of ids of all JS heap objects - allocated by the `action` call but not released after the `back` call - in browser. + * `snapshot`: [IHeapSnapshot](core_src.IHeapSnapshot.md) | the final heap + snapshot taken after all browser interactions are done. + Check out [IHeapSnapshot](core_src.IHeapSnapshot.md) for more APIs that queries the + heap snapshot. + * `leakedNodeIds`: `Set` | the set of ids of all JS heap objects + allocated by the `action` call but not released after the `back` call + in browser. * **Examples**: ```typescript @@ -185,7 +189,7 @@ module.exports = { ``` * **Source**: - * core/src/lib/Types.ts:921 + * core/src/lib/Types.ts:941 ___ @@ -199,13 +203,16 @@ considers a navigation to be finished when there are no network connections for at least 500ms. * **Parameters**: - * page: `Page` | the puppeteer [`Page`](https://pptr.dev/api/puppeteer.page) + * `page`: [Page](../modules/core_src.md#page) | the puppeteer + [`Page`](https://pptr.dev/api/puppeteer.page) object, which provides APIs to interact with the web browser. To import this type, check out [Page](../modules/core_src.md#page). + * **Returns**: a boolean value, if it returns `true`, memlab will consider the navigation completes, if it returns `false`, memlab will keep calling this callback until it returns `true`. This is an async callback, you can also `await` and returns `true` until some async logic is resolved. + * **Examples**: ```typescript module.exports = { @@ -226,7 +233,7 @@ module.exports = { ``` * **Source**: - * core/src/lib/Types.ts:894 + * core/src/lib/Types.ts:913 ___ @@ -247,13 +254,16 @@ and unmounted Fiber nodes (detached from React Fiber tree) as memory leaks. * **Parameters**: - * node: `IHeapNode` | one of the heap object allocated but not released. - * snapshot: `IHeapSnapshot` | the final heap snapshot taken after - all browser interactions are done. - Check out [IHeapSnapshot](core_src.IHeapSnapshot.md) for more APIs that queries the heap snapshot. - * leakedNodeIds: `Set` | the set of ids of all JS heap objects - allocated by the `action` call but not released after the `back` call - in browser. + * `node`: [IHeapNode](core_src.IHeapNode.md) | the heap object + allocated but not released. This filter callback will be applied + to each node allocated but not released in the heap snapshot. + * `snapshot`: [IHeapSnapshot](core_src.IHeapSnapshot.md) | the final heap + snapshot taken after all browser interactions are done. + Check out [IHeapSnapshot](core_src.IHeapSnapshot.md) for more APIs that queries the + heap snapshot. + * `leakedNodeIds`: `Set` | the set of ids of all JS heap objects + allocated by the `action` call but not released after the `back` call + in browser. * **Returns**: the boolean value indicating whether the given node in the snapshot should be considered as leaked. @@ -273,7 +283,7 @@ module.exports = { ``` * **Source**: - * core/src/lib/Types.ts:963 + * core/src/lib/Types.ts:986 ___ @@ -286,13 +296,16 @@ The callback is called for every reference (edge) in the heap snapshot. For concrete examples, check out [leakFilter](core_src.IScenario.md#leakfilter). * **Parameters**: - * edge - the reference (edge) that is considered - for calcualting the retainer trace - * snapshot - the snapshot of target interaction - * isReferenceUsedByDefault - MemLab has its own default logic for - whether a reference should be considered as part of the retainer trace, - if this parameter is true, it means MemLab will consider this reference - when calculating the retainer trace. + * `edge` : [IHeapEdge](core_src.IHeapEdge.md) | the reference (edge) + that is considered for calcualting the retainer trace + * `snapshot`: [IHeapSnapshot](core_src.IHeapSnapshot.md) | the heap snapshot + taken after all browser interactions are done. + Check out [IHeapSnapshot](core_src.IHeapSnapshot.md) for more APIs that queries the + heap snapshot. + * `isReferenceUsedByDefault`: `boolean` | MemLab has its own default + logic for whether a reference should be considered as part of the + retainer trace, if this parameter is true, it means MemLab will + consider this reference when calculating the retainer trace. * **Returns**: the value indicating whether the given reference should be considered when calculating the retainer trace. Note that when this @@ -321,7 +334,7 @@ module.exports = { ``` * **Source**: - * core/src/lib/Types.ts:1006 + * core/src/lib/Types.ts:1032 ___ @@ -333,7 +346,8 @@ if you have to (we recommend using [cookies](core_src.IScenario.md#cookies)) or to prepare data before the [action](core_src.IScenario.md#action) call. * **Parameters**: - * page: `Page` | the puppeteer [`Page`](https://pptr.dev/api/puppeteer.page) + * `page`: [Page](../modules/core_src.md#page) | the puppeteer + [`Page`](https://pptr.dev/api/puppeteer.page) object, which provides APIs to interact with the web browser. To import this type, check out [Page](../modules/core_src.md#page). @@ -356,7 +370,7 @@ module.exports = scenario; ``` * **Source**: - * core/src/lib/Types.ts:772 + * core/src/lib/Types.ts:782 ## Methods @@ -391,13 +405,17 @@ module.exports = scenario; ``` * **Source**: - * core/src/lib/Types.ts:695 + * core/src/lib/Types.ts:703 ___ ### `Optional` **repeat**() -Specifies how many **extra** `action` and `back` actions performed by memlab. +Specifies how many **extra** `action` and `back` actions performed +by memlab. + +* **Returns**: a number value specifies the number of extra actions. + * **Examples**: ```typescript module.exports = { @@ -412,7 +430,7 @@ module.exports = { * **Returns**: `number` * **Source**: - * core/src/lib/Types.ts:858 + * core/src/lib/Types.ts:874 ___ @@ -435,4 +453,4 @@ load. All objects allocated by the initial page load will be candidates for memory leak filtering. * **Source**: - * core/src/lib/Types.ts:742 + * core/src/lib/Types.ts:751 diff --git a/website/docs/api/modules/core_src.md b/website/docs/api/modules/core_src.md index 2687a02f..7d7a258e 100644 --- a/website/docs/api/modules/core_src.md +++ b/website/docs/api/modules/core_src.md @@ -34,7 +34,7 @@ this callback until it returns `true`. This is an async callback, you can also `await` and returns `true` until some async logic is resolved. * **Source**: - * core/src/lib/Types.ts:1128 + * core/src/lib/Types.ts:1154 ___ @@ -86,7 +86,7 @@ or [forEachReferrer](../interfaces/core_src.IHeapNode.md#foreachreferrer). * **Returns**: [`Optional`](core_src.md#optional)<{ `stop`: `boolean` }\> \| `void` | this API returns void * **Source**: - * core/src/lib/Types.ts:1735 + * core/src/lib/Types.ts:1767 ___ @@ -102,7 +102,7 @@ For concrete example, check out [beforeLeakFilter](../interfaces/core_src.ILeakF * **Returns**: `void` * **Source**: - * core/src/lib/Types.ts:541 + * core/src/lib/Types.ts:548 ___ @@ -118,7 +118,7 @@ For concrete examples, check out [action](../interfaces/core_src.IScenario.md#ac * **Returns**: `Promise`<`void`\> | no return value * **Source**: - * core/src/lib/Types.ts:620 + * core/src/lib/Types.ts:628 ___ @@ -146,7 +146,7 @@ function leakFilter(node, _snapshot, _leakedNodeIds) { ``` * **Source**: - * core/src/lib/Types.ts:568 + * core/src/lib/Types.ts:575 ___ @@ -269,7 +269,7 @@ For concrete examples, check out [leakFilter](../interfaces/core_src.ILeakFilter * **Parameters**: * `edge`: [`IHeapEdge`](../interfaces/core_src.IHeapEdge.md) | the reference (edge) that is considered for calcualting the retainer trace - * `snapshot`: [`IHeapSnapshot`](../interfaces/core_src.IHeapSnapshot.md) | the snapshot of target interaction + * `snapshot`: [`IHeapSnapshot`](../interfaces/core_src.IHeapSnapshot.md) | the final snapshot taken after all browser interactions are done. * `isReferenceUsedByDefault`: `boolean` | MemLab has its own default logic for whether a reference should be filtered (included), if this parameter is true, it means MemLab will consider this reference for inclusion * **Returns**: `boolean` | the value indicating whether the given reference should be filtered (i.e., included) @@ -288,7 +288,7 @@ function retainerReferenceFilter(edge, _snapshot, _leakedNodeIds) { ``` * **Source**: - * core/src/lib/Types.ts:604 + * core/src/lib/Types.ts:612 ___ @@ -303,7 +303,7 @@ You can retrieve the instance of this type through [getRunMetaInfo](../classes/a | `type` | `string` | type of the memlab run | * **Source**: - * core/src/lib/Types.ts:1209 + * core/src/lib/Types.ts:1235 ___