
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@rpcbase/router
Advanced tools
@rpcbase/routerlazyRoute (replacement for loadRoute)loadRoute has been removed.
Use lazyRoute everywhere.
Before:
import { Route, loadRoute } from "@rpcbase/router"
const homePageRoute = loadRoute(import("@/pages/HomePage"))
<Route path="/" {...homePageRoute} />
After:
import { Route, lazyRoute } from "@rpcbase/router"
const homePageRoute = lazyRoute(() => import("@/pages/HomePage"))
<Route path="/" {...homePageRoute} />
A lazy route module should export:
default: React componentloader (optional): route loaderexport default function HomePage() {
return <h1>Home</h1>
}
export const loader = async ({ ctx }) => {
return { user: ctx.req.session?.user ?? null }
}
Use a function that returns the import promise:
lazyRoute(() => import("@/pages/HomePage"))
Do not pass an already-started promise:
lazyRoute(import("@/pages/HomePage"))
Why:
() => import(...) delays loading until route lazy resolution/prefetch.Code prefetch can happen without data prefetch by default.
If you want route data prefetch for a route, set prefetchData: true:
const reportsRoute = lazyRoute(() => import("@/pages/ReportsPage"), {
prefetchData: true,
})
Use useQueryOverlay to drive modal/drawer/sheet state from a query param.
import { useQueryOverlay } from "@rpcbase/router"
type SupportOverlay = "support" | "feedback"
const isSupportOverlay = (value: string | null): value is SupportOverlay =>
value === "support" || value === "feedback"
function useSupportOverlay() {
return useQueryOverlay<SupportOverlay>({
param: "modal",
parse: (value) => (isSupportOverlay(value) ? value : null),
})
}
Returned API:
value: parsed value from the query param (T | null)isOpen: true when value !== nullbuildHref(nextValue): builds next URL for links/prefetchopenOverlay(nextValue): navigates with the query param set (replace: true)closeOverlay(): navigates with the query param removed (replace: true)Use useShortcutPrefetchNavigate to prefetch on keydown and navigate on keyup.
This avoids losing pending shortcut state across rerenders.
import { useRoutePrefetch, useShortcutPrefetchNavigate } from "@rpcbase/router"
function SupportShortcut({ getHref }: { getHref: () => string }) {
const { prefetch } = useRoutePrefetch()
useShortcutPrefetchNavigate({
shortcut: { key: "k", mod: true },
trigger: "keyup",
getHref,
prefetch,
})
return null
}
Default behavior:
input, textarea, select, or content editableevent.preventDefault()navigate is not providedFAQs
`loadRoute` has been removed. Use `lazyRoute` everywhere.
We found that @rpcbase/router demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.