Skip to content

Commit b34584f

Browse files
committed
Rebase
1 parent 74ddaea commit b34584f

File tree

2 files changed

+113
-95
lines changed

2 files changed

+113
-95
lines changed

QUICKSTART.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
## Quick Start
2+
3+
### Installation
4+
5+
```bash
6+
# Using npm
7+
npm install rimmel rxjs
8+
9+
# Using yarn
10+
yarn add rimmel rxjs
11+
12+
# Using pnpm
13+
pnpm add rimmel rxjs
14+
```
15+
16+
### Basic Usage
17+
18+
```js
19+
import { BehaviorSubject, scan } from 'rxjs';
20+
import { rml } from 'rimmel';
21+
22+
const Component = () => {
23+
const count = new BehaviorSubject(0).pipe(
24+
scan(x=>x+1)
25+
);
26+
27+
return rml`
28+
<button onclick="${count}">
29+
click me (${count})
30+
</button>
31+
`;
32+
};
33+
34+
const App = () => {
35+
return rml`
36+
<h1>Hello <img class="icon" src="https://rimmel.js.org/assets/rimmel.png"> World</h1>
37+
${Component()}
38+
39+
<hr>
40+
Starter for <a href="https://github.com/reactivehtml/rimmel" target="_blank">Rimmel.js</a>
41+
`;
42+
};
43+
44+
document.body.innerHTML = App();
45+
```
46+
47+
## Key Features
48+
49+
- **Stream-First Architecture**: Everything is a stream - events, data, UI updates
50+
- **No Virtual DOM**: Direct DOM updates via optimized "sinks"
51+
- **Tiny Bundle Size**: Core is just 2.5KB, tree-shakeable imports
52+
- **Zero Build Requirements**: Works with plain JavaScript
53+
- **Automatic Memory Management**: Handles subscription cleanup
54+
- **Built-in Suspense**: Automatic loading states with BehaviorSubject
55+
- **Web Components Support**: Create custom elements easily
56+
- **TypeScript Support**: Full type definitions included
57+
58+
## Core Concepts
59+
60+
### Sources (Input)
61+
- DOM Events (`onclick`, `onmousemove`, etc)
62+
- Promises
63+
- RxJS Observables
64+
- Custom Event Sources
65+
66+
### Sinks (Output)
67+
- DOM Updates
68+
- Class Management
69+
- Style Updates
70+
- Attribute Changes
71+
- Custom Sinks
72+
73+
## Available Sinks
74+
75+
The library includes specialized sinks for common UI operations:
76+
77+
- `InnerHTML` - Update element content
78+
- `InnerText` - Safe text updates
79+
- `Class` - Manage CSS classes
80+
- `Style` - Update styles
81+
- `Value` - Form input values
82+
- `Disabled` - Toggle disabled state
83+
- `Readonly` - Toggle readonly state
84+
- `Removed` - Remove elements
85+
- `Sanitize` - Safe HTML rendering
86+
- `AppendHTML` - Append content
87+
- `PrependHTML` - Prepend content
88+
89+
## Development
90+
91+
```bash
92+
# Install dependencies
93+
npm install
94+
95+
# Run tests
96+
npm run test
97+
98+
# Build library
99+
npm run build
100+
101+
# Run demo app
102+
npm run kitchen-sink
103+
```
104+
105+
## Examples
106+
107+
Check out our examples:
108+
109+
- [Basic Demos](https://stackblitz.com/@dariomannu/collections/rimmel-js-getting-started)
110+
- [Advanced Patterns](https://stackblitz.com/@dariomannu/collections/rimmel-js-experiments)
111+
- [Web Components](https://stackblitz.com/@dariomannu/collections/web-components)
112+
- [Web Workers](https://stackblitz.com/@dariomannu/collections/web-workers)

README.md

Lines changed: 1 addition & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -10,101 +10,7 @@ Rimmel is a powerful, fast and lightweight JavaScript UI library for creating we
1010

1111
It implements [RML](https://github.com/ReactiveHTML/reactive-markup), the Reactive Markup which makes your HTML work with Streams in a seamless way.
1212

13-
## Quick Start
14-
15-
### Installation
16-
17-
```bash
18-
# Using npm
19-
npm install rimmel rxjs
20-
21-
# Using yarn
22-
yarn add rimmel rxjs
23-
24-
# Using pnpm
25-
pnpm add rimmel rxjs
26-
```
27-
28-
### Basic Usage
29-
30-
```js
31-
import { rml } from "rimmel";
32-
import { Subject } from "rxjs";
33-
34-
const counter = new Subject();
35-
36-
document.body.innerHTML = rml`
37-
<button onclick="${counter}">Click me</button>
38-
<div>Clicks: ${counter}</div>
39-
`;
40-
```
41-
42-
## Key Features
43-
44-
- **Stream-First Architecture**: Everything is a stream - events, data, UI updates
45-
- **No Virtual DOM**: Direct DOM updates via optimized "sinks"
46-
- **Tiny Bundle Size**: Core is just 2.5KB, tree-shakeable imports
47-
- **Zero Build Requirements**: Works with plain JavaScript
48-
- **Automatic Memory Management**: Handles subscription cleanup
49-
- **Built-in Suspense**: Automatic loading states with BehaviorSubject
50-
- **Web Components Support**: Create custom elements easily
51-
- **TypeScript Support**: Full type definitions included
52-
53-
## Core Concepts
54-
55-
### Sources (Input)
56-
- DOM Events (`onclick`, `onmousemove`, etc)
57-
- Promises
58-
- RxJS Observables
59-
- Custom Event Sources
60-
61-
### Sinks (Output)
62-
- DOM Updates
63-
- Class Management
64-
- Style Updates
65-
- Attribute Changes
66-
- Custom Sinks
67-
68-
## Available Sinks
69-
70-
The library includes specialized sinks for common UI operations:
71-
72-
- `InnerHTML` - Update element content
73-
- `InnerText` - Safe text updates
74-
- `Class` - Manage CSS classes
75-
- `Style` - Update styles
76-
- `Value` - Form input values
77-
- `Disabled` - Toggle disabled state
78-
- `Readonly` - Toggle readonly state
79-
- `Removed` - Remove elements
80-
- `Sanitize` - Safe HTML rendering
81-
- `AppendHTML` - Append content
82-
- `PrependHTML` - Prepend content
83-
84-
## Development
85-
86-
```bash
87-
# Install dependencies
88-
npm install
89-
90-
# Run tests
91-
npm run test
92-
93-
# Build library
94-
npm run build
95-
96-
# Run demo app
97-
npm run kitchen-sink
98-
```
99-
100-
## Examples
101-
102-
Check out our examples:
103-
104-
- [Basic Demos](https://stackblitz.com/@dariomannu/collections/rimmel-js-getting-started)
105-
- [Advanced Patterns](https://stackblitz.com/@dariomannu/collections/rimmel-js-experiments)
106-
- [Web Components](https://stackblitz.com/@dariomannu/collections/web-components)
107-
- [Web Workers](https://stackblitz.com/@dariomannu/collections/web-workers)
13+
# To Busy to read, here the [TL;DR 📜](./QUICKSTART.md)<br>
10814

10915
## Getting started
11016
If you are new to reactive streams, there is a [3m crash-course](https://medium.com/@fourtyeighthours/the-mostly-inaccurate-crash-course-for-reactive-ui-development-w-rxjs-ddbb7e5e526e) tailored for UI development with Rimmel, arguably the simplest RxJS introduction around to get you started.

0 commit comments

Comments
 (0)