Repository navigation
Description
Summary
There is no release contract for embedding hosts. package.json declares "version": "0.1" (not valid semver, never bumped), the repo has zero git tags and no CHANGELOG.md, and the build pins the widget entry to a fixed, mutable embed.js while every chunk it imports is content-hashed — so every deploy silently upgrades every host, breaking changes cannot be communicated, and a cache-skew failure mode exists: a stale cached embed.js imports hashed chunk names the CDN no longer serves → hard 404, widget dead with no fallback. Introduce a versioned entry alongside the mutable one, adopt real semver, and add a changelog + release-process doc. (Readiness report §4 headline risk: "No versioning for integrators".)
Current behavior
vite.config.ts:31-35 — the widget entry is deliberately unhashed while everything else is hashed:
output: {
entryFileNames: (assetInfo) => {
return assetInfo.name === 'widget' ? 'embed.js' : 'assets/[name]-[hash].js'
},
},package.json:4is"version": "0.1"— not valid semver, and it has never been bumped;git tagreturns nothing; noCHANGELOG.mdexists (all verified 2026-08-06).- Every deploy of
sahajatlas(Cloudflare Pages) instantly and silently upgrades every host embed. There is no way for a host to pin a version, and no channel to announce a breaking change (e.g. a renamed attribute). - Cache-skew failure mode:
embed.jsimports its chunks by content-hashed name. If a host-side proxy/CDN/caching plugin serves a staleembed.jsafter a deploy has purged the old hashed chunks, every chunk import hard-404s and the widget dies with no fallback. Live headers onhttps://sahajatlas.pages.dev/embed.js(verified 2026-08-06:cache-control: public, max-age=0, must-revalidate) mitigate this for well-behaved caches but do not eliminate host-side proxies or WordPress caching plugins that ignore revalidation. - Rollback exists only as the undocumented, global-instant Cloudflare Pages "deployment history" dashboard action.
Proposed changes
- Emit a versioned entry alongside the mutable one — e.g.
v1/embed.jsper major version, produced from the same build (a copy/alias of the entry, not a second build).embed.jskeeps working unchanged: existing embeds must not break. Note the versioned copy must actually boot from its path — the entry's hashed-chunk imports have to resolve fromv1/(verify viapnpm preview), so this is a build-output change, not a post-buildcp. - Adopt real semver in
package.json— pick a starting version (e.g.0.9.0pre-GA or1.0.0at release) and treat it as the source of truth for thevN/path. - Add
CHANGELOG.mdin Keep a Changelog style, seeded with anUnreleasedsection covering the current release-hardening branch. - Document the release/upgrade story (suggest
docs/releasing.md): when and how the version bumps, whatembed.jsvsvN/embed.jsmean, the pin-vs-latest tradeoff for hosts (pinning = stability + manual upgrades; latest = instant fixes + silent changes), rollback via Cloudflare Pages deployment history, and the cache-skew failure mode + why the current headers mitigate it. - Flag the dashboard follow-ups explicitly (in the doc and/or a closing issue comment), since Cloudflare Pages build config lives in the dashboard and is out of this repo's control: e.g. confirming cache headers for
vN/embed.jspaths, and any future_headersdecisions. This ticket's scope is what the repo controls: build output + docs.
Acceptance criteria
-
pnpm buildemits bothdist/embed.js(unchanged behavior) and a versioned entry (e.g.dist/v1/embed.js) from one build - The versioned entry boots the widget when loaded from its own path — chunk imports resolve (verified against
pnpm previewwithdemo.htmlpointed at/v1/embed.js) - Existing embeds are not broken:
demo.htmlloading/embed.jsstill boots identically -
package.jsoncarries a valid semver version, and the versioned path's major matches it -
CHANGELOG.mdexists in Keep-a-Changelog format with at least anUnreleasedsection - A release-process doc section exists covering: version-bump procedure,
embed.jsvsvN/embed.js, pin-vs-latest tradeoff for hosts, Cloudflare Pages rollback, and the cache-skew failure mode - Dashboard-only follow-ups are explicitly listed as such (not silently assumed done)
- Lint + typecheck + test:run + build pass
- Write an implementation report to
.claude/reports/<issue-number>-<short-slug>.md— in the MAIN checkout at /Users/devindra/Documents/Projects/SahajAtlasWeb even when implementing from a worktree (the folder is gitignored) — covering what changed, what was deliberately NOT changed, and which readiness-report findings are resolved
Files affected
vite.config.ts— build output section only (build.rolldownOptions.output); a sibling perf ticket touches the plugins section of this same file — keep edits strictly confined to the output blockpackage.json— theversionfield onlyCHANGELOG.md(new)docs/releasing.md(new) or equivalent release-process doc section
Parallel implementation: this ticket OWNS the files/sections listed above; sibling release-hardening tickets run concurrently — avoid edits outside owned files except strictly additive ones. In particular: the host-facing pin-vs-latest guidance may belong in the integrator guide (docs/embedding.md), which a sibling docs ticket owns — add it there only as a strictly additive section, or leave a cross-reference for reconciliation at merge.
References
.claude/reports/RELEASE_READINESS.md§4 (upgradeability — "No versioning for integrators — the headline risk"), executive-summary structural risk "No version pinning for hosts", Appendix D ("No changelog / semver / tags; unhashed mutableembed.js; cache-skew 404 mode")vite.config.ts:31-35(fixedembed.jsentry vs hashed chunks)package.json:4("version": "0.1")- Live headers on
https://sahajatlas.pages.dev/embed.js:cache-control: public, max-age=0, must-revalidate(verified 2026-08-06) - Keep a Changelog: https://keepachangelog.com
- Cloudflare Pages deployment history (rollback surface; dashboard-only — see CLAUDE.md deployment section)
Metadata
Metadata
Assignees
Labels
Type
Fields
Hold Until
Activity
revert(build): drop the versioned embed entry, keep version + changelog
chore(build): add a package version and a changelog (#143)