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

@knitkit/react

v0.1.1

Published

Thin React client wrapper for knitkit: <RemoteComponent> (lazy + Suspense + error boundary) over loadRemote.

Readme

@knitkit/react

The thin React client wrapper for knitkit — load a federated remote component by name, with Suspense and an error boundary already wired up.

The package is marked "use client", so you can import it directly into a Next.js App Router server component and it becomes a client boundary automatically — no next.config.js changes.

Usage

import { RemoteComponent } from "@knitkit/react";

export default function Page() {
  return (
    <RemoteComponent
      name="checkout/CartWidget"      // "<remoteName>/<exposeKey>"
      fallback={<Spinner />}          // shown while loading
      errorFallback={(err) => <p>Couldn't load cart: {err.message}</p>}
      onError={(err) => report(err)}
      sku="ABC-123"                   // any extra props are forwarded to the remote
    />
  );
}

The remote's exposed module must default-export a React component. Register your remotes once (browser: registerRemotes from @knitkit/runtime; SSR: registerFederation from @knitkit/node) before the component mounts.

API

| Export | Purpose | | --- | --- | | <RemoteComponent name fallback errorFallback onError {...props} /> | Load + render a remote component with Suspense + error boundary. | | lazyRemote(specifier) | Lower-level: a React.lazy component backed by loadRemote (render it inside your own <Suspense>). Cached per specifier. | | clearRemoteCache(specifier?) | Drop the cached lazy component to retry a remote that previously failed. | | <RemoteErrorBoundary fallback onError> | The error boundary used internally, exported for standalone use. |

<RemoteFragment> — Tier-2 (isolated fragments)

When you don't want to share React — embed a remote fragment's rendered HTML into the host, with its own framework, no singleton:

import { RemoteFragment } from "@knitkit/react";
<RemoteFragment src="https://reviews.example/fragment" fallback={<Spinner />} as="section" />;

It fetches the fragment and embeds the HTML (via dangerouslySetInnerHTML), so <script> tags do not execute — it's static embedding. For interactivity, have the fragment ship its own bootstrap or use an iframe; for edge-side stream stitching see @knitkit/edge. This sidesteps the shared-React constraint entirely (no "invalid hook call").

Notes

  • A remote that fails to load is cached as failed (React.lazy memoizes the rejection). Call clearRemoteCache(name) and re-render to retry.
  • This is the RSC Tier 1 surface: the runtime works inside RSC apps (server components load via @knitkit/node, client components via the browser path behind this wrapper). Fragment-level and module-level RSC federation are later tiers — see the project roadmap.