feat(node): Document SEA setup#17752
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
inventarSarah
left a comment
There was a problem hiding this comment.
Thank you, the content looks good overall 👍
I left some suggestions and questions for you.
Regarding Structure:
I suggest restructuring the "ESM without import" page into two sections (add a new section for the original setup instructions).
That would help users find what they need more quickly and, maybe, make it easier for you to decide where to place which content.
|
|
||
| Keep `sea-bootstrap.cjs`, `instrument.mjs`, and `app.mjs` available on the | ||
| filesystem next to the executable. If you want a fully self-contained | ||
| executable, bundle your instrumentation and app into the SEA main instead. |
There was a problem hiding this comment.
| executable, bundle your instrumentation and app into the SEA main instead. | |
| bundle your instrumentation and app into the SEA main instead. |
It would be nice to make this more actionable -- e.g., link to docs that explain how to do this.
| }); | ||
| ``` | ||
|
|
||
| Then configure SEA to use `sea-main.cjs` as its main script and disable code |
There was a problem hiding this comment.
q: is it clear why users need to disable code cache or do we need to mention why?
| </Alert> | ||
|
|
||
| When running your application in ESM mode, you will most likely want to <PlatformLink to="/install/esm">follow the ESM instructions</PlatformLink>. However, if you want to avoid using the `--import` command line option, for example if you have no way of configuring a CLI flag, you can also follow an alternative setup that involves importing the `instrument.mjs` file directly in your application. | ||
|
|
There was a problem hiding this comment.
Then create a new section for the original setup instructions. Add an H2 and name it something like "Static Import" or "Direct Import" (or whatever you want to call it)
| As a result, the Sentry SDK will not capture data from database calls, queues, ORMs, third-party libraries, or other framework-specific data. | ||
|
|
||
| We recommend using this only if the `--import` flag is not an option for you. | ||
| We recommend using these setups only if the `--import` flag is not an option for you. |
There was a problem hiding this comment.
You can remove your changes from this alert because it now lives in the "Static import" section
| [installation methods](../). | ||
| </Alert> | ||
|
|
||
| When running your application in ESM mode, you will most likely want to <PlatformLink to="/install/esm">follow the ESM instructions</PlatformLink>. However, if you want to avoid using the `--import` command line option, for example if you have no way of configuring a CLI flag, you can also follow an alternative setup that involves importing the `instrument.mjs` file directly in your application. |
There was a problem hiding this comment.
Since this page now covers 2 options, we need to update this intro.
We could write something like:
If you can't use the --import flag, choose the setup that matches your situation: static import for regular ESM apps, or the SEA bootstrap setup if you're building a Single Executable Application.
A user asked how to get their instrumentations working in a Node.js Single Applications setup, I tried a few things and settled on this as it seems to work best and simplest way to set it up.
Not sure if needs its own dedicated page, but the user did follow the trail of not being able to use
--import, so it might be an appropriate place for it.