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

fastcomments-solidjs

v1.0.0

Published

A SolidJS library for FastComments

Readme

fastcomments-solidjs

npm version

A SolidJS library for FastComments. Ports the official fastcomments-react widgets to idiomatic Solid components.

Install

npm install fastcomments-solidjs

Usage

import { FastCommentsCommentWidget } from 'fastcomments-solidjs';

export default function App() {
  return <FastCommentsCommentWidget tenantId="demo" urlId="some-page-id" />;
}

Reacting to config changes (imperative handle)

Solid does not automatically track deep mutations on arbitrary objects, so config changes after the first render must be pushed explicitly. Every widget accepts an apiRef that returns a handle; call handle.update(partial) from a createEffect to drive reactivity:

import { createEffect, createSignal } from 'solid-js';
import { FastCommentsCommentWidget, type FastCommentsCommentWidgetHandle } from 'fastcomments-solidjs';

export default function Paginated() {
  const [page, setPage] = createSignal(0);
  let handle: FastCommentsCommentWidgetHandle | undefined;
  createEffect(() => handle?.update({ urlId: `product-${page()}` }));

  return (
    <>
      <button onClick={() => setPage(page() + 1)}>next</button>
      <FastCommentsCommentWidget
        apiRef={(h) => (handle = h)}
        tenantId="demo"
        urlId={`product-${page()}`}
      />
    </>
  );
}

update() is safe to call at any time:

  • Before the script has loaded: the partial is stashed and applied at init.
  • During an async init (reviews-summary, user-activity-feed): the partial is queued and applied when the callback resolves.
  • After init: it forwards straight to the live widget's .update() method.

Imperative handle API

interface WidgetHandle<Config> {
  getInstance: () => WidgetInstance | null;   // latest live instance (or null before mount)
  onInstance: (cb: (instance: WidgetInstance) => void) => void; // fires once instance is ready
  update: (partial: Partial<Config>) => void; // merge-and-push config
}

Use getInstance() for imperative actions that aren't covered by .update(), e.g. openProfile:

const openProfile = () =>
  (handle?.getInstance() as { openProfile?: (o: { userId: string }) => void } | null)
    ?.openProfile?.({ userId: 'demo' });

Components

Every widget from fastcomments-react is available under the same name:

| Component | Handle type | Embed loaded | | --- | --- | --- | | FastCommentsCommentWidget | FastCommentsCommentWidgetHandle | Flagship live commenting widget | | FastCommentsCommentCountWidget | FastCommentsCommentCountWidgetHandle | Inline comment-count badge | | FastCommentsLiveChatWidget | FastCommentsLiveChatWidgetHandle | Streaming live-chat widget | | FastCommentsCollabChatWidget | FastCommentsCollabChatWidgetHandle | Text-anchored collaborative chat | | FastCommentsImageChatWidget | FastCommentsImageChatWidgetHandle | Region-based image comments | | FastCommentsRecentCommentsWidget | FastCommentsRecentCommentsWidgetHandle | Recent-comments feed | | FastCommentsRecentDiscussionsWidget | FastCommentsRecentDiscussionsWidgetHandle | Recent-discussions feed | | FastCommentsReviewsSummaryWidget | FastCommentsReviewsSummaryWidgetHandle | Star-rating summary | | FastCommentsTopPagesWidget | FastCommentsTopPagesWidgetHandle | Top-commented pages leaderboard | | FastCommentsUserActivityFeedWidget | FastCommentsUserActivityFeedWidgetHandle | Per-user activity timeline |

Widgets that attach to an existing element

FastCommentsCollabChatWidget and FastCommentsImageChatWidget mount into a caller-supplied element. Pass a targetRef accessor that returns the element once mounted:

import { FastCommentsImageChatWidget } from 'fastcomments-solidjs';

export default function ImageChat() {
  let img: HTMLImageElement | undefined;
  return (
    <>
      <img ref={img} src="/screenshot.png" alt="" />
      <FastCommentsImageChatWidget
        tenantId="demo"
        urlId="my-image"
        targetRef={() => img}
      />
    </>
  );
}

Regions

Pass region="eu" to route widget traffic through the EU cluster.

Showcase

A full showcase app lives in examples/example-showcase/. It mirrors the React showcase and covers every widget plus common flows (dark mode, pagination, SSO, callbacks).

cd examples/example-showcase
npm install
npm run dev

Build

npm install
npm run build       # library -> dist/
npm test            # vitest smoke test
npm run build:demo  # showcase -> demo-dist/

License

MIT