From f0127ac1b8e955b1a45c283d765be29f62c94ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Smoli=C5=84ski?= Date: Tue, 1 Dec 2026 15:54:15 +0100 Subject: [PATCH] 1.18.0 performance items: tests, the reference budget gate tightened (JS 195 kB, 404 without its exception, TTL check), docs (performance.md, AGENT.md, iapl-performance, module pages, api.md), changelog: what changes for an existing site Co-Authored-By: Claude Opus 5.5 --- docs/CHANGELOG.md | 44 + docs/agent/AGENT.md | 13 +- docs/agent/skills/iapl-performance/SKILL.md | 9 +- docs/agent/skills/iapl-reference/SKILL.md | 3 +- .../skills/iapl-reference/resources/api.md | 22 +- docs/block-library.md | 5 +- docs/consent.md | 3 +- docs/dev/perf/README.md | 76 +- docs/dev/perf/turbopack-1180-after.json | 770 ++++++++++++++++++ docs/dev/perf/webpack-1180-after.json | 306 +++---- docs/doctor.md | 1 + docs/forms.md | 7 + docs/media.md | 15 + docs/performance.md | 38 +- docs/stats.md | 3 +- docs/turnstile.md | 5 + reference/e2e/performance.spec.ts | 9 +- src/exports/admin.ts | 2 +- src/exports/client.ts | 6 +- src/exports/doctor.ts | 4 +- src/index.ts | 5 + src/modules/consent/consentLog.ts | 2 +- src/modules/doctor/growth.ts | 4 +- src/modules/forms/RenderForm.tsx | 4 +- src/modules/shared/ttl.ts | 6 +- src/modules/shared/versionLimit.ts | 2 +- src/modules/stats/endpoint.ts | 6 +- src/modules/turnstile/Turnstile.tsx | 4 +- src/plugin.ts | 6 +- src/types.ts | 20 +- test/blockLibraryRender.test.ts | 6 +- test/builderForm.test.ts | 8 +- test/consentCompliance.test.ts | 4 +- test/performance1180.test.ts | 22 +- test/stripMetadata.test.ts | 2 +- 35 files changed, 1154 insertions(+), 288 deletions(-) create mode 100644 docs/dev/perf/turbopack-1180-after.json diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 4469c39..ef5c8bb 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -33,6 +33,50 @@ once there are more than 20. > `confirmByEmail: { linkMinutes, sameBrowser, adminConfirm, logLinkWhenMailFails, notices, maxMailsPerHour }` > (security.md "Set-up confirmed by e-mail"). +### Speed and growth (docs/performance.md) + +> **What changes for an existing site** (no edit needed unless a line says so; each with its opt-out): +> +> 1. **Metadata is removed from JPEG and PNG uploads** (camera, date, GPS position, comments) — without +> re-encoding: the pixels stay byte for byte, the colour profile stays. A photo whose EXIF says "rotate" is turned +> once (JPEG quality 92) so it does not show sideways. Only new uploads; stored files are not touched. +> Off: `buildOptimizeUploadHook({ stripMetadata: false })`. +> 2. **MongoDB: TTL indexes delete old consent records and statistics by themselves** — the records the daily purge +> already deleted (older than `retentionDays`: 1095 days for the consent log, 90 for statistics), now also on a +> quiet site where no new record starts the purge. At the first start the plugin adds a hidden date +> (`iaplTtlFrom`) to every existing record and creates the index `iapl_ttl`; **records older than the retention +> are deleted by MongoDB within a minute of that start** (they were due already). Off: `consentLog: { ttlIndex: +> false }`, `stats: { ttlIndex: false }` (the index is dropped at the next start; the purge stays). Postgres / +> SQLite: nothing changes (no field, no migration). +> 3. **A versioned plugin collection or global keeps 20 versions per document** (Site settings, Site integrations, +> the forms…) when a project turned its versions on without a limit — Payload's default is 100. **The oldest +> versions above 20 are removed when such a document is saved next.** Keep more: set `max` / `maxPerDoc` in your +> override. The plugin itself turns versions on nowhere. +> 4. **Forms load their code only on pages that show a form.** `BuilderForm` and `Turnstile` from +> `@intecion/ipal-kit/client` are now lazy wrappers with the same props; the server renders the whole form as +> before. On other pages 6–9 KB less JavaScript (gzip; reference site: webpack −8.8 KB, Turbopack −6.1 KB). The eager components: `@intecion/ipal-kit/client/eager` +> (``). +> 5. **The Turnstile widget's height is kept free before Cloudflare draws it** (73 px): the form no longer jumps when +> it appears. For an invisible widget: `turnstileReserveHeight={0}` on `RenderForm` / `BuilderForm` +> (`reserveHeight={0}` on `Turnstile`). +> 6. **A background video stops for visitors who asked for less motion** (`prefers-reduced-motion`), after +> hydration; everyone else sees no change. Off: ``. +> 7. **Card hover** (`Card interactive`, the library's link cards) fades a shadow layer instead of animating the +> card's shadow: the same lift, drawn by the compositor. The 1.17 class: `CARD_INTERACTIVE_SHADOW_CLASS`. +> 8. **Fewer database queries per page render** (36–44 %), the lightbox viewer loads on first open, the `/client` +> barrels are no longer one client boundary, the table of contents measures once per frame, Turnstile stops +> polling once drawn, the cookie banner honours reduced motion. Nothing to do. +> +> **New, off until a project turns it on:** `iapl({ unusedMedia: true })` — above the Media list, how many files no +> page, entry or setting uses, with a link to Payload's list filtered to them (deleting stays manual; **run +> `pnpm generate:importmap`** after turning it on); `forms: { submissionRetentionDays }`; `Media eager` (a logo +> above the fold, no high priority); `createNotFoundPage({ load, placeholder })` (the reference site keeps its 404 +> height: CLS 0). +> **Doctor:** the `performance` and `growth` groups (warnings; `growth-versions-config` is a hint), thresholds in +> `iapl-doctor.json` → `growth`. **Agents:** the `iapl-performance` skill (`pnpm exec iapl-skills`) and the budget +> gate template. **Recommended for projects:** `index: true` on `slugHistory.slug`; the heading font with +> `preload: false` (the starter's default now); a placeholder of the 404 content's height. + ## 1.17.2 — version history with readPublished, sign-in and panel actions, staff-only REST submissions and jobs, the cookie button > **Read before upgrading.** No schema change, no migration on any database, no import-map change. What changes for diff --git a/docs/agent/AGENT.md b/docs/agent/AGENT.md index 801dd77..a4ec2d0 100644 --- a/docs/agent/AGENT.md +++ b/docs/agent/AGENT.md @@ -1048,17 +1048,18 @@ Example `styles.css`: [section-code.md](./skills/iapl-block/resources/section-co | above the fold, not the LCP (header logo) | `` — loads at once, no high priority, no preload | `priority` on the logo (it competes with the hero) | | every other image | `` — `sizes` = the width on screen; lazy by default | no `sizes` (downloads the full width), `` | | placeholder | `buildMediaPlaceholderHook` + a field in Media (blur + color) | empty boxes that "jump in" while loading | -| uploads | `buildOptimizeUploadHook` (stops images over 1.5 MB / 2560 px, converts on request); `iapl-doctor --deep` counts stored images over the limits | 8 MB phone photos in the library | -| background video | `videoMode="background"`, MP4 H.264 ≤ 20 MB, no sound, with a poster | a video as the hero without a poster, `autoplay` with sound | +| uploads | `buildOptimizeUploadHook` (stops images over 1.5 MB / 2560 px, converts on request, removes JPEG/PNG metadata — GPS, camera — without re-encoding; `stripMetadata: false` keeps it); `iapl-doctor --deep` counts stored images over the limits | 8 MB phone photos in the library | +| background video | `videoMode="background"`, MP4 H.264 ≤ 20 MB, no sound, with a poster; paused for "reduce motion" by itself (`pauseForReducedMotion={false}` turns that off) | a video as the hero without a poster, `autoplay` with sound | | video with content | `videoMode="player"` (loads after a click) | `preload="auto"` | | YouTube, maps, widgets | `` from `/client` (the iframe only after a click); a map behind a click (a picture + a button) | a bare `