Repository navigation
chore: remove the empty runtime-config file and its plumbing - #38
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe application no longer loads, precaches, or separately caches Changesconfig.js removal
Estimated code review effort: 2 (Simple) | ~10 minutes Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing. Comment |
|
Interim independent review while CodeRabbit is rate limited (Free plan allows 1 review/hour). Reviewer: Claude Opus 4.5, run locally against CodeRabbit will still review this PR when its hourly window resets; this does not replace it. |
59bafcf to
52df9a9
Compare
|
Independent review, second pass, model upgraded to Claude Opus 5 (the earlier comment on this PR used Opus 4.5). Run locally against Every should-fix finding below has been addressed in the current head. Full output: |
|
@coderabbitai review |
✅ Action performedReview finished.
|
public/config.js assigned an empty object to window.env and nothing ever
read it. Zero matches for window.env or globalThis.env anywhere in the
tracked tree; the app reads Vite's import.meta.env.
index.html loaded it as a blocking script in <head>, so removing it also
drops one request from the critical path of every SPA page load. The 58
prerendered static pages under public/ never referenced it: none of them
carries the script tag, so this leaves no dangling reference behind.
Removes the file and everything that existed only to serve it: the script
tag in index.html, the service-worker app-shell entry, the Vercel and nginx
no-cache rules, the /config.js row in the deployment-config test, and the
now-contradictory .gitignore entry.
Also drops a latent trap in nginx.conf. The JS/CSS caching block carried
if ($request_uri ~* "config\.js") { return 404; }
which matches on substring, so any hashed bundle whose URI contained
"config.js" would have 404'd. With the file gone the guard has nothing to
protect and is deleted rather than narrowed.
The service worker degrades safely either way: install uses
Promise.allSettled and only caches responses that are ok, so a missing
app-shell entry could never fail installation.
Verified on main fe679fd, from a clean npm ci: docs:check, lint, typecheck,
955 unit tests (main is 956; this removes exactly the one it.each row for
/config.js), 121 edge tests, build, and 126 Chromium e2e tests pass.
`nginx -t` passes against the real nginx:alpine image with this config
mounted.
52df9a9 to
1f56d90
Compare
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
Fifth PR from the over-engineering audit. Independent of #34, #35, #36, and #37: no file overlap, based on current
main.What was dead
public/config.jsin full:Nothing reads it. Zero matches for
window.envorglobalThis.envacross the tracked tree. The app reads Vite'simport.meta.env.Which pages actually loaded it
Worth being precise, because getting this wrong would ship dangling references:
index.htmlcarried<script src="/config.js">in<head>, blocking. That covers every SPA route, so removal drops one request from the critical path of every app page load.public/never referenced it.rg -l "config\.js" public --glob '*.html'returns zero files, so none of them is left pointing at a deleted file.ios/App/App/publicis build-generated and gitignored (ios/.gitignore:4).Dockerfile,.github/workflows/, orvercel.json.What goes with it
Everything that existed only to serve this file:
<script src="/config.js">tag inindex.html/config.jsentry in the service worker'sAPP_SHELLprecache list/config.jsno-cache rule invercel.jsonlocation = /config.jsblock innginx.conf/config.jsrow in theit.eachlist insrc/test/vercel-deployment-config.test.tspublic/config.jsline in.gitignore, which contradicted the file being tracked and is now pointing at nothingpublic/config.jsline in the README project-structure treeBonus: a latent nginx trap
The JS/CSS caching block contained:
That regex is unanchored and matches on substring, so any hashed bundle whose URI happened to contain
config.jswould have returned 404. With the file gone the guard protects nothing, so it is deleted rather than narrowed.Service worker safety
Removing an
APP_SHELLentry cannot break installation.installusesPromise.allSettledand only callscache.putwhenresponse.ok, so a missing entry was already tolerated. Changingsw.jsalso changes its bytes, which is what triggers browsers to install the new worker.CACHE_VERSIONis deliberately not bumped: the stale/config.jsentry in an existing client's old cache is unreachable dead bytes, not a correctness problem, and a version bump would needlessly evict the whole warm app shell for every user.Verification
npm run lintnpm run typechecknpm testnpm run test:edgenpm run builddist/index.htmlhas noconfig.jsreferencenginx -tnginx:alpineimage with thisnginx.confmountednpm run test:e2eOn the count:
mainis at 925 unit tests and this branch is at 924. The diff removes exactly one test, the/config.jsrow from theit.eachin the deployment-config spec, so 925 → 924 is the expected arithmetic. I am not citing coverage here:public/config.jswas never in the instrumented scope, so coverage cannot corroborate this change either way.The
nginx -tcheck matters because this is the only PR in the series that edits production server config, and neither CI nor the browser suite exercisesnginx.conf.Not run: WebKit smoke and the protected staging suite. No rendering-engine or staging-dependent changes.
Summary by CodeRabbit