Skip to content
@larcjs

LARC.js

LARC — Lightweight Asynchronous Relay Core

Version License Status

Build loosely-coupled, event-driven web applications with zero build tooling

LARC implements the PAN (Page Area Network) messaging protocol — a framework-agnostic message bus that enables seamless communication between components, iframes, workers, and browser tabs.


🌟 Key Features

  • 🚀 Zero Build Required — Drop-in <pan-bus> element, no bundler needed
  • 🔌 Framework Agnostic — Works with vanilla JS, React, Vue, Lit, Angular
  • 🎯 Lightweight — ~12KB core, components load on demand
  • High Performance — 300k+ messages/second, zero memory leaks
  • 🔒 Security Audited — Production-ready with comprehensive security review
  • 🛠️ DevTools — Chrome extension for debugging message flows

📦 Packages

Package Description Version Links
@larcjs/core Core PAN messaging bus 1.0.0 NPM · Docs
@larcjs/components UI components library 1.0.0 NPM · Gallery
@larcjs/devtools Chrome DevTools extension 1.0.0 Chrome Store · Docs
@larcjs/examples Examples & demo apps 1.0.0 Examples · Apps
@larcjs/site Documentation website 1.0.0 Live Site

⚡ Quick Start

CDN (No Installation)

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <script type="module" src="https://unpkg.com/@larcjs/core/src/pan.js"></script>
</head>
<body>
  <!-- Components load automatically -->
  <pan-data-table resource="users" columns='["id","name","email"]'></pan-data-table>
  <pan-inspector></pan-inspector>
</body>
</html>

NPM Installation

npm install @larcjs/core @larcjs/components
import '@larcjs/core';
import '@larcjs/components/pan-data-table';

// Use in your HTML

🎯 Use Cases

Microservices & Microfrontends

Decouple independent UI components that communicate via messages instead of direct dependencies.

Real-Time Collaboration

Sync state across tabs, iframes, and WebSockets with built-in cross-context messaging.

Web Workers Integration

Offload heavy computation to workers while maintaining clean message contracts.

Progressive Enhancement

Add interactive components to existing pages without framework rewrites.


📚 Documentation


🔍 Example: Simple Todo App

<!DOCTYPE html>
<html>
<head>
  <script type="module" src="https://unpkg.com/@larcjs/core/src/pan.js"></script>
</head>
<body>
  <h1>Todos</h1>
  <todo-list></todo-list>
  <todo-provider></todo-provider>
  <pan-inspector></pan-inspector>

  <script>
    // Components communicate via PAN messages
    // No direct coupling between todo-list and todo-provider
  </script>
</body>
</html>

The todo list publishes todo.add messages. The provider listens and updates state. Zero coupling!


🛠️ Development

Clone a Package

git clone https://github.com/larcjs/core.git
cd core
npm install
npm test

Link Packages Locally

cd larc-core && npm link
cd ../larc-components && npm link @larcjs/core

🌐 Architecture

┌─────────────────────────────────────────┐
│            Application                  │
├──────────┬──────────┬──────────────────┤
│ Component│ Component│    Component     │
│    A     │    B     │       C          │
└────┬─────┴────┬─────┴────┬────────────┘
     │          │          │
     └──────────┼──────────┘
                │
         ┌──────▼──────┐
         │  <pan-bus>  │  ← Message Hub
         └──────┬──────┘
                │
     ┌──────────┼──────────┐
     │          │          │
┌────▼───┐  ┌──▼───┐  ┌───▼────┐
│ Worker │  │iframe│  │ Tabs   │
└────────┘  └──────┘  └────────┘

🤝 Contributing

We welcome contributions! Please see:


📊 Status

Package Build Tests Coverage Security
core 85%+
components 80%+
devtools -
examples - -

📄 License

MIT © Chris Robison

All packages are licensed under the MIT License. See individual repositories for details.


🆘 Support


🎉 Featured Apps

Check out full-featured applications built with LARC:


Build better web apps with LARC! 🚀

Pinned Loading

  1. larc larc Public

    LARC - Lightweight Asynchronous Relay Core: Meta-repository with centralized configuration for zero-build, browser-native web components

    JavaScript

Repositories

Showing 10 of 10 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…