---
config:
flowchart:
defaultRenderer: elk
---
[ | |
{ | |
"elementType": "geometry", | |
"stylers": [ | |
{ | |
"color": "#f5f5f5" | |
} | |
] | |
}, | |
{ |
I'm not sure if this a bug per-se, but I encountered a Worker runtime behavior that wasn't reproducible in Miniflare.
tl;dr Using TransformStream will often trigger a runtime error: "The script will never generate a response"
My workers library, Keywork, has a JSXResponse
class that accepts some React JSX and returns an instance of Response
. This works fine when the JSX is first rendered to a string and then fed to Response's body, since this is really just a convenience wrapper around a few functions:
const app = new WorkerRouter()
import id from './generate-id' | |
export type NoncedEventPayload = { | |
nonce: string | |
} | |
export type ParsedEventPayload = NoncedEventPayload & { | |
value: string | |
error: Error | null | |
} |
function swapEntries (array, index, targetIndex) { | |
const slice = array.slice() | |
slice.splice(targetIndex, 1, array[index]) | |
slice.splice(index, 1, array[targetIndex]) | |
return slice | |
} |
const fs = require('fs') | |
const {promisify} = require('util') | |
const path = require('path') | |
const readdirP = promisify(fs.readdir) | |
const statP = promisify(fs.stat) | |
async function recursiveFileList (basePath, callback) { | |
const filePaths = await readdirP(basePath) | |
for (filePath of filePaths) { |
function sendTrackEvent (eventData) { | |
window.ga('send', Object.assign({hitType: 'event'}, eventData); | |
} | |
function trackVideoEvents (videoElement) { | |
var $videoElement = $(videoElement); | |
var markers = [.1, .2, .3, .4, .5, .6, .7, .8, .9, 1]; | |
var gaLoggingName = this.dataset.gaLoggingName; | |
var isTrackingProgress = false | |
ARTICLE 1: WHETHER A HOT DOG IS A TYPE OF SANDWICH?
OBJECTION 1: It seems as though a hot dog is a type of sandwich. For the term “sandwich” is commonly said of such foods constituted by meat, fish, vegetables, condiments, etc. surrounded on two sides by bread. Now a hot dog is constituted of a sausage made of meat surrounded on two sides by a bun made of bread. Therefore a hot dog is a type of sandwich.
OBJECTION 2: Further, hot dogs are commonly adorned with such toppings and condiments as mustard, ketchup, onions, and cheeses. Now sandwiches are also commonly adorned with the same condiments and toppings. Therefore a hot dog is a type of sandwich.
OBJECTION 3: Further, the Quarterback writes, “They gotta be, right? It's between two pieces of bread,” as does the Sports Anchor, “I would consider anything that you put between two pieces of bread would be considered a sandwich, so I would say technically it absolutely is a sandwich”. Therefore a hot dog is a type of sandwich.
ON THE CONTRARY, it is written
// Place your key bindings in this file to overwrite the defaults | |
[ | |
{ | |
"key": "cmd+shift+v", | |
"command": "pasteAndIndent.action", | |
"when": "editorTextFocus && !editorReadonly" | |
}, | |
{ | |
"key": "shift+cmd+up", | |
"command": "cursorColumnSelectUp", |