Skip to content

Cache getters to avoid redundant recompilation#55

Merged
rameel merged 3 commits intomainfrom
x-format-cache-getters
Apr 4, 2026
Merged

Cache getters to avoid redundant recompilation#55
rameel merged 3 commits intomainfrom
x-format-cache-getters

Conversation

@rameel
Copy link
Copy Markdown
Owner

@rameel rameel commented Apr 4, 2026

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 4, 2026

📦 Bundle size comparison

Name Size Gzip Brotli Δ
alpinegear-when.min.js 1.22 KiB 657 B 570 B
alpinegear-when.esm.min.js 1.15 KiB 625 B 548 B
alpinegear-typegrab.min.js 509 B 348 B 294 B
alpinegear-typegrab.esm.min.js 471 B 333 B 277 B
alpinegear-template.min.js 483 B 326 B 246 B
alpinegear-template.esm.min.js 421 B 294 B 219 B
alpinegear-router.min.js 9.42 KiB 4.04 KiB 3.60 KiB
alpinegear-router.esm.min.js 9.40 KiB 4.02 KiB 3.59 KiB
alpinegear-match.min.js 1.49 KiB 778 B 681 B
alpinegear-match.esm.min.js 1.43 KiB 748 B 660 B
alpinegear-main.min.js 7.03 KiB (+102 B) 2.85 KiB (+28 B) 2.51 KiB (+26 B) 🔴
alpinegear-main.esm.min.js 7.06 KiB (+102 B) 2.89 KiB (+25 B) 2.55 KiB (+20 B) 🔴
alpinegear-hotkey.min.js 2.02 KiB 1.10 KiB 975 B
alpinegear-hotkey.esm.min.js 1.96 KiB 1.07 KiB 958 B
alpinegear-fragment.min.js 1.02 KiB 552 B 484 B
alpinegear-fragment.esm.min.js 980 B 521 B 457 B
alpinegear-format.min.js 1.20 KiB (+102 B) 667 B (+29 B) 578 B (+24 B) 🔴
alpinegear-format.esm.min.js 1.14 KiB (+102 B) 632 B (+29 B) 549 B (+22 B) 🔴
alpinegear-dialog.min.js 1.79 KiB 967 B 822 B
alpinegear-dialog.esm.min.js 1.75 KiB 951 B 811 B
alpinegear-destroy.min.js 191 B 167 B 123 B
alpinegear-destroy.esm.min.js 128 B 123 B 91 B
alpinegear-bound.min.js 3.95 KiB 1.82 KiB 1.58 KiB
alpinegear-bound.esm.min.js 3.91 KiB 1.79 KiB 1.56 KiB

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR optimizes the x-format directive’s attribute processing by caching compiled expression getters, reducing redundant evaluateLater recompilation work during reactive updates.

Changes:

  • Precompute a per-attribute Map of placeholder expression → compiled getter.
  • Reuse cached getters inside the reactive update() callback instead of recompiling on every update.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rameel rameel merged commit 82eec08 into main Apr 4, 2026
2 checks passed
@rameel rameel deleted the x-format-cache-getters branch April 4, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants