Skip to content

plugin/router: leave external links to the browser - #75

Merged
rameel merged 1 commit into
mainfrom
router/external-links
Oct 25, 2026
Merged

rameel merged 1 commit into
mainfrom
router/external-links

Conversation

@rameel

@rameel rameel commented Oct 25, 2026

Copy link
Copy Markdown
Owner

x-router:link intercepted every click and navigated to the link's path, ignoring where the link leads: a link to another origin opened the same path within the application, and mailto: and tel: links navigated to their address or number as a path. $active compared only the path as well, so an external link to / was active on the home page.

Links whose protocol or host differs from the page's are now left to the browser, and $active is false for them.

x-router:link intercepted every click and navigated to the link's path,
ignoring where the link leads. A link to another origin opened the same
path within the application, and "mailto:" and "tel:" links navigated
to their address or number as a path. $active compared only the path as
well, so an external link to "/" was active on the home page.

Treat a link whose protocol or host differs from the page's as external:
the click handler leaves it to the browser, and $active is false for it.
The origin is not compared, since browsers report it differently for
file: URLs.
@github-actions

Copy link
Copy Markdown

📦 Bundle size comparison

Name Size Gzip Brotli Δ
alpinegear-bound.esm.min.js 3.96 KiB 1.81 KiB 1.57 KiB
alpinegear-bound.min.js 4.00 KiB 1.83 KiB 1.59 KiB
alpinegear-destroy.esm.min.js 128 B 123 B 91 B
alpinegear-destroy.min.js 191 B 167 B 123 B
alpinegear-dialog.esm.min.js 1.75 KiB 951 B 811 B
alpinegear-dialog.min.js 1.79 KiB 967 B 822 B
alpinegear-format.esm.min.js 1.18 KiB 645 B 579 B
alpinegear-format.min.js 1.25 KiB 680 B 587 B
alpinegear-fragment.esm.min.js 1.51 KiB 785 B 667 B
alpinegear-fragment.min.js 1.57 KiB 817 B 700 B
alpinegear-hotkey.esm.min.js 1.97 KiB 1.08 KiB 964 B
alpinegear-hotkey.min.js 2.03 KiB 1.10 KiB 996 B
alpinegear-main.esm.min.js 7.76 KiB 3.17 KiB 2.79 KiB
alpinegear-main.min.js 7.73 KiB 3.12 KiB 2.74 KiB
alpinegear-markdown.esm.min.js 19.27 KiB 7.26 KiB 6.61 KiB
alpinegear-markdown.min.js 19.32 KiB 7.27 KiB 6.63 KiB
alpinegear-match.esm.min.js 1.98 KiB 1004 B 868 B
alpinegear-match.min.js 2.05 KiB 1.01 KiB 897 B
alpinegear-router.esm.min.js 9.50 KiB (+89 B) 4.06 KiB (+33 B) 3.63 KiB (+31 B) 🔴
alpinegear-router.min.js 9.53 KiB (+89 B) 4.08 KiB (+32 B) 3.64 KiB (+29 B) 🔴
alpinegear-safehtml.esm.min.js 806 B 543 B 457 B
alpinegear-safehtml.min.js 853 B 569 B 485 B
alpinegear-template.esm.min.js 421 B 294 B 219 B
alpinegear-template.min.js 483 B 326 B 246 B
alpinegear-typegrab.esm.min.js 471 B 333 B 277 B
alpinegear-typegrab.min.js 509 B 348 B 294 B
alpinegear-when.esm.min.js 1.71 KiB 883 B 761 B
alpinegear-when.min.js 1.77 KiB 914 B 787 B

@rameel
rameel merged commit a0b733a into main Oct 25, 2026
2 checks passed
@rameel
rameel deleted the router/external-links branch October 25, 2026 19:50
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.

1 participant