2 ms·
Their fetch handler [1] is not a web standard. [1] https://developers.cloudflare.com/workers/runtime-apis/handlers/fetch/ https://developers.cloudflare.com/wor
by mark_and_sweep 6mo ago
Their fetch handler [1] is not a web standard.
[1] https://developers.cloudflare.com/workers/runtime-apis/handlers/fetch/ https://developers.cloudflare.com/workers/runtime-apis/handl...
- jFriedensreich 6mo agobut not to lock people in but to avoid the context overhead of service worker api, which they tried first and which still works btw.
- mark_and_sweep 6mo agoSorry, what? I never mentioned lock-in. I assume by Service Worker API, you mean FetchEvent? [1] As in: self.addEventListener("fetch", (event) => {}); That is a web standard indeed, but not one that was designed for use as a general-purpose HTTP handler, but rather for use in a Service Worker proxy. [1] https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent
- jFriedensreich 6mo agoMaybe i misunderstood what you were going for. Just saying: Yes, their web fetch handler is not a web standard but the only standard there is to accomplish something like that had a few issues and they picked something that looks as generic as possible. vs import {pretendToStartServer} from ('our:global-injected-pseudo-sdk') I really loved the idea of using service worker sdk and having something that works in browsers too so the conceptual model of edge functions are spanning backends, edge POPs and browser runtimes.