New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(v8): Update node docs for v8 #9906
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Bundle ReportChanges will decrease total bundle size by 1.24kB ⬇️
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating 🙌🏻
I think the For example, there's no need for this section anymore: I can submit a separate PR for this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some copyedits to the content changes
docs/platforms/javascript/common/configuration/async-context.mdx
Outdated
Show resolved
Hide resolved
docs/platforms/javascript/common/performance/database/opt-in.mdx
Outdated
Show resolved
Hide resolved
...forms/javascript/guides/aws-lambda/performance/instrumentation/automatic-instrumentation.mdx
Outdated
Show resolved
Hide resolved
Yes please, that makes sense! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/getsentry/sentry-docs/pull/9906/files#diff-b7e7956822e5458c8c74398728fc9e7fdbd160778dc5860580534facf60db755R18-R20
Isn't this wrong?
The error handler always needs to be last, doing a quick local repro confirms this, you need to have all your routes BEFORE you add the error handler
// http and other libraries are only instrumented | ||
// if imported _after_ Sentry has been initialized | ||
import http from "http"; | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If node is running ESM source, ie. you're not transpiling the above to CJS, the import ordering makes zero difference. import http from "http"
is evaluated and loaded before any code in instrument.js
is even executed and libraries will not be instrumented without using the loader detailed later.
When you are using the loader, import-in-the-middle
wraps everything in proxies to work around the whole "imports evaluated first" problem.
import-in-the-middle
is an module loading interceptor inspired byrequire-in-the-middle
, but specifically for ESM modules. In fact, it can even modify modules after loading time.
Of course, users might be transpiling to CJS, even without their knowledge so maybe it's still important to keep the ordering, but then the loader below will not be required anyway!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I would err on keeping it as-is for the reason you outlined with transpilation to CJS. Maybe this "accidentally" makes it work for people, but I will let the team decide on monday.
Updated the PR to show require on top as default installation method, plus added the "Installation Methods" section to node guides showing ESM docs, including when to use which. cc @smeubank |
Co-authored-by: Sigrid Huemer <32902192+s1gr1d@users.noreply.github.com>
Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com>
Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com> Co-authored-by: Luca Forstner <luca.forstner@sentry.io> Co-authored-by: Stephanie Anderson <stephanie.anderson@sentry.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
--------- Co-authored-by: Sigrid Huemer <32902192+s1gr1d@users.noreply.github.com> Co-authored-by: s1gr1d <sigrid.huemer@posteo.at> Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com> Co-authored-by: Andrei <168741329+andreiborza@users.noreply.github.com> Co-authored-by: Luca Forstner <luca.forstner@sentry.io> Co-authored-by: Stephanie Anderson <stephanie.anderson@sentry.io>
This is a draft until v8 is released!