본문으로 건너뛰기
cccskills
무료GitHub에 공개

durable-streams-yjs

Integrate Yjs collaborative editing with durable streams over HTTP. Configure document updates and participant presence, manage connection lifecycles, and handle synchronization events, with guidance on required dependencies, binary data formats, and cleanup.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Yjs CRDT sync over durable streams with @durable-streams/y-durable-streams. DurableStreamsProvider setup, document stream and awareness stream config, transport modes (SSE vs long-poll), provider lifecycle (connect, disconnect, destroy), synced/status/error events, lib0 VarUint8Array framing, awareness heartbeat. Requires yjs, y-protocols, lib0 peer dependencies. Load when integrating Yjs collaborative editing with durable streams.

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Adding HTTP synchronization to a Yjs collaborative editor
  • Sharing participant presence alongside document updates
  • Controlling connections and monitoring synchronization status
  • Checking dependencies, binary formats, and cleanup

포함된 파일(1)

  • SKILL.md4.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Durable Streams — Yjs Sync

Sync Yjs documents over HTTP durable streams. No WebSocket infrastructure needed — uses standard HTTP with SSE or long-poll transport. Built-in persistence through stream history, presence support via awareness streams.

Setup

import { DurableStreamsProvider } from "@durable-streams/y-durable-streams"
import * as Y from "yjs"
import { Awareness } from "y-protocols/awareness"

const doc = new Y.Doc()
const awareness = new Awareness(doc)

const provider = new DurableStreamsProvider({
  doc,
  documentStream: {
    url: "https://your-server.com/v1/stream/doc-updates",
    transport: "sse",
  },
  awarenessStream: {
    url: "https://your-server.com/v1/stream/doc-awareness",
    protocol: awareness,
    transport: "sse",
  },
})

provider.on("synced", (synced) => {
  console.log("Synced:", synced)
})

provider.on("status", (status) => {
  console.log("Status:", status) // "disconnected" | "connecting" | "connected"
})

Core Patterns

Document-only sync (no presence)

import { DurableStreamsProvider } from "@durable-streams/y-durable-streams"
import * as Y from "yjs"

const doc = new Y.Doc()

const provider = new DurableStreamsProvider({
  doc,
  documentStream: {
    url: "https://your-server.com/v1/stream/my-doc",
    transport: "sse",
  },
})

Manual connect/disconnect

const provider = new DurableStreamsProvider({
  doc,
  documentStream: { url, transport: "sse" },
  connect: false, // Don't auto-connect
})

// Connect when ready
provider.connect()

// Temporarily disconnect (can reconnect later)
provider.disconnect()

// Permanently destroy (cleanup all listeners and timers)
provider.destroy()

Dynamic auth headers

const provider = new DurableStreamsProvider({
  doc,
  documentStream: {
    url: "https://your-server.com/v1/stream/my-doc",
    transport: "sse",
    headers: {
      Authorization: () => `Bearer ${getAccessToken()}`,
    },
  },
})

Common Mistakes

HIGH Forgetting peer dependencies for Yjs

Wrong:

npm install @durable-streams/y-durable-streams

Correct:

npm install @durable-streams/y-durable-streams yjs y-protocols lib0

yjs, y-protocols, and lib0 are peer dependencies. Missing them causes import errors at runtime.

Source: packages/y-durable-streams/package.json peerDependencies

HIGH Using application/json content type for Yjs streams

Wrong:

documentStream: {
  url: "https://server.com/v1/stream/doc-1",
  transport: "sse",
  contentType: "application/json",
}

Correct:

documentStream: {
  url: "https://server.com/v1/stream/doc-1",
  transport: "sse",
  // Content type defaults to application/octet-stream (binary)
}

Yjs documents use binary encoding (lib0 VarUint8Array). The stream must use application/octet-stream, not application/json. The provider handles this automatically — don't override the content type.

Source: packages/y-durable-streams/src/y-durable-streams.ts BINARY_CONTENT_TYPE

HIGH Not calling destroy() on cleanup

Wrong:

useEffect(() => {
  const provider = new DurableStreamsProvider({ doc, documentStream: config })
  return () => provider.disconnect() // Only disconnects, doesn't clean up!
}, [])

Correct:

useEffect(() => {
  const provider = new DurableStreamsProvider({ doc, documentStream: config })
  return () => provider.destroy() // Full cleanup
}, [])

disconnect() only closes the connection — destroy() also removes doc/awareness listeners and clears the 15-second awareness heartbeat interval.

Source: packages/y-durable-streams/README.md API methods

See also

  • reading-streams — Yjs provider uses SSE/long-poll transport from the client library

Version

Targets @durable-streams/y-durable-streams v0.2.1.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Automate website navigation, form entry, and clicks through a browser command line tool. Extract page text, capture screenshots, and compare page states to check interactions or test web app behavior across screen sizes.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Automate form entry and button clicks
  • Extract text from web pages
  • Save page screenshots and PDFs
humanlayer/humanlayer1.2만2026년 10월 24일 업데이트

Rewrite dense or ambiguous English into short, direct sentences using principles from ASD-STE100, a standard for clear technical English. It preserves facts and conditions, identifies writing issues, and shows the original and revised text side by side.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Clarifying English instructions for another agent
  • Simplifying English tool descriptions and error messages
  • Making English easier for non-native readers
humanlayer/humanlayer1.2만2026년 10월 24일 업데이트

Inspect GitHub pull requests, read review conversations, and investigate failed automated checks with dedicated scripts. Get consolidated status reports, unresolved discussion threads, and failing job or step logs, with full logs saved for further inspection.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Checking pull request status in one report
  • Reading unresolved review conversations
  • Investigating failed CI jobs and steps
humanlayer/humanlayer1.2만2026년 10월 24일 업데이트

Update release base versions for supported packages, keep matching version fields in sync, and verify generated versions. The workflow covers committing and pushing the changes, with guidance for release steps after merging.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Prepare a package version update for release
  • Synchronize version fields across related files
  • Verify generated versions before pushing
humanlayer/humanlayer1.2만2026년 10월 24일 업데이트

calldiff

무료

Compare function call structures across Git commits, branches, or working files to support code review. Display call trees and trace paths from an entry function to a target function, with support for 22 languages.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Compare function calls before and after a change
  • Review call structure changes between branches
  • Trace paths from an entry function to a target
humanlayer/humanlayer1.2만2026년 10월 24일 업데이트

Automate browser tasks from the terminal using the chrome-devtools-mcp CLI. Inspect page elements, click and fill forms, navigate tabs, capture screenshots, and investigate network requests, console messages, performance, and memory through shell commands.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Automating form input and page navigation
  • Capturing page or element screenshots
  • Investigating network requests and console errors
humanlayer/humanlayer1.2만2026년 10월 24일 업데이트

humanlayer의 스킬 모두 보기

이 스킬의 문제 신고