Skip to content

Instantly share code, notes, and snippets.

View schickling's full-sized avatar
Making the web better

Johannes Schickling schickling

Making the web better
View GitHub Profile
@schickling
schickling / EXPLANATION.md
Created December 28, 2025 12:26
Effect RPC handler type-safety pitfall repro

Effect RPC handler type-safety pitfall (repro)

Summary

When RpcGroup.toLayer is called with Effect.succeed(handlers), the handler effect’s requirements (R) are erased. This compiles even if a handler uses a service that is never provided, and it fails at runtime with “Service not found”.

This repro shows:

  • Unsafe pattern: compiles, but fails at runtime
@schickling
schickling / livestore-leader-exit-handoff-stall.md
Created December 25, 2025 11:58
LiveStore: Leader-Exit Handoff Stall - Root Cause Analysis

LiveStore: Leader-Exit Handoff Stall - Root Cause Analysis

Executive Summary

When a leader session exits while a follower has pending events, the follower's attempt to become the new leader stalls indefinitely. This is caused by the Effect Worker mechanism not detecting worker termination and propagating it to pending streams.

Impact: Pending events remain stuck, GetLeaderSyncState times out after 1s.

Root Cause: Effect Worker streams don't error out when the underlying worker terminates, causing the SharedWorker to block new requests while old ones hang.

@schickling
schickling / research.md
Created December 16, 2025 16:25
Analysis: Durable Streams as a LiveStore sync provider - challenges and limitations

Durable Streams Sync Provider - Research

Overview

This document analyzes the feasibility of creating a LiveStore sync provider targeting Durable Streams, an open HTTP-based protocol for real-time sync developed by Electric.

Durable Streams Architecture

Core Concepts

@schickling
schickling / README.md
Created December 16, 2025 14:18
Static Hermes + Effect Framework Compatibility Report - December 2025

Static Hermes + Effect Experiment

This experiment tests the compatibility of Effect framework with Static Hermes, Facebook's ahead-of-time JavaScript compiler.

Summary

Effect works with Static Hermes in both interpreted and native binary compilation modes. This enables Effect-based applications to be compiled to standalone native executables.

Setup

@schickling
schickling / effect-httpclient-usage-guide.md
Created December 5, 2025 08:32
Effect HttpClient usage patterns with verified examples (Bun + FetchHttpClient)

Effect HttpClient Usage Guide

Minimal verified recipe (Bun + FetchHttpClient)

  • Tested against httpbin; includes retries, base URL, schema decoding.
import { FetchHttpClient, HttpClient, HttpClientRequest, HttpClientResponse } from "@effect/platform"
import { Effect, Schema, Schedule } from "effect"

const Args = Schema.Record({ key: Schema.String, value: Schema.String })
@schickling
schickling / netlify-feedback.md
Created October 23, 2025 09:38
Netlify + Astro: Limitations and Suggestions

Netlify + Astro: Limitations and Suggestions

  • Edge bundling (Astro + Netlify adapter)

    • Limitation: astro build does not emit the final .netlify/edge-functions-dist bundle; only the Netlify build phase produces it. This makes “prebuild + deploy --no-build” unreliable for attaching Edge Functions.
    • Suggestion: Provide a documented, supported way to generate the edge bundle alongside astro build (or an explicit netlify edge:bundle/edge:deploy that attaches prebuilt bundles without a full build).
  • Deploy CLI outputs (permalink vs deploy URL)

    • Limitation: netlify deploy --json consistently returns the per‑deploy URL (e.g. https://<id>--<site>.netlify.app) but not a stable permalink/primary domain URL. The url field is inconsistent and not documented as canonical.
    • Suggestion: Always include canonical site/permalink URLs in the JSON result, and document the fields clearly (e.g. primary_url, alias_url).
@schickling
schickling / redwood-ssr-wasm-report.md
Created October 22, 2025 18:09
Redwood Dev SSR + WASM (workerd) — Problem Report

Redwood Dev SSR + WASM (workerd) — Problem Report

This document summarizes the issues we’re seeing when running Redwood SDK (rwsdk) with Vite dev + workerd SSR in a project using LiveStore. It groups the problems by area, provides concrete evidence (errors, file references), root‑cause analysis, and upstream solution ideas for the Redwood team.

Scope: Vite 7.x, @cloudflare/vite-plugin, rwsdk@1.0.0-beta.12, dev SSR runner targeting a worker-like (workerd) environment.

1) Dep Optimizer Pulls lightningcss into SSR Runtime

Symptoms

@schickling
schickling / vite-optimize-deps-module-graph.mmd
Created October 21, 2025 09:56
Vite optimizeDeps module graph diagram
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@schickling
schickling / ws-chunking.ts
Created September 22, 2025 19:42
Cloudflare WS chunking helper
import { Chunk } from '@livestore/utils/effect'
const textEncoder = new TextEncoder()
/**
* Configuration describing how to break a chunk into smaller payload-safe chunks.
*/
export interface ChunkingOptions<A> {
/** Maximum number of items that may appear in any emitted chunk. */
readonly maxItems: number
@schickling
schickling / worker.js
Created September 12, 2025 14:35
CORS Cloudflare Worker Proxy
// @ts-check
const corsHeaders = {
'Access-Control-Allow-Methods': 'GET,HEAD,POST,OPTIONS,DELETE',
'Access-Control-Max-Age': '86400',
}
const handleEvent = async (event) => {
const request = event.request