Blop is a modern language for the Web that natively generates Virtual DOM trees using familiar HTML-like syntax.
The Blop language compiles to ES6-compliant JavaScript with minimal dependencies. Unlike JSX, Blop is not limited to expressions – you can mix statements, expressions, and HTML-like syntax within the same function, giving you the full power of the language to generate Virtual DOM trees.
Blop uses the snabbdom library for Virtual DOM rendering and is built with the Meta Parser Generator.
# Install Blop
npm install blop-language
# Or clone and run the example
git clone https://github.com/batiste/blop-language.git
cd blop-language
npm install
npm startimport { mount, Component } from 'blop'
// A simple counter component
Counter = (ctx: Component) => {
{ value, setState } = ctx.state<number>('count', 0)
<div>
<h2>'Counter: 'value''</h2>
<button on={ click: () => setState(value + 1) }>'Increment'</button>
<button on={ click: () => setState(value - 1) }>'Decrement'</button>
</div>
}
// Mount the app
{ init } = mount(document.getElementById('app'), () => <Counter />)
init()- Installation Guide - Complete setup instructions
- Quick Start - Get running in 5 minutes
- Syntax Reference - Complete language syntax
- Components - Building blocks of Blop applications
- State Management - Proxy-based reactive state
- Routing - Client-side navigation
- CLI Usage - Command-line interface
- Modern JS Features - Spread, optional chaining, nullish coalescing
- Generics - Generic types and functions
- Style Guide - Code standards and best practices
- Error Prioritization - Error message system
- Native Virtual DOM - HTML-like syntax built into the language
- Fast Compilation - Process 30,000+ lines per second
- Enhanced Error Messages - Helpful suggestions and quick fixes
- Integrated Linter - No configuration needed
- VSCode Integration - Syntax highlighting and real-time error checking
- Source Maps - Debug with original source code
- Hot Module Reloading (HMR) - Instant updates during development
- Type Annotations - Optional type checking with inference warnings
- Modern JavaScript - ES6+ syntax with optional chaining, nullish coalescing, spread operators
- Component System - Built-in lifecycle and state management
- Generics Support - Type-safe generic functions and types
- 100% Vite Compatible - Modern build tooling
- Vitest Integration - Fast, modern testing
- Small Bundle Size - ~15KB gzipped (Snabbdom + Blop runtime)
- Server-Side Rendering (SSR) - Removed in v1.1.0 with migration to Vite
- Still in beta - API may change
npm install blop-languageCreate or update vite.config.js:
import { defineConfig } from 'vite';
import { blopPlugin } from 'blop-language/src/vite';
export default defineConfig({
plugins: [blopPlugin()],
});More Vite Configuration Options
Create vitest.config.js:
import { defineConfig } from 'vitest/config';
import { blopPlugin } from 'blop-language/src/vitest';
export default defineConfig({
plugins: [blopPlugin()],
test: {
include: ['**/*.test.blop'],
globals: true,
environment: 'jsdom',
},
});Install from the marketplace or via command:
# If you cloned the repo
npm run link-extensionsSearch for "Blop" in VSCode Extensions for:
- Blop Language - Syntax highlighting
- Blop Linter - Real-time error checking
Compile a single file:
npx blop -i input.blop -o output.jsgit clone https://github.com/batiste/blop-language.git
cd blop-language
npm install
npm start # Open http://localhost:3000# Run tests
npm test
# Build parser
npm run parser
# Build linter extension
npm run lintermy-blop-app/
├── src/
│ ├── main.blop # Entry point
│ ├── App.blop # Root component
│ ├── components/ # Reusable components
│ ├── lib/ # Utilities (state, router)
│ └── pages/ # Page components
├── index.html # HTML entry
├── vite.config.js # Vite configuration
├── vitest.config.js # Test configuration
└── package.json
- Live Demo - See Blop in action
- GitHub Repository - Source code
- NPM Package - Install package
- Documentation - Complete guides
- Issues - Bug reports & features
MIT License - see LICENSE.txt
The documentation has been migrated from the GitHub Wiki to the main repository (in the /docs folder) for better version control, review process, and maintainability. All wiki content has been preserved and enhanced.
If you're looking for older documentation, the wiki is still available but no longer maintained: https://github.com/batiste/blop-language/wiki
Please use the documentation in the /docs folder instead.


