Skip to content

[pull] main from freeCodeCamp:main - #268

Merged
pull[bot] merged 13 commits into
homebase-garage:mainfrom
freeCodeCamp:main
Jul 12, 2026
Merged

[pull] main from freeCodeCamp:main#268
pull[bot] merged 13 commits into
homebase-garage:mainfrom
freeCodeCamp:main

Conversation

@pull

@pull pull Bot commented Jul 12, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

simon04 added 13 commits July 12, 2026 09:02
prepare_deploy fetched both index.json and meta.json for every doc
version, but the manifest (docs.json) is built solely from meta.json,
and clients load index.json directly from documents.devdocs.io at
runtime. The local index.json copies were never read.

index.json is by far the larger file (e.g. ~1.4 MB for python~3.13 vs
~220 B for meta.json), so downloading it for every version added up to
hundreds of MB per deploy and grew steadily as docs/versions were added.
The large transfers were also the source of the Net::ReadTimeout retries
against the CDN. Fetching only meta.json cuts this phase to a few
hundred KB and removes the timeouts.

See #2686.
Deep links to docs and the static pages (settings, offline, about, news,
help) previously bounced through `/` with a short-lived `initial_path`
cookie that the client read back to restore the path. This removes that
detour: the server now renders the app shell (erb :index / erb :other)
directly at the requested URL, and page.js dispatches location.pathname
on start().

This is behaviour that already shipped for docs a user hadn't enabled;
enabled docs and the static pages now take the same path. The offline
story is unaffected — the service worker already falls back to the
cached `/` for non-asset paths when the network fails.

Removes the `initial_path` cookie, the redirect_via_js /
supports_js_redirection? / modern_browser? helpers, and the client-side
getInitialPathFromCookie. The hash-based initial-path handling (used by
/search and legacy /#/ bookmarks) is untouched.
Serve app shell directly instead of JS-redirect via cookie
Commit 45867a2 stopped copying index.json into the app's own origin,
assuming clients always fetch it from documents.devdocs.io. That holds
only when the service worker is disabled. With the service worker enabled
(the production default), clients and the service worker precache list
load index.json from same-origin /docs to avoid caching the CDN's CORS
responses (see App#indexHost / app.js). The missing files caused
cache.addAll to reject with "Failed to execute 'addAll' on 'Cache'".

The Net::ReadTimeout concern from #2686 that motivated the removal is
already handled by the retry/backoff block below this loop.

See #2686.
The service worker precache and the runtime index loader used a same-origin
/docs path for index.json, on the assumption that the cache couldn't hold
the CDN's CORS responses. That assumption dates to the applicationCache era
(2013) and is false for service workers, which cache CORS responses fine;
documents.devdocs.io already serves index.json with access-control-allow-origin.

Point both doc_index_urls (SW precache) and Doc#indexUrl at docs_origin so
they load index.json straight from the CDN, and drop the now-dead index_host
special-case and index_path config. prepare_deploy no longer needs to copy
index.json into the app's public/docs, so stop downloading it — restoring the
deploy-size/timeout win from 45867a2 without breaking the service worker.

See #2686.
@pull pull Bot locked and limited conversation to collaborators Jul 12, 2026
@pull pull Bot added the ⤵️ pull label Jul 12, 2026
@pull
pull Bot merged commit 669abd4 into homebase-garage:main Jul 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant