Repository navigation
Commit 52c8a69
Remove over-comments, dead code, and duplicate logic (#375)
## Summary
Repo-wide quality cleanup. No intended behavior change, and no public
API change.
```
area change
packages/void/src/cli merge copied helpers, drop unused exports and labels
packages/void (other) merge runtime/pages/migrations copies, fix stale docs
platform/packages/api merge copied queries and flows, drop 1 duplicate test
platform (other) 5 HMAC copies -> proxy/src/hmac.ts, drop unused props
deploy-*, edge, isr, md, UI use isRecord and shared helpers, drop pages-manifest.ts
docs, playground, test/ fix stale facts, replace repeated text with links
```
- Remove comments that restate code, bug-fix history, and stale notes.
- Delete unused functions, exports, parameters, branches, and tests.
Each deletion was checked with a repo-wide search.
- Replace copied logic with existing or shared helpers.
## Shared helpers
- `void/pages-client` now exports `getValidationErrors`,
`mergeDataIntoHref` and `isModifiedEvent` from a new leaf module
(`packages/void/src/pages/adapter-helpers.ts`, no runtime imports). The
React, Vue, Svelte and Solid adapters import them instead of keeping 16
copies. `hasPrefetch` stays local because the Solid copy differs.
- `platform/packages/api/src/auth/hmac.ts` now exports
`constantTimeEqual`. It replaces `timingSafeEqual`,
`constantTimeHexEqual` and `sameSecret`. All inputs are ASCII (UUID or
hex), so results are unchanged. The compare method (JS loop) is
unchanged.
## Fixes found during the cleanup
- `voidVue()` now accepts `prefetch: { hoverDelay, cacheFor }`, like
React, Svelte and Solid. The Vue pages plugin already supported it, but
the option was never passed.
- `void gen model` keeps `name:type?` columns nullable. The Drizzle
column code always added `.notNull()`.
- **Breaking:** names that start with `__VOID_` are reserved. If `.env`
or `env.ts` defines one, `vp dev`, `vite build` and `void env check`
stop with an error that names the keys. Before, dev warned that it
ignored `__VOID_PROXY_TOKEN`, but Wrangler still loaded it, so the
working trigger header depended on whether `env.ts` declared required
keys.
- In dev, `/__void/scheduled` and `/__void/queue` accept only
`x-void-dev-trigger`, and the dev hint always prints that header. The
rule is fixed at compile time from the dev server flag, so builds made
with `NODE_ENV=development` keep the proxy token and build key rule.
`jobs.md` and `queues.md` no longer say that a `.env` token takes
priority.
- Reserved-name checks read `.env` with the same grammar as Wrangler, so
`export __VOID_X=1` and `__VOID_X: 1` are rejected too.
- Production builds keep every local `.env` client value out of the
bundle. The strip used to miss lines Vite still loads (`export
VITE_X=1`, values with an inline `#` comment, dotted keys). It now reads
keys with Vite's own parser, keeps values from the shell or the `vp run`
task runner, and does nothing when Vite loads env files from another
`envDir`.
- Void reads `.env` values with Vite's parser (`node:util` `parseEnv`)
everywhere it reads `.env` (for example `DATABASE_URL`, auth, `void env
check`). `export KEY=value`, inline `#` comments, quoted escapes and
multi-line values now read the same as in Vite and Wrangler. An unquoted
value ends at the first `#` (for example `postgres://h/db#x` reads as
`postgres://h/db`), as Vite and Wrangler already do. Quote a value that
must contain `#`.
- `NODE_ENV`, `BROWSER` and `BROWSER_ARGS` from `.env` no longer reach a
production bundle through the copies Vite writes into `process.env`.
- `GET /admin/` runs the admin auth check once instead of twice.
- `react-island-hydration` uses its own Vite `cacheDir`. It shared
`packages/react/node_modules/.vite` with
`react-pages-navigation-fallback`, and the second suite timed out when
both ran together.
- The kitchen sink smoke test shows the searched text in its row errors.
- `packages/void/AGENTS.md` describes how `void gen migration` uses
`drizzle-kit generate --custom`.
## Small observable differences
- Framework deploys print the `routing.notFound` warning after the lint
warnings, not between them.
- The admin build table shows durations for timestamps written with
`+00:00` or a space.
- `head.ts` skips null attributes instead of throwing. The type allows
strings only.
- The migration single-statement check strips a leading BOM.
- `build-runtime.mjs` reports a bad migration journal with the manifest
parser's message.
## Not changed
- Public exports that nothing uses yet stay, because they are reachable
from package `exports`.
- `deploy-direct-r2.test.ts` stays as it was, because the schema-compat
script pins its checksum.
## Verification
- `vp run build:all`
- `vp run check`
- `vp lint`, `vp fmt --check`
- `vp test run`: all files pass after `build:all`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>1 parent 66cbbb9 commit 52c8a69
538 files changed
Lines changed: 9014 additions & 14229 deletions
File tree
- docs
- .vitepress/theme
- guide
- database
- edge
- email
- pages-routing
- platform
- administration
- development
- installation
- integrations
- reference
- api
- cli
- packages
- create-void/src
- deploy-cloudflare
- src
- test/unit
- deploy-core/src
- edge/src
- isr
- src
- test/unit
- md
- src
- plugins
- test/unit
- platform
- scripts
- src
- react
- src
- runtime
- test
- integration
- unit
- solid/src
- runtime
- svelte/src
- runtime
- void
- src
- auth
- cli
- cloudflare-deploy
- codegen
- crons
- drizzle
- durable
- host
- inference
- migrations
- pages
- queues
- router
- runtime
- email
- remote
- sandbox
- ssr
- test
- e2e
- integration
- unit
- vue
- src
- runtime
- test/unit
- platform
- meta
- packages
- api
- container
- src
- admin
- fate
- react
- views
- routes
- auth
- db
- deploy
- email
- github
- middleware
- migrations
- observability
- operator
- provisioning
- routes
- test
- integration
- unit
- dashboard
- lib
- pages
- auth
- test
- unit
- ui
- components
- types
- dispatch
- src
- test/unit
- email-gateway/src
- proxy
- src
- test/unit
- scripts
- playground
- pg-test/routes/api
- users
- react-router
- spa
- tanstack-start
- vue-pages
- websockets
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | | - | |
369 | 368 | | |
370 | 369 | | |
371 | 370 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
119 | | - | |
120 | | - | |
| 118 | + | |
121 | 119 | | |
122 | 120 | | |
123 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | 62 | | |
65 | 63 | | |
66 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
| 46 | + | |
| 47 | + | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | 73 | | |
76 | 74 | | |
77 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
404 | | - | |
| 404 | + | |
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | 415 | | |
424 | 416 | | |
425 | 417 | | |
| |||
455 | 447 | | |
456 | 448 | | |
457 | 449 | | |
458 | | - | |
459 | | - | |
| 450 | + | |
460 | 451 | | |
461 | 452 | | |
462 | 453 | | |
463 | 454 | | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
468 | 460 | | |
469 | 461 | | |
470 | 462 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 33 | + | |
42 | 34 | | |
43 | 35 | | |
44 | 36 | | |
| |||
0 commit comments