Skip to content

feat!: drop the Next.js dependency with LumyxLinkProvider - #1

Merged
FrekiManagarm merged 1 commit into
mainfrom
feat/framework-agnostic-links
Oct 29, 2026
Merged

FrekiManagarm merged 1 commit into
mainfrom
feat/framework-agnostic-links

Conversation

@FrekiManagarm

@FrekiManagarm FrekiManagarm commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Why

SidebarNav, AppHeader and RoomCard imported next/link and next/navigation, which tied @lumyx/ui to Next.js. The website is moving to Astro, where those imports cannot resolve.

What

  • New LumyxLinkProvider / useLumyxLink (src/lib/link.tsx): apps plug in their router's link component and current pathname once. Without a provider, links are plain <a> and no nav item is active.
  • SidebarNav reads the pathname from the provider and accepts an activeHref override (useful for Astro islands).
  • next leaves peerDependencies and devDependencies. Version bumped to 0.2.0.
  • Tests cover the default anchor, the injected link component, the active item and the activeHref override.

Breaking change

Next.js apps must wrap their pages in <LumyxLinkProvider link={Link} pathname={usePathname()}> to keep client-side navigation and the active nav item. Follow-up PRs do this in lumyx-dev/dashboard and lumyx-dev/cloud. Their lockfiles pin the current main commit, so they keep working until they upgrade.

SidebarNav, AppHeader and RoomCard imported next/link and
next/navigation, which tied the package to Next.js. They now read the
link component and the current pathname from LumyxLinkProvider, and fall
back to plain <a> elements without it. SidebarNav also accepts
activeHref. next leaves the peer dependencies.

BREAKING CHANGE: Next.js apps must wrap their pages in
<LumyxLinkProvider link={Link} pathname={usePathname()}> to keep
client-side navigation and the active nav item.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@FrekiManagarm
FrekiManagarm merged commit 51870ca into main Oct 29, 2026
1 check passed
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