-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(remix): Add Worker Runtime support to Remix SDK. #9225
Conversation
9103c6b
to
51ee37d
Compare
size-limit report 📦
|
734b816
to
b35cbf6
Compare
I might be crying wolf but I think this is going to run into #4071 for Cloudflare Workers. According to Cloudflare’s docs:
There’s also this extended explanation from a Cloudflare staff member:
So, as far as I understand, if 2 concurrent requests come into a Worker in the same region, there’s a non-zero chance that they’ll run inside the same isolate. If one of these Workers is |
You beat me to it but this was essentially going to be my review. For example, with the following worker code: export default {
async fetch(request, env, ctx) {
if(globalThis.counter === undefined){
globalThis.counter = 0;
}
return new Response(`Hello World! ${globalThis.counter++}`);
},
}; Every time you hit this endpoint from a similar location/timeframe, you'll see the global is not unique per request: If we want context isolation we would need to:
|
(If I can add a personal note, I’d prefer a solution without |
Looking back through the PR again, the worker Client isn't using any integrations so it's currently only setup for capturing errors via That means this PR adds support for reporting errors that was not previously available.
Even Maybe we could automatically add support for |
Thanks a lot for the reviews @huw and @timfish! So this PR addresses the lack of basic server-side error reporting for Remix versions/usages where The errors caught in Does that make sense? Am I missing any context around Cloudflare environments? |
👍😎👍 I think adding support for the (But if anyone from Cloudflare is reading this—can you pretty please add |
@@ -34,12 +34,13 @@ | |||
"@sentry/types": "7.74.0", | |||
"@sentry/utils": "7.74.0", | |||
"glob": "^10.3.4", | |||
"is-ip": "^3.1.0", |
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.
Can we vendor this in if possible?
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.
This has a dependency tree of 6 micro packages. May look ugly in the codebase.
d760cb7
to
7ab4e23
Compare
a31480e
to
d8c992a
Compare
d8c992a
to
66c45cb
Compare
Going to close this now that we have https://docs.sentry.io/platforms/javascript/guides/cloudflare/frameworks/remix/ |
This PR adds partial support to Remix SDK for worker-based runtimes.
It does not cover performance tracing.
Summary:
remix-cloudflare-workers
-> works on Miniflare runtimeremix-cloudflare-pages
-> works on Miniflare runtimeremix-hydrogen
-> works on MiniOxygen runtimeworkerInit
, which is exported fromindex.client.ts
as worker environments are preferringbrowser
entries.