From 4749c5c59829f3d08cc5cb8d4d9d5a618c9c064d Mon Sep 17 00:00:00 2001 From: Raven Scott Date: Mon, 23 Feb 2026 19:58:43 -0500 Subject: [PATCH] update --- ...: Finally Bringing P2P to the Modern Browser.md | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/markdown/Native Messaging: Finally Bringing P2P to the Modern Browser.md b/markdown/Native Messaging: Finally Bringing P2P to the Modern Browser.md index cb53f69..5e14d55 100644 --- a/markdown/Native Messaging: Finally Bringing P2P to the Modern Browser.md +++ b/markdown/Native Messaging: Finally Bringing P2P to the Modern Browser.md @@ -504,19 +504,9 @@ The injected API that developers use is the final piece. It creates the BridgeSw The native host runs on [bare](https://bare.pears.com/), a minimal JavaScript runtime that's dramatically smaller than Node.js. -This was a deliberate choice for several reasons that affect both the security model and the practical deployment of BridgeSwarm. +Bare provides only the essential primitives: process management, file system access, networking, and a hyperloader module system. This gives us full, unmodified compatibility with the entire Hyperswarm ecosystem (Hyperbee, Hyperdrive, Hypercore, Autobase, etc.) using standard npm packages. Dependencies are declared in `package.json` and resolved automatically; the installer simply downloads Bare if needed. -Traditional Node.js clocked in at around sixty megabytes when you counted the runtime, its standard library, and all the dependencies needed to run even a simple application. For a tool that's meant to be installed on end-user machines, that's uncomfortably large. The installation process becomes complicated, updates are slow, and users reasonably question why they need to install an entire development environment just to run a browser extension. - -Bare takes a fundamentally different approach. Instead of bundling everything you might possibly need, Bare provides only the essential primitives: process management, file system access, the network APIs, and a module loader. The entire runtime is under three megabytes. It starts instantly. It has almost no attack surface compared to the sprawling Node.js codebase. When you install BridgeSwarm, you're installing a tiny runtime that does exactly what it needs to do and nothing more. - -The module loading system in Bare deserves special attention. It uses a hyperloader-based system that can load modules from various sources, including npm packages. This means we can use the same packages that work in Node.js, which gave us access to the entire Hyperswarm ecosystem without modification. The Hyperbee key-value store, Hyperdrive file system, Hypercore append-only log, Autobase multi-writer log, and Hyperdb database system all work identically in Bare as they do in Node.js. We get full compatibility with the established P2P stack without sacrificing the lightweight deployment that Bare enables. - -Using Bare also simplifies the dependency story. The native host declares its dependencies in a package.json, Bare resolves those dependencies, and everything just works. There's no need to bundle, tree-shake, or compile anything. The installation script pulls down Bare if it's not present, resolves the package dependencies, and you're ready to go. This makes the installer dramatically simpler than it would be with a bundled Node.js solution. - -The trade-off is that some Node.js APIs aren't available in Bare. If you need something from the extensive Node.js standard library, you might need to find an alternative package or implement it yourself. For BridgeSwarm's purposes, every module we need was either built for universal JavaScript or had a compatible alternative available. We never hit a situation where the Bare choice prevented us from doing something we needed to do. - -One of the most compelling reasons to use Bare is that it runs consistently across platforms. The same JavaScript code that works on macOS works on Linux and Windows without modification. The native host doesn't care about your operating system, it just needs somewhere to run JavaScript. This makes the installation process universal rather than requiring different packages for different platforms. +**Currently the project does not build the native host into a single binary.** However, Bare makes this straightforward. Packaging everything into one standalone executable would simplify the installation process even further, completely remove the need for Node.js (or even a separate Bare download), and significantly reduce the line count and complexity of the installer scripts — delivering a true single-file experience across Windows, macOS, and Linux. ### The Modules That Make It Work