Skip to content

feat: atomic-wind CSS generator warmup#2874

Open
abaicus wants to merge 2 commits into
developmentfrom
feat/aw-warmup
Open

feat: atomic-wind CSS generator warmup#2874
abaicus wants to merge 2 commits into
developmentfrom
feat/aw-warmup

Conversation

@abaicus

@abaicus abaicus commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds Atomic Wind blocks style builder warmup when saving the editor content.

Test instructions

  • Logged in as Admin/Editor in wp-admin
  • Page/post created with Atomic Wind blocks using visually obvious classes (e.g. bg-orange-500, md:py-36, columns)

Happy path — cache warms at save

  • Open DevTools → Network; click Publish/Update
  • A request fires to /?atomic_wind_css_warm=<nonce>&post_id=<id>&v=<timestamp>200, header X-Robots-Tag: noindex
  • A follow-up POST to otter/v1/atomic-wind (style-builder saving the CSS)
  • In DevTools → Elements, a hidden iframe #atomic-wind-css-warm-frame appears briefly, then is removed
  • Post meta _atomic_wind_css is now populated and contains the expected classes — without visiting the front end
    • wp post meta get <post_id> _atomic_wind_css
  • Front end (Incognito/fresh visitor) renders fully styled immediately — no flash of unstyled content

Re-save / updates

  • Change a class (e.g. bg-orange-500bg-blue-500), Update
  • _atomic_wind_css reflects the new class (the v=<timestamp> cache-bust forces a fresh render)
  • Front end shows the updated styling after refresh

Edge cases

  • No Atomic Wind blocks: plain post saves → no warm request fires, no errors
  • Autosave: wait for autosave (don't manually save) → no warm pass triggered
  • Failed save: simulate/observe a save failure → no warm pass triggered
  • Rapid double-save: only one #atomic-wind-css-warm-frame exists at a time (old one removed)
  • Timeout safety net: if the iframe never reports done, it's still removed after ~20s

Security gates

  • Visiting /?atomic_wind_css_warm=bogus&post_id=<id> directly → not served (falls through to normal page)
  • As Subscriber / logged-out with any nonce → warm page not served (requires edit_post)
  • As post author/Admin with valid nonce → stripped warm document renders

Automated tests (optional, for devs)

  • npm run test:unit:php:base -- --filter TestAtomicWindBlocks → green
  • npm run lint -- src/atomic-wind and npm run lint:php → clean

Regression sanity

  • Existing Atomic Wind pages still render correctly on front end
  • No new console errors or PHP notices during save/view


Checklist before the final review

  • Included E2E or unit tests for the changes in this PR.
  • Visual elements are not affected by independent changes.
  • It is at least compatible with the minimum WordPress version.
  • It loads additional script in frontend only if it is required.
  • Does not impact the Core Web Vitals.
  • In case of deprecation, old blocks are safely migrated.
  • It is usable in Widgets and FSE.
  • Copy/Paste is working if the attributes are modified.
  • PR is following the best practices

@pirate-bot pirate-bot added the pr-checklist-incomplete The Pull Request checklist is incomplete. (automatic label) label Jun 18, 2026
@pirate-bot

Copy link
Copy Markdown
Contributor

Bundle Size Diff

Package Old Size New Size Diff
Animations 178.27 KB 178.27 KB 0 B (0.00%)
Blocks 1.52 MB 1.52 MB 0 B (0.00%)
CSS 7.87 KB 7.87 KB 0 B (0.00%)
Dashboard 111.06 KB 111.06 KB 0 B (0.00%)
Onboarding 68.14 KB 68.14 KB 0 B (0.00%)
Export Import 4.7 KB 4.7 KB 0 B (0.00%)
Pro 328.43 KB 328.43 KB 0 B (0.00%)

@pirate-bot

pirate-bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Plugin build for 011e1e2 is ready 🛎️!

@pirate-bot

pirate-bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

E2E Tests

Playwright Test Status: See serial and parallel matrix jobs

Performance Results serverResponse: {"q25":391.7,"q50":407.75,"q75":429.7,"cnt":10}, firstPaint: {"q25":535.6,"q50":631.05,"q75":678.3,"cnt":10}, domContentLoaded: {"q25":3246.3,"q50":3282.4,"q75":3358.2,"cnt":10}, loaded: {"q25":3248.4,"q50":3284.35,"q75":3360.1,"cnt":10}, firstContentfulPaint: {"q25":3750.6,"q50":3774.25,"q75":3856,"cnt":10}, firstBlock: {"q25":13129.8,"q50":13295.9,"q75":13430.2,"cnt":10}, type: {"q25":23,"q50":24.01,"q75":25.14,"cnt":10}, typeWithoutInspector: {"q25":20.08,"q50":20.63,"q75":21.12,"cnt":10}, typeWithTopToolbar: {"q25":28.35,"q50":29.3,"q75":32.72,"cnt":10}, typeContainer: {"q25":12.71,"q50":13.21,"q75":13.76,"cnt":10}, focus: {"q25":103.31,"q50":107.1,"q75":111.79,"cnt":10}, inserterOpen: {"q25":37.57,"q50":38.57,"q75":38.96,"cnt":10}, inserterSearch: {"q25":12.76,"q50":13.04,"q75":13.71,"cnt":10}, inserterHover: {"q25":5.06,"q50":5.2,"q75":5.34,"cnt":20}, loadPatterns: {"q25":1428.87,"q50":1472.17,"q75":1525.55,"cnt":10}, listViewOpen: {"q25":205.16,"q50":211.42,"q75":223.39,"cnt":10}

Co-authored-by: abaicus <15010186+abaicus@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-checklist-incomplete The Pull Request checklist is incomplete. (automatic label)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants