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

@forgegraph/react

v0.4.0

Published

React workspace bindings for a ForgeGraph app bundle: typed hooks over the generated client.

Readme

@forgegraph/react

Generated record forms and purpose-built gizmos over the same Forge runtime.

npm install @forgegraph/react

Generated forms

Workspace renders tables, field editors, lifecycle actions, and CSV import from the compiled ui/1 descriptor. Record edits use an edit buffer followed by changeset preview, approval, and commit. A ForgeCall supplies the authenticated transport; storage and credentials are not part of the UI.

import { Workspace, type ForgeCall } from "@forgegraph/react";

// descriptor comes from the deployed bundle; call is your generated client's call.
<Workspace descriptor={descriptor} call={call} />;

Gizmos alongside the forms

A gizmo is an application-owned interface for a specific business task: a customer directory, approval queue, support inbox, or scheduling board. Its layout, navigation, visual treatment, and interactions are ordinary React, so they can be customized independently of the generated forms.

GizmoWorkspace supplies the Data & forms / Gizmos switch and a launcher. The generated forms remain available whether or not a compatible gizmo is installed.

import {
  GizmoWorkspace,
  type GizmoDefinition,
  type GizmoProps,
} from "@forgegraph/react";

function SupportInbox({ descriptor, call, openForms, onDirtyChange }: GizmoProps) {
  // Load through call(operationId, input, options).
  // Render your own queue, cards, filters, dialogs, and actions.
  // Set onDirtyChange(true) for unsaved input or an in-flight write;
  // clear it only after saving or explicitly discarding the input.
  return <button onClick={() => openForms("tickets")}>Open ticket forms</button>;
}

const supportInbox: GizmoDefinition = {
  id: "support-inbox",
  title: "Support inbox",
  description: "Work through tickets and escalations.",
  supports: d => d.package === "@example/support" &&
    d.resources.some(r => r.route === "tickets"),
  component: SupportInbox,
};

<GizmoWorkspace descriptor={descriptor} call={call} gizmos={[supportInbox]} />;

The example above illustrates registration; the console's customer directory (packages/console/web/gizmos/customer-directory.tsx) is a working custom UI with bounded pagination, search within the loaded page, error/retry states, and a link back to its collection's forms. Register console gizmos in packages/console/web/gizmos/index.ts. supports is a pure, synchronous contract compatibility check; restrict it by package and required resources/fields as appropriate. Components can be React.lazy components with their own Suspense fallback. Gizmo IDs must be unique within a registry.

Shared behavior

  • descriptor describes the deployed application, not an uncommitted draft.
  • call is the same operation transport used by the forms. In the console it preserves environment, purpose, build/deployment preconditions, and server-only runtime credentials. It is not a new permission grant.
  • openForms(route?) opens a standard collection. It refuses navigation while the gizmo has reported unsaved work.
  • onDirtyChange must cover both local edits and pending writes. The host blocks switching experiences/environments and warns on reload until it is cleared.
  • Switching experiences after saving remounts the destination so it loads fresh data. Design/Use switching keeps the active Use experience mounted.
  • Custom writes must use the declared operation contracts. Supply expectedVersion for record updates/actions, handle runtime Problem Details, and use changeset review for bulk edits. EditBuffer and buildChangeset are exported for this purpose; gizmos do not get a separate mutation path.
  • A render failure is contained to the custom surface so users can reopen the generated forms. Async failures should be handled in the gizmo itself.

Gizmos are trusted, bundled application code. This is a component integration point, not a sandbox for untrusted remote JavaScript, a visual gizmo builder, or a plugin marketplace. Presentation choices never replace runtime authorization.

Apache-2.0