Commit 07c3ce9
refactor: Simplify R2 cache population to use local wrangler dev with remote binding
Reworks the R2 cache upload approach per reviewer feedback. Instead of
deploying the worker with a token, populating, then redeploying, we now
use a local wrangler dev worker with a remote R2 binding.
Key changes:
- Replace deploy/populate/redeploy cycle with local wrangler dev approach
- Remove --cacheMethod flag and dual code paths
- Remove token auth system (local worker needs no auth)
- Remove esbuild compilation step (wrangler accepts TS natively)
- Revert deploy.ts, worker.ts, cloudflare-context.ts, build.ts, run-wrangler.ts to main
- Delete compile-cache-populate-handler.ts
The new flow derives a temp wrangler config with the R2 binding set to
remote: true, starts wrangler dev locally, sends batched cache entries
to the worker, then stops it. Single code path for all cache sizes.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 11473ee commit 07c3ce9
11 files changed
Lines changed: 284 additions & 754 deletions
File tree
- .changeset
- packages/cloudflare/src
- api
- cli
- build
- open-next
- commands
- templates
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
35 | 17 | | |
36 | 18 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | 37 | | |
42 | 38 | | |
43 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
83 | 82 | | |
84 | 83 | | |
85 | 84 | | |
86 | | - | |
87 | 85 | | |
88 | 86 | | |
89 | 87 | | |
| |||
Lines changed: 0 additions & 26 deletions
This file was deleted.
0 commit comments