Skip to content

feat: make astQuery a first-class feature#86

Open
isaacs wants to merge 2 commits into
nodejs:mainfrom
isaacs:isaacs/astquery
Open

feat: make astQuery a first-class feature#86
isaacs wants to merge 2 commits into
nodejs:mainfrom
isaacs:isaacs/astquery

Conversation

@isaacs

@isaacs isaacs commented Jun 24, 2026

Copy link
Copy Markdown

Note: based on #85, land that first

This is the cleanest way to do certain things that cannot be reached by name alone. However, it's brittle to rely on a feature, even a stable one, which is not documented or tested. So, treat it as a first-class feature.

Allow an `end` handler to modify the return value of a synchronous
function.

This is needed for the NestJS instrumentation, because its request
handler mechanism is a factory that returns an inner arrow function,
capturing values that parity with the OTel-based instrumentation
requires us to report on. (These values are not present in the inner
function's arguments; they are captured by a closure only.)

This *could* be done by wrapping both the inner and outer methods, and
correlating them with a WeakMap, but this would be more brittle and
complicated, for no benefit.
This is the cleanest way to do certain things that cannot be reached by
name alone. However, it's brittle to rely on a feature, even a stable
one, which is not documented or tested. So, treat it as a first-class
feature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant