Uh oh!
There was an error while loading. Please reload this page.
feat: Instrument calls to libraries - #128
Conversation
There was a problem hiding this comment.
I think you're on the right track. Couple of comments:
- Will this work for ESM? I'm worried the whole approach will need to be different. Unless we can use the same trick for CJS-loading and hoping the hooked module will be cached across the two loaders...
- The Error approach is a no-go; it will have an unacceptably massive performance hit. Also, it's maybe a bit too complicated; appmap-ruby skips tracing
if current_package.shallow? && last_package == current_package(where package is just an appmap.ymlpackage: entry), which is extremely simple and works well in practice. This also allows shallow mode to work for user (eg. path:) packages, a feature occasionally useful.
Uh oh!
There was an error while loading. Please reload this page.
| @@ -0,0 +1,152 @@ | |||
| import assert from "node:assert"; | |||
| import { ESTree } from "meriyah"; | |||
There was a problem hiding this comment.
Please try to use import type when applicable to make it clear when code is being imported vs. just types.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
5f31df6 to
7d321a0Comparedividedmind
commented
Mar 18, 2024
BTW, I think if ESM support is going to be non-trivial it's ok to just do this for CJS for now and open a separate issue to add ESM support later. |
b3e4888 to
970d733Comparezermelo-wisen
commented
Mar 29, 2024
It was trivial for built-ins. For third party libs I managed to do it by implementing |
46de9c8 to
988deebCompare988deeb to
6132680Compare1c5375a to
b13d2e4CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
6a1f9e5 to
153af06Compare153af06 to
efa6a7bCompareefa6a7b to
a8b9fbfCompare
Fixes#83