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

@jiujue/weave-adapter-offscreen

v3.0.4

Published

Weave 浏览器 Worker 适配:消息协议 + OffscreenCanvas + replay。

Readme

@jiujue/weave-adapter-offscreen

OffscreenCanvas adapter for Weave: Runs the engine in a Web Worker and communicates with the main thread via a message protocol.

Position in Weave (Layering)

| Layer | Package | Role | | ------------------- | --------------------------------- | ------------------------------------------ | | Scene Data | @jiujue/weave-types | SceneNode/patch/TextMeasurer | | Engine Core | @jiujue/weave-core | layout + paint | | Drawing Replay | @jiujue/weave-displaylist | Replay to OffscreenCanvas 2D context | | Platform Adaptation | @jiujue/weave-adapter-offscreen | Worker protocol + Lifecycle + Render drive | | End-to-End Entry | @jiujue/weave-app | Uses this adapter by default on browsers |

Installation

pnpm add @jiujue/weave-adapter-offscreen

Protocol

This adaptation layer uses a message-based protocol for communication between the main thread and the Worker.

Requests (Main -> Worker)

  • WEAVE_INIT: Initialize the engine.
  • WEAVE_PATCH: Send scene updates (patches).
  • WEAVE_SET_SCENE: Replace the entire scene.
  • WEAVE_RESIZE: Update canvas dimensions.
  • WEAVE_RENDER: Request a render frame.
  • WEAVE_HIT_TEST: Request a hit test at specific coordinates.
    • Payload: { type: 'WEAVE_HIT_TEST', requestId: number, x: number, y: number }

Responses (Worker -> Main)

  • WEAVE_READY: Engine is initialized.
  • WEAVE_ERROR: An error occurred.
  • WEAVE_HIT_TEST_RESULT: Response to hit test.
    • Payload: { type: 'WEAVE_HIT_TEST_RESULT', requestId: number, result: { id: string, path: string[] } | null }

Usage

import { createOffscreenClient } from '@jiujue/weave-adapter-offscreen'

const client = createOffscreenClient({
  canvas: document.querySelector('canvas'),
  worker: new Worker(...)
})

// Async Hit Test
const result = await client.hitTest(100, 100)

Better to use the end-to-end entry: @jiujue/weave-app (defaults to Worker + OffscreenCanvas on browsers).

Composition (Typical Usage)

  • End-to-end: @jiujue/weave-app (Browser) has this adapter built-in; usually no need for direct dependency.
  • Worker protocol only: You can use the client/worker from this package directly to integrate custom Worker management.

AI / Skills

Related Demos