RFC: Composable Architecture — The "Android" of React Grab#258
Draft
RFC: Composable Architecture — The "Android" of React Grab#258
Conversation
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@react-grab/cli
grab
@react-grab/amp
@react-grab/claude-code
@react-grab/codex
@react-grab/copilot
@react-grab/cursor
@react-grab/droid
@react-grab/gemini
@react-grab/opencode
react-grab
@react-grab/relay
@react-grab/utils
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
An architectural RFC proposing how to make React Grab fully composable and hackable — every layer replaceable, from the copy pipeline to the UI overlay.
The Problem
React Grab today is polished and opinionated but the walls are high:
init()(~4,200 lines) wires store, plugins, events, copy, and renderer in one shothasInitedsingleton)init()Proposed Architecture
Kernel + Userland split:
react-grab/kernel): Fiber introspection, element detection, bounds calculation, DOM freeze, clipboard — the hard stuff that stays opinionatedreact-grab/modules): Copy pipeline, overlay, toolbar, context menu, history, agent bridge — all swappableKey concepts:
createGrab({ modules: [...] })replaces monolithicinit()use()for the copy flow and other pipelinesinit()becomescreateGrab(defaultPreset(options))Migration Path
init()without changing public APIreact-grab/kernelfor power usersreact-grab/modulesandcreateGrab()What This Unlocks
Plugin authors can replace entire pipelines, not just hook into them. Enterprise users can scope configs, add company-specific formats, build compliance plugins. The core team gets faster iteration, easier testing, and smaller bundles via tree-shaking.
See
RFC-COMPOSABLE-ARCHITECTURE.mdfor the full proposal including API examples, event bus design, module contract, and open questions.Summary by cubic
Adds an RFC proposing a composable architecture for React Grab with a
react-grab/kernel+react-grab/modulessplit and a typed event bus. It enables middleware-based pipelines, headless or custom renderers, multi-instance scoping, and keepsinit()working via presets.init()without breaking the API.react-grab/kernelfor low-level access.createGrab()and map plugins to modules inreact-grab/modules.Written for commit eacc1ce. Summary will update on new commits.