do you guys use the `satisfies` in your workers?
do you guys use the
satisfies in your workers?satisfiesrequest: Request, env: Envsatisfies ExportedHandler<Env> 
ExportedHandler : Promise<Response> for better DX, and then satisfies ExportedHandler<Env>;queue handlers don't need to return anything so: Promise<void> works wellsatisfies operatore introduced in TypeScript 4.9 shouldn't just check that the function matches expect class?batch is of type MessageBatch?ExportedHandler takes other generic types, included one for MessageBatchsatisfies covers most of the function. But the return type being explicit creates better errors for DX.ExportedHandler<Env, MessageBatch> for examplesatisfies Env in the index.ts even tho now that's automatically generated in worker-configuration.d.tswrangler types tho
fetch as : Promise<Response> so ts will catch if you ever accidentally return something elseResponse | Promise<Response> is implied from implements DurableObjectwrangler dev --remote the preview_database_id is used. Perfect! However, when running wrangler dev the preview_database_id is used. wrangler dev the database_id is used.Error: The process '/usr/local/bin/npx' failed with exit code 1. Despite that, on the CF side, it seems to show that the deployments were successful - it shows that the active deployment was made "a few seconds ago". Any thoughts?CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID environment variablesrequest: Requestenv: Envsatisfies ExportedHandler<Env>ExportedHandlerExportedHandler: Promise<Response>: Promise<Response>satisfies ExportedHandler<Env>;queuePromise<void>batchMessageBatchMessageBatchExportedHandler<Env, MessageBatch>Envindex.tsworker-configuration.d.tswrangler typesfetchResponse | Promise<Response>implements DurableObjectError: The process '/usr/local/bin/npx' failed with exit code 1CLOUDFLARE_API_TOKENCLOUDFLARE_ACCOUNT_IDexport default {
async fetch(request, env, ctx): Promise<Response> {
// do things
},
} satisfies ExportedHandler<Env>;# wrangler.toml
# ...
routes = [
{ pattern = "example.test/api*", zone_name = "example.test" },
{ pattern = "localhost:4321/api*", zone_name = "localhost" },
]d1_databases = [
{ binding = "DB", database_name = "mydb", database_id = "id1", preview_database_id = "id2" },
]d1_databases = [
{ binding = "DB", database_name = "mydb", database_id = "id1" },
]