Skip to content

Commit

Permalink
Parse hook names from multiple modules in a bundle
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
motiz88 committed Jul 4, 2021
1 parent e0aa1af commit af05660
Show file tree
Hide file tree
Showing 2 changed files with 254 additions and 153 deletions.
8 changes: 0 additions & 8 deletions packages/react-devtools-extensions/src/astUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ export type SourceFileASTWithHookDetails = {
source: string,
};

export type SourceMap = {|
mappings: string,
names: Array<string>,
sources: Array<string>,
sourcesContent: Array<string>,
version: number,
|};

const AST_NODE_TYPES = Object.freeze({
CALL_EXPRESSION: 'CallExpression',
MEMBER_EXPRESSION: 'MemberExpression',
Expand Down
Loading

0 comments on commit af05660

Please sign in to comment.