Commit ee2c260
Add deprecation getters for Astro.locals.runtime (#15075)
* feat(cloudflare): add deprecation getters for Astro.locals.runtime
Adds helpful error messages when accessing removed runtime properties:
- runtime.env -> import { env } from 'cloudflare:workers'
- runtime.cf -> Astro.request.cf
- runtime.caches -> global caches object
- runtime.ctx -> Astro.locals.cfContext
Improves migration experience from v5 to v6.
* chore: add changeset for runtime deprecation helpers
* Update .changeset/helpful-runtime-errors.md
Co-authored-by: Armand Philippot <[email protected]>
* fix(cloudflare): hide runtime from types and enumeration
- Remove runtime from Runtime interface to prevent autocomplete
- Use Object.defineProperty with enumerable: false
---------
Co-authored-by: Armand Philippot <[email protected]>1 parent 4463a55 commit ee2c260
File tree
2 files changed
+37
-0
lines changed- .changeset
- packages/integrations/cloudflare/src/utils
2 files changed
+37
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
62 | 87 | | |
63 | 88 | | |
64 | 89 | | |
| |||
0 commit comments