Are pages functions different than cloudflare workers? Ie: don't necessarily have feature parity (I'
Are pages functions different than cloudflare workers? Ie: don't necessarily have feature parity (I'm new-ish to both)
return env.ASSETS.fetch(request); (see https://developers.cloudflare.com/pages/platform/functions/#advanced-mode). So at least in advanced mode it seems you could also proxy asset requests to another local development server (ie: create-react-app dev server running on port 3000). It would be a neat idea to add to wrangler2 to provide a local dev server url where you could both be debugging pages functions and running a framework dev server locally (that will later be compiled/transpiled to a bundled/minified production build before being published to pages). This I think describes the ask for people using React/Vue/Angular/etc.
esbuild.HTMLRewriter()?Trace: Response body object should not be disturbed or lockedwrangler pages build I think? And then you have to call next() yourself and it's a mess rn)

console.log('Incoming element: ', JSON.stringify(element, null, 2))on() is what the rewriter will read, everything else ignored. So if I do HTMLRewriter().on('*', new ElementHandler()) then filter for element with tagName "article" inside the ElementHandler class, it's the same as HTMLRewriter().on('article', new ElementHandler())?* then filtering (is my understanding)
object Object logsHTMLRewriter()Trace: Response body object should not be disturbed or lockedwrangler pages buildconsole.log('Incoming element: ', JSON.stringify(element, null, 2))on()HTMLRewriter().on('*', new ElementHandler())ElementHandlerHTMLRewriter().on('article', new ElementHandler())*object Object const oldResponse = await next()
const contentType = oldResponse.headers.get('Content-Type')
if (contentType && contentType.startsWith('text/html')) {
const newResponse = handler.transform(oldResponse)
return oldResponse
}Incoming element: {
"ptr": 1298176
}