How would we get Edge Compute compatibility? I'm adding compatibility with Fastly Compute@Edge and Cloudflare Workers to helix-deploy right now. The question is how to enable console.log.* easily in these environments.
Details
In Fastly, logging is as easy as:
/* global fastly */
const logger = fastly.getLogger('Coralogix');
logger.log(JSON.stringify(data));
In Cloudflare, we have to make a fetch request to the Coralogix API, but fetch is built-in.
We could create an @adobe/helix-universal-edge-logger package that is published alongside @adobe/helix-universal-logger and replaces it via Webpack magic in helix-deploy. I'm not sure if we should fork this project, or tweak the release script to patch it in place or create a monorepo like we do in helix-shared
Also, I'm not sure if we should do the same for @adobe/helix-log and create an @adobe/helix-edge-log package that replaces phin in the Coralogix logger with fetch or fastly.getLogger()
I would probably create the helix-universal-edge-logger that is optimized for the edge case (pun intended ;-) and remove all the helix-log dependency, which is highly node based.
Overview
How would we get Edge Compute compatibility? I'm adding compatibility with Fastly Compute@Edge and Cloudflare Workers to
helix-deploy
right now. The question is how to enableconsole.log.*
easily in these environments.Details
In Fastly, logging is as easy as:
In Cloudflare, we have to make a
fetch
request to the Coralogix API, butfetch
is built-in.We could create an
@adobe/helix-universal-edge-logger
package that is published alongside@adobe/helix-universal-logger
and replaces it via Webpack magic inhelix-deploy
. I'm not sure if we should fork this project, or tweak the release script to patch it in place or create a monorepo like we do inhelix-shared
Also, I'm not sure if we should do the same for
@adobe/helix-log
and create an@adobe/helix-edge-log
package that replacesphin
in the Coralogix logger withfetch
orfastly.getLogger()