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

@jorvel/mount

v0.3.0

Published

Framework-neutral remote mount contract for JORVEL — mount(ctx)/unmount so a host can embed a remote built with any framework.

Readme

@jorvel/mount

The framework-neutral remote contract for JORVEL micro-frontends.

A host mounts a remote by handing it a DOM node + context and calling mount(ctx). The remote bootstraps whatever framework it likes into that node and returns a disposer. The host never imports the remote's framework — so a React host can embed a Vue / Angular / Solid / Svelte remote, and vice-versa.

export interface JorvelMountModule {
  mount(ctx: JorvelMountContext): void | JorvelUnmount | Promise<void | JorvelUnmount>;
  unmount?(el: HTMLElement): void;
}

export interface JorvelMountContext {
  el: HTMLElement;                    // the node the remote owns
  subpath: string;                    // path relative to the mount prefix
  basePath: string;                   // the prefix the host mounted under
  params: Record<string, string>;     // route params
  props?: Record<string, unknown>;    // host-passed props
  signal?: AbortSignal;               // aborted on unmount/navigation
}

Authoring a remote

  • React → use @jorvel/adapter-react's defineReactRemote(Component).
  • Any framework → export a JorvelMountModule directly:
import type { JorvelMountModule } from '@jorvel/mount';

const remote: JorvelMountModule = {
  mount({ el, subpath }) {
    const app = createMyFrameworkApp(subpath);
    app.mount(el);
    return () => app.destroy();
  },
};
export default remote;

Mounting from a plain-DOM host

import { asMountModule, mountRemoteModule } from '@jorvel/mount';

const mod = asMountModule(await importRemote());
if (mod) {
  const dispose = mountRemoteModule(mod, { el, subpath, basePath, params });
  // …later, on navigation away:
  dispose();
}

React hosts don't call this directly — @jorvel/runtime's RemoteOutlet detects a mount module and bridges it automatically.

Web Component embed

Wrap any mount module as a custom element for non-JORVEL / plain-HTML hosts:

import { defineCustomElement } from '@jorvel/mount';
defineCustomElement('jorvel-pricing', remote);
<jorvel-pricing subpath="/plans" basepath="/pricing"></jorvel-pricing>

Cross-framework SSR — @jorvel/mount/ssr

Server-render each framework's fragment, stitch, and hydrate:

import { renderFragment, composeFragments, hydrateFragments } from '@jorvel/mount/ssr';

// server
const fragments = await Promise.all([
  renderFragment('pricing', pricingServer, ctx),
  renderFragment('reports', reportsServer, ctx),
]);
const { html } = composeFragments(fragments, { template });

// client
await hydrateFragments({
  pricing: () => import('pricing/App'),
  reports: () => import('reports/App'),
});

A remote's server side is a JorvelServerModule (renderToString(ctx)); the matching client mount honors ctx.hydrate to reuse the server DOM. See the guide.

Zero dependencies, framework-free.