uikit/APPHEADER_BI_OPTIMIZE_1.6.0.md
Mohamadzadeh a47bd58379
All checks were successful
Build and Deploy Next.js + Nginx Docker Image / build-and-deploy (push) Successful in 51s
Build and Deploy Next.js + Nginx Docker Image / deploy (push) Successful in 7s
uikit-v1.6.1-appheader-bi-original-complete
2026-11-04 13:36:33 +03:30

2.6 KiB
Raw Blame History

Superseded in v1.6.1: the 192×192 bi-logo-header.webp is no longer used or shipped. The default BI source is now the unchanged src/assets/bi-logo.webp (500×500), and optimize operates on that full original through the same processImage pipeline as AppHeader.Logo. See APPHEADER_BI_ORIGINAL_1.6.1.md for deployment instructions.

UI Kit v1.6.0 — AppHeader.Bi optimization + remote JS size reduction

Base: uikit-v1.5.0-watermark-wmv3-complete.zip (all previous components retained unchanged).

API

<AppHeader.Bi optimize />
<AppHeader.Bi src="/bi-logo.png" alt="BI" optimize />
<AppHeader biLogoOptimize biLogoSrc="/bi-logo.png" />
  • optimize is opt-in (false by default), just as for AppHeader.Logo.
  • Uses existing processImage, actual rendered image width, q:100, WebP, resize observation, host origin for relative external sources, and original-source fallback.
  • The default BI logo also works with optimize, because it is now a proper HTTP URL resolved from import.meta.url.
  • Main logo and BI logo optimization lifecycles are independent. Cleanups run on rerender and custom-element disconnect.
  • Default BI logo is a 192×192 optimized WebP (bi-logo-header.webp) while the original 500×500 source remains intact.

Before/after payload (uncompressed bytes; before shipping gzip/brotli)

  • dist/remote/AppHeader.js previously: 96,897 B (94.6 KiB).
  • Embedded default logo: 86,048 Base64 characters / 64,536 original WebP bytes.
  • dist/remote/AppHeader.js now: 11,809 B (11.5 KiB).
  • Separate dist/remote/bi-logo-header.webp: 13,118 B (12.8 KiB); fetched only when BI logo is shown.

Deployment — required

Upload both files from this ZIP to the same Remote server directory:

AppHeader.js
bi-logo-header.webp

For the source build with vite build --mode remote, Vite rewrites static new URL("./bi-logo-header.webp", import.meta.url) to an emitted asset URL. Deploy its emitted remote/assets/...webp together with the new JS instead. Remote JS and the image asset must be served over HTTP(S). Old deployments that only replace AppHeader.js but do not provide its referenced asset will display a broken default BI logo.

For the new optimize prop to reach remote JS, the destination project needs the v1.6.0 React wrapper (or newer); upgrading remote JS alone is not enough. Existing destinations not passing the new prop retain unoptimized behavior.

Tested: JS syntax, wrapper prop propagation, default asset packaging, optimization fallback, resize + cleanup, headless browser tests if available.