Repository navigation
Create server runtime Client in @sentry/core #8693
Description
Activity
Why core client over base client?
We want base client to be as minimal as possible to save on bundle size in browser, hence the previous proposal to have a wintercg client that only was used for backend runtimes.
Why core client over base client?
We want base client to be as minimal as possible to save on bundle size in browser, hence the previous proposal to have a wintercg client that only was used for backend runtimes.
Based on the current "EdgeClient" implementation, I didn't see a lot that wouldn't go into the browser client (but TBH I just skimmed this, so maybe missed something). Do you think there is stuff in there that wouldn't work (or we wouldn't want) in browser? If so, then yes we should extract this into a dedicated init only for backend runtimes!
Otherwise, based on talk with @kamilogorek , let's go with a new package like
@sentry/jsthat we may end up also using with browser, or not if it doesn't make sense? We don't really want to expose the WinterGC naming in the package I think, so we'd need to use something else that makes sense 😅Or another name idea:
@sentry/server?Remix uses https://www.npmjs.com/package/@remix-run/server-runtime, I think
@sentry/server-runtimecould work well here!Based on the current "EdgeClient" implementation, I didn't see a lot that wouldn't go into the browser client
The main thing at the moment is crons, but I can see other stuff also getting added (request mode sessions, metrics APIs, etc.).
server-runtime sounds good to me as well! I'll update the issue (we can still tweak it more) 🚀
- changed the title
[-]Create `CoreClient` & `Core.init`[/-][+]Create `@sentry/server-runtime` with basic Client & init[/+]on Aug 1, 2023 - changed the title
[-]Create `@sentry/server-runtime` with basic Client & init[/-][+]Create server runtime Client & init in `@sentry/core`[/+]on Aug 31, 2023 - changed the title
[-]Create server runtime Client & init in `@sentry/core`[/-][+]Create server runtime Client in `@sentry/core`[/+]on Sep 14, 2023 Going to close this as we're not going to do the serverless change and we're going to track Sveltekit in another issue.
Reacted by Tim Fish
Kind of extracted from #8087, and related to #8688, create a new
ServerRuntimeClient(name tbd) as well as aninitin@sentry/core. The idea is that this can be called from any JS runtime, so browser, node, edge, ... so it should only contain stuff that works everywhere.For the first step, we can just implement this based on the EdgeClient from Next.js, as well as an
init()method based on the edge init.In follow up steps, we can then actually extend from this for node/serverless SDKs, and re-use as much as possible.