-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cache addHoverClass as it is quite expensive (#643)
* Add cache and cache purging Needed for rrweb-io/rrweb-snapshot#85 * Add cache and cache purging Needed for rrweb-io/rrweb-snapshot#85 * Cache addHoverClass as it is quite expensive rrweb-io/rrweb-snapshot#85 * Make cache non-optional * Make cache required on addHoverClass
- Loading branch information
Showing
8 changed files
with
122 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import snapshot, { serializeNodeWithId, transformAttribute, visitSnapshot, cleanupSnapshot, needMaskingText, IGNORED_NODE } from './snapshot'; | ||
import rebuild, { buildNodeWithSN, addHoverClass } from './rebuild'; | ||
import rebuild, { buildNodeWithSN, addHoverClass, createCache } from './rebuild'; | ||
export * from './types'; | ||
export * from './utils'; | ||
export { snapshot, serializeNodeWithId, rebuild, buildNodeWithSN, addHoverClass, transformAttribute, visitSnapshot, cleanupSnapshot, needMaskingText, IGNORED_NODE, }; | ||
export { snapshot, serializeNodeWithId, rebuild, buildNodeWithSN, addHoverClass, createCache, transformAttribute, visitSnapshot, cleanupSnapshot, needMaskingText, IGNORED_NODE, }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
import { serializedNodeWithId, idNodeMap, INode } from './types'; | ||
export declare function addHoverClass(cssText: string): string; | ||
import { serializedNodeWithId, idNodeMap, INode, BuildCache } from './types'; | ||
export declare function addHoverClass(cssText: string, cache: BuildCache): string; | ||
export declare function createCache(): BuildCache; | ||
export declare function buildNodeWithSN(n: serializedNodeWithId, options: { | ||
doc: Document; | ||
map: idNodeMap; | ||
skipChild?: boolean; | ||
hackCss: boolean; | ||
afterAppend?: (n: INode) => unknown; | ||
cache: BuildCache; | ||
}): INode | null; | ||
declare function rebuild(n: serializedNodeWithId, options: { | ||
doc: Document; | ||
onVisit?: (node: INode) => unknown; | ||
hackCss?: boolean; | ||
afterAppend?: (n: INode) => unknown; | ||
cache: BuildCache; | ||
}): [Node | null, idNodeMap]; | ||
export default rebuild; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters