npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tanstack-router-remote

v1.0.0

Published

Attach remote route trees to a TanStack Router host at runtime — React, Solid and Vue.

Downloads

155

Readme

tanstack-router-remote

Production-oriented route-tree attachment for TanStack Router microfrontends, for React, Solid and Vue. It supports ordinary CSR attachment and a documented, non-streaming SSR/hydration bootstrap. It is the current bridge for remote route modules while TanStack Router has no first-class remote-tree composition API. It has no Module Federation dependency: provide loadRouteTree(): Promise<AnyRoute> from any transport.

It is supported for the repository's documented TanStack Router version range and covered by runtime and browser-like integration tests. The public API follows semver; the internals depend on TanStack behaviour that is not an official composition API, so an upstream release can narrow the supported peer range in a minor. See the repository compatibility contract and limitations.

ESM only. Every framework peer is optional, so a Vue host never installs React.

Entry points

| Import | Use it to | | ------------------------------ | ----------------------------------------------------- | | tanstack-router-remote/react | build a React host or remote | | tanstack-router-remote/solid | build a Solid host or remote | | tanstack-router-remote/vue | build a Vue host or remote | | tanstack-router-remote | implement a binding for a framework with no entry yet |

Applications use the framework entry — it supplies the binding, adds the mount component, and re-exports the attachment types:

import { RemoteRouterAdapter } from 'tanstack-router-remote/react'

The root is the extension point, not a second way to do the same thing. It exports the bare RemoteRouterAdapter — whose constructor takes a FrameworkBinding — plus the three types that binding needs. Everything the adapter does to a route tree is already framework-neutral, so a new framework means implementing three operations, not reimplementing attachment:

import {
  RemoteRouterAdapter,
  type FrameworkBinding,
} from 'tanstack-router-remote'
import { createRootRoute } from '@tanstack/svelte-router'

const svelteBinding: FrameworkBinding = {
  createRootRoute: (options) => createRootRoute(options as never),
  createRemoteRootBridge, // project the remote root onto a pathless bridge
  configureStructuralNotFound, // point the mount's 404 at the remote boundary
}

const adapter = new RemoteRouterAdapter(() => router, svelteBinding)

src/react/internal/binding.ts is the smallest complete example — 15 lines.

The host owns one adapter and provides it above its RouterProvider:

import {
  RemoteRouterAdapter,
  RemoteRouterProvider,
} from 'tanstack-router-remote/react'

const adapter = new RemoteRouterAdapter(() => router)

<RemoteRouterProvider adapter={adapter}>
  <RouterProvider router={router} />
</RemoteRouterProvider>

Every RemoteRouteMount, including one rendered by a nested remote, then uses that same adapter automatically:

<RemoteRouteMount
  mountRoute={Route}
  loadRouteTree={async () =>
    (await loadRemote('someRemote/routeTree')).routeTree
  }
  loading={<Spinner />}
  error={(error) => <RemoteLoadError error={error} />}
>
  <Outlet />
</RemoteRouteMount>

That singleton routeTree form is appropriate for a CSR document and may be attached once there. SSR/hydration instead requires the remote module to expose createRouteTree(): AnyRoute and to return a fresh tree for every server request and matching client bootstrap.

Create code mounts with createRemoteRoute({ ... }) before creating the host router. It has the same options and inferred type as TanStack createRoute, but prepares the mount internally. For a standard file route, wrap the generated declaration so the decoration is the exported value:

export const Route = createRemoteRoute(
  createFileRoute('/catalog')({ component: CatalogMount }),
)

TanStack's generator reads the inner createFileRoute call, so no build-time transform is needed. See the runnable file-route example. Render RemoteRouteMount from the route's normal component: a deep link below an unattached mount fuzzy-matches the mount itself, so that one component also covers the direct-link case. See the repository README for the full contract and limitations.

For SSR/hydration, call adapter.prepare(...) with fresh host and remote trees before server router.load() or client hydrate(router). prepare() exposes the intermediate prepared state and deliberately does not perform a CSR rematch. The full request/bootstrap sequence is documented in the repository SSR guide.

Not affiliated with or endorsed by TanStack.