Skip to content

fix: rebuild stale dist bundles and deprecate UMD/CDN usage - #672

Merged
oliverlaz merged 2 commits into
mainfrom
fix/rebuild-dist-umd-deprecation
Nov 10, 2026
Merged

oliverlaz merged 2 commits into
mainfrom
fix/rebuild-dist-umd-deprecation

Conversation

@oliverlaz

@oliverlaz oliverlaz commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Problem

The UMD browser bundles in dist/ (dist/js/getstream.js, dist/js_min/getstream.js) haven't been rebuilt since 8.4.0. They still embed PACKAGE_VERSION 8.4.0 and inline axios 1.6.1. Meanwhile package.json / yarn.lock are on axios 1.20.0, so npm audit and other dependency scanners can't see the old copy. Every release since 8.4.1 has shipped these stale bundles to npm and jsDelivr.

Related: #671

Root cause

dist/ is committed to git, and the only automated rebuild was the npm version lifecycle script (yarn run dist && yarn run build && git add dist). When releases moved to GitHub Actions (#504), the workflows started running npm run changelog and npm publish, and neither triggers version. After that, dist/ only got refreshed when someone ran yarn dist by hand in a feature PR. The last time was #587 (Nov 2023).

Changes

  • Rebuild dist/. The bundles now embed getstream 8.15.0 and axios 1.20.0.
  • Remove dist/js_min/getstream.js.LICENSE.txt. The current build doesn't create this file and the minified bundle no longer references it.
  • Prevent recurrence: initiate_release.yml now runs yarn run dist right after npm run changelog, so every release PR carries rebuilt bundles with the new version. It also runs git add dist before git commit -am, so new files a build creates under dist/ aren't left out.
  • Cleanup: remove the unused preversion / version / postversion scripts.
  • Deprecate UMD/CDN usage:
    • The README marks the jsDelivr and direct-download sections as deprecated. It says the bundle is still published for now but may be removed in a future major version, and points to npm plus a bundler instead.
    • Both bundles start with a /*! … DEPRECATED … */ banner linking to the README. It's added after minification, so terser doesn't move it into a LICENSE.txt.

Notes

  • Users only get the fix with the next release; I'd suggest shipping it as 8.15.1.
  • The dist/js/getstream.js diff is large because the bundle is about two years of dependency updates behind.
  • The rebuilt bundle now contains ES2020 syntax (??) from axios. All browser targets in .babelrc (Chrome ≥ 80, Firefox ≥ 74, Safari ≥ 13.4) support it.

The UMD bundles in dist/ had not been rebuilt since 8.4.0 and still
inlined axios 1.6.1. The CI release flow (#504) bypassed the npm
`version` script, which was the only thing that regenerated dist/.

- rebuild dist/ (getstream 8.15.0, axios 1.20.0)
- run `yarn run dist` in the initiate release workflow so every
  release PR carries fresh bundles
- drop the unused preversion/version/postversion scripts
- mark CDN / direct-download usage as deprecated in the README and
  add a deprecation banner to the UMD bundles
@github-actions

Copy link
Copy Markdown
Contributor

Size Change: +17.8 kB (+16.27%) ⚠️

Total Size: 127 kB

📦 View Changed
Filename Size Change
dist/js_min/getstream.js 39 kB +3.44 kB (+9.69%) ⚠️
dist/js/getstream.js 88.3 kB +14.4 kB (+19.44%) ⚠️

compressed-size-action

- remove stale dist/js_min/getstream.js.LICENSE.txt (no longer emitted)
- stage dist/ explicitly in the release workflow so newly emitted
  files aren't dropped by `git commit -a`
- fix the deprecation banner link (README has no #installation anchor)
- clarify in README that the UMD bundle is still published but deprecated
@oliverlaz
oliverlaz merged commit 44d0c6f into main Nov 10, 2026
13 checks passed
@oliverlaz
oliverlaz deleted the fix/rebuild-dist-umd-deprecation branch November 10, 2026 11:13
@github-actions github-actions Bot mentioned this pull request Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants