Skip to content

Remove over-comments, dead code, and duplicate logic - #375

Merged
Brooooooklyn merged 17 commits into
mainfrom
cleanup/simplify-repo
Oct 6, 2026
Merged

Brooooooklyn merged 17 commits into
mainfrom
cleanup/simplify-repo

Conversation

@Brooooooklyn

@Brooooooklyn Brooooooklyn commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

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

Repo-wide quality cleanup with no intended behavior change:

- Remove comments that restate code, bug-fix history, and stale notes.
- Delete unused functions, exports, parameters, branches, and tests.
- Replace copied logic with existing or shared helpers.
- Fix stale facts in docs and playground READMEs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://cleanup-simplify-repo-void-cloud.voidzero-docs.workers.dev (commit 77bf077)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://47ca3657-void-cloud.voidzero-docs.workers.dev 77bf077 2026-10-06T09:48:50.135Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://91ad7016-void-cloud.voidzero-docs.workers.dev 2bde4ae 2026-10-06T09:36:25.924Z Visit the dashboard ↗
  • Build: In progress 🔵

View logs ↗
72ef828 2026-10-06T09:34:58.707Z View logs ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://c822f353-void-cloud.voidzero-docs.workers.dev ffc0b9d 2026-10-06T09:19:12.800Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://9e1d7a80-void-cloud.voidzero-docs.workers.dev d52cfdd 2026-10-06T08:51:15.513Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://403e5277-void-cloud.voidzero-docs.workers.dev dda35f3 2026-10-06T08:39:04.035Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://485cfdee-void-cloud.voidzero-docs.workers.dev 0073d38 2026-10-06T07:46:24.350Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://a096a154-void-cloud.voidzero-docs.workers.dev 652d795 2026-10-06T07:32:43.635Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://ab8919e1-void-cloud.voidzero-docs.workers.dev 04d957d 2026-10-06T07:12:38.608Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://c910f2f9-void-cloud.voidzero-docs.workers.dev 8b85ac9 2026-10-06T07:09:29.381Z Visit the dashboard ↗

View all previews: View all previews ↗

Brooooooklyn and others added 2 commits October 6, 2026 15:08
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Brooooooklyn
Brooooooklyn marked this pull request as draft October 6, 2026 07:11
Brooooooklyn and others added 14 commits October 6, 2026 15:18
The suite shared packages/react/node_modules/.vite with the navigation
fallback suite. Running both at once re-optimized dependencies under
the other server and timed out its first page load.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
/admin/* already applies adminAuthMiddleware, so the inline copy on
GET /admin/ repeated the settings and user lookups.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
When the Worker config declares secrets, Wrangler loads only declared
.env keys, so __VOID_PROXY_TOKEN never reaches the dev Worker and the
dispatcher expects the dev-trigger token instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
name:type? already produced nullable validators, but the Drizzle column
generators always appended .notNull().

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The Vue pages plugin already wrote prefetch settings into the client,
but voidVue() never passed them, so Vue apps always used the defaults.
React, Svelte and Solid already expose this option.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Framework adapters load the materialized Cloudflare config, so a
user-authored secrets block also keeps the .env proxy token out of
their dev Worker. Both paths now use one secrets check.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Wrangler loads .env into the dev Worker itself, so stripping
__VOID_PROXY_TOKEN from .env never kept it out. Whether env.ts declared
required keys then decided which trigger header worked, and the hint
and docs could disagree with the runtime.

- .env names and env.ts keys that start with __VOID_ now stop dev,
  build, and void env check with an error.
- Dev route modules accept only x-void-dev-trigger on /__void/scheduled
  and /__void/queue. The choice 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.
- The dev trigger hint always prints x-void-dev-trigger.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
parseDotenvFile skips export KEY=value and KEY: value lines, but
Wrangler loads both into the dev Worker. The reserved __VOID_ check in
dev, build, and void env check now uses scanWranglerDotenvKeys.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The build strip read .env with Void's parser and compared values, so it
missed lines Vite still loads, such as export VITE_X=1, values with an
inline # comment, and dotted keys. It now reads keys with Vite's own
parser, keeps values the shell or the vp run task runner supplies, and
skips the strip when Vite loads env files from another envDir.

parseDotenvFile also accepts the export prefix that Vite and Wrangler
both read, so DATABASE_URL, auth, and env checks see those keys.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
parseDotenvFile now parses lines with node:util parseEnv, the parser
Vite uses, so inline comments, quotes, escapes, and multi-line values
match what Vite and Wrangler read. Void keeps its own expansion, which
never reads process.env.

Vite copies NODE_ENV, BROWSER, and BROWSER_ARGS from .env into
process.env, where the build strip took them for shell values. The
strip now compares against process.env as it was before Vite loaded the
file, including on later config resolutions in the app builder.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Brooooooklyn
Brooooooklyn marked this pull request as ready for review October 6, 2026 09:55
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@Brooooooklyn
Brooooooklyn merged commit 52c8a69 into main Oct 6, 2026
21 checks passed
@Brooooooklyn
Brooooooklyn deleted the cleanup/simplify-repo branch October 6, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant