Skip to content

Commit af05660

Browse files
committed
Parse hook names from multiple modules in a bundle
* Create a HookSourceData per location key (file, line, column). * Cache the source map per runtime URL ( = file part of location key). * Don't store sourceMapContents - only store a consumer instance. * Look up original source URLs in the source map correctly. * Cache the code + AST per original URL. * Fix off-by-one column number lookup. * Some naming and typing tweaks related to the above. * Stop storing the consumer outside the with() callback, which is a bug.
1 parent e0aa1af commit af05660

File tree

2 files changed

+254
-153
lines changed

2 files changed

+254
-153
lines changed

packages/react-devtools-extensions/src/astUtils.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@ export type SourceFileASTWithHookDetails = {
2020
source: string,
2121
};
2222

23-
export type SourceMap = {|
24-
mappings: string,
25-
names: Array<string>,
26-
sources: Array<string>,
27-
sourcesContent: Array<string>,
28-
version: number,
29-
|};
30-
3123
const AST_NODE_TYPES = Object.freeze({
3224
CALL_EXPRESSION: 'CallExpression',
3325
MEMBER_EXPRESSION: 'MemberExpression',

0 commit comments

Comments
 (0)