{"id":20194472,"url":"https://github.com/rocicorp/cf-do-js-exec-context","last_synced_at":"2025-08-03T10:10:14.645Z","repository":{"id":195897159,"uuid":"693905854","full_name":"rocicorp/cf-do-js-exec-context","owner":"rocicorp","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-21T18:44:17.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-13T19:17:24.519Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://cf-do-js-exec-context-test.replicache.workers.dev/?name1=foo\u0026name2=bar","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rocicorp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-20T00:31:48.000Z","updated_at":"2023-09-21T18:38:49.000Z","dependencies_parsed_at":"2023-09-20T03:08:47.656Z","dependency_job_id":null,"html_url":"https://github.com/rocicorp/cf-do-js-exec-context","commit_stats":null,"previous_names":["rocicorp/cf-do-js-exec-context"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocicorp%2Fcf-do-js-exec-context","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocicorp%2Fcf-do-js-exec-context/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocicorp%2Fcf-do-js-exec-context/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocicorp%2Fcf-do-js-exec-context/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rocicorp","download_url":"https://codeload.github.com/rocicorp/cf-do-js-exec-context/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241629739,"owners_count":19993707,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T04:09:29.297Z","updated_at":"2025-03-03T07:43:50.007Z","avatar_url":"https://github.com/rocicorp.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cf-do-js-exec-context\n\nA test Cloudflare worker and durable object which demonstrates that\nwrangler dev uses a single JavaScript execution context for workers and\nDurable Objects of different classes and/or ids. This behavior differs from\nthe deployed behavior.\n\n**Response from `wrangler dev` looks like:**\n\n```\nWorker js exec context id: snfxxmas\nDOClass1 foo response: DO id: znr0fq82, js context id: snfxxmas\nDOClass2 bar response: DO id: z3a83ub6, js context id: snfxxmas\nDOClass1 foo response: DO id: znr0fq82, js context id: snfxxmas\nDOClass2 bar response: DO id: z3a83ub6, js context id: snfxxmas\n```\n\nIndicating the worker and Durable Object instances are all sharing the same\nJavaScript execution context.\n\n**Response from `wrangler dev --remote` looks like:**\n\n```\nWorker js exec context id: q5q0i2xk\nDOClass1 foo response: DO id: cahimg3f, js context id: tk2dp2f\nDOClass2 bar response: DO id: jfn3p28p, js context id: tk2dp2f\nDOClass1 foo response: DO id: cahimg3f, js context id: tk2dp2f\nDOClass2 bar response: DO id: jfn3p28p, js context id: tk2dp2f\n```\n\nIndicating the worker has its own JavaScript Execution Context and the Durable\nObject instances are sharing the same JavaScript execution context.\n\n**Response from `wrangler publish` output looks like:**\n\n```\nWorker js exec context id: l7xrtr9j\nDOClass1 foo response: DO id: fci8u6tn, js context id: j8q3vagr\nDOClass2 bar response: DO id: pwdem3v, js context id: 0jf132k\nDOClass1 foo response: DO id: fci8u6tn, js context id: j8q3vagr\nDOClass2 bar response: DO id: pwdem3v, js context id: 0jf132k\n```\n\nIndicating the worker and Durable Object instances are all in different\nJavaScript execution contexts.\n\n## Running Locally\n\n```bash\nnpm install\n\nnpx wrangler dev\n```\n\nThen open http://localhost:8787?name1=foo\u0026name2=bar in your browser of choice.\n\n## Running on Cloudflare\n\n```\nnpm install\n\nnpx wrangler publish\n```\n\nThen open the url for the worker output by the above wrangler publish command.\nLike https://cf-do-js-exec-context-test.my-team.workers.dev?name1=foo\u0026name2=bar\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocicorp%2Fcf-do-js-exec-context","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frocicorp%2Fcf-do-js-exec-context","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocicorp%2Fcf-do-js-exec-context/lists"}