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

@realflow/compat

v0.2.1

Published

Drop-in React Flow (xyflow) API compatibility layer for RealFlow. Migrate an existing React Flow app by changing one import.

Readme

@realflow/compat

npm version license types

A drop-in React Flow (xyflow) API compatibility layer for RealFlow. Migrate an existing React Flow app by changing your imports — and get RealFlow's undo/redo and viewport culling for free, at no extra work.

npm install @realflow/compat

Migrate in one diff

- import { ReactFlow, Handle, Position, useReactFlow } from '@xyflow/react';
+ import { ReactFlow, Handle, Position, useReactFlow } from '@realflow/compat';
- import '@xyflow/react/dist/style.css';
+ import '@realflow/compat/style.css';

Your existing controlled React Flow code keeps working unchanged:

import { useCallback } from 'react';
import {
  ReactFlow, Background, Controls, MiniMap,
  useNodesState, useEdgesState, addEdge, type Connection,
} from '@realflow/compat';
import '@realflow/compat/style.css';

const initialNodes = [
  { id: '1', position: { x: 0, y: 0 }, data: { label: 'Input' } },
  { id: '2', position: { x: 240, y: 80 }, data: { label: 'Output' } },
];
const initialEdges = [{ id: 'e1-2', source: '1', target: '2' }];

export default function Flow() {
  const [nodes, , onNodesChange] = useNodesState(initialNodes);
  const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);
  const onConnect = useCallback(
    (c: Connection) => setEdges((eds) => addEdge(c, eds)),
    [setEdges],
  );

  return (
    <div style={{ width: '100vw', height: '100vh' }}>
      <ReactFlow
        nodes={nodes}
        edges={edges}
        onNodesChange={onNodesChange}
        onEdgesChange={onEdgesChange}
        onConnect={onConnect}
      >
        <Background />
        <Controls />
        <MiniMap />
      </ReactFlow>
    </div>
  );
}

What's supported

The adapter maps React Flow's controlled model onto RealFlow's engine:

  • ComponentsReactFlow, ReactFlowProvider, Handle (type / position props), Background, MiniMap, Controls, Panel, NodeResizer, NodeToolbar
  • HooksuseReactFlow, useNodesState, useEdgesState, useOnSelectionChange
  • Change helpersapplyNodeChanges, applyEdgeChanges, addEdge, reconnectEdge
  • EnumsPosition, MarkerType, ConnectionMode, ConnectionLineType, PanOnScrollMode
  • TypesNode, Edge, Connection, NodeChange, EdgeChange, NodeProps, EdgeProps, OnConnect, ReactFlowInstance, Viewport, ReactFlowProps, and more

Custom nodeTypes / edgeTypes, onConnect, and the <Handle type position> API all keep working. Coverage targets the common migration surface — see the migration guide for the exact map and the few APIs that need manual attention.

Why migrate?

Once you're on the RealFlow engine you get, without changing your app code:

  • Undo / redo — transactional, drag-coalescing (⌘Z / ⌘⇧Z)
  • Viewport culling — spatial-hash backed, on by default (large graphs stay interactive)
  • Zero-render pan/zoom — the viewport transform is written straight to the DOM

When you're ready, drop the compat layer and adopt the native, less-boilerplate @realflow/react API (useRealFlow() — no onNodesChange / applyNodeChanges wiring).

Related packages

| Package | What it is | | --- | --- | | @realflow/react | The native RealFlow React renderer | | @realflow/core | Headless, zero-dependency engine |

License

MIT © RealFlow contributors.