@getforma/core 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +67 -12
  2. package/package.json +22 -3
package/README.md CHANGED
@@ -174,7 +174,7 @@ See [The `h()` function](#the-h-function) below for the full signature and all c
174
174
 
175
175
  ### 3. HTML Runtime (no build step)
176
176
 
177
- Drop a script tag, write `data-*` attributes. Zero config, zero tooling works from a CDN.
177
+ One `<script>` tag. One HTML file. No npm, no bundler, no `node_modules`, no config files. Just open it in a browser.
178
178
 
179
179
  ```html
180
180
  <script src="https://cdn.jsdelivr.net/npm/@getforma/core@latest/dist/formajs-runtime.global.js"></script>
@@ -186,7 +186,52 @@ Drop a script tag, write `data-*` attributes. Zero config, zero tooling — work
186
186
  </div>
187
187
  ```
188
188
 
189
- The expression parser is hand-written no `eval()`, no `new Function()` by default. For strict CSP environments, use the hardened build:
189
+ That's a working reactive counter. No JavaScript file. No build step. Just HTML.
190
+
191
+ **Here's what you get from a single HTML file with one script tag:**
192
+
193
+ ```html
194
+ <script src="https://cdn.jsdelivr.net/npm/@getforma/core@latest/dist/formajs-runtime.global.js"></script>
195
+
196
+ <div data-forma-state='{
197
+ "query": "",
198
+ "items": ["Apples", "Bananas", "Cherries", "Dates", "Elderberries"],
199
+ "darkMode": false
200
+ }'>
201
+
202
+ <!-- Two-way binding: type in the input, the list filters instantly -->
203
+ <input data-model="{query}" placeholder="Search fruits...">
204
+
205
+ <!-- Computed value: derived from query, updates automatically -->
206
+ <p data-computed="matchCount = items.filter(i => i.toLowerCase().includes(query.toLowerCase())).length"
207
+ data-text="{'Found ' + matchCount + ' results'}"></p>
208
+
209
+ <!-- Conditional rendering: show/hide based on state -->
210
+ <p data-show="{query.length > 0 && matchCount === 0}">No matches found.</p>
211
+
212
+ <!-- List rendering: keyed reconciliation, only changed items re-render -->
213
+ <ul data-list="{items.filter(i => i.toLowerCase().includes(query.toLowerCase()))}">
214
+ <li>{item}</li>
215
+ </ul>
216
+
217
+ <!-- Event handling with $dispatch: cross-component communication -->
218
+ <button data-on:click="{darkMode = !darkMode}">
219
+ Toggle Dark Mode
220
+ </button>
221
+
222
+ <!-- Dynamic classes and attributes -->
223
+ <div data-class:dark="{darkMode}" data-bind:data-theme="{darkMode ? 'dark' : 'light'}">
224
+ Theme is: <span data-text="{darkMode ? 'Dark' : 'Light'}"></span>
225
+ </div>
226
+
227
+ <!-- Persist to localStorage: survives page refresh -->
228
+ <div data-persist="{darkMode}"></div>
229
+ </div>
230
+ ```
231
+
232
+ That single HTML file gives you: reactive state, two-way data binding, computed values, conditional rendering, list rendering with filtering, event handling, dynamic CSS classes, dynamic attributes, and localStorage persistence. **No JavaScript written. No build tools installed.**
233
+
234
+ The expression parser is hand-written and CSP-safe — no `eval()`, no `new Function()` by default. For strict CSP environments, use the hardened build:
190
235
 
191
236
  ```html
192
237
  <script src="https://cdn.jsdelivr.net/npm/@getforma/core@latest/dist/formajs-runtime-hardened.global.js"></script>
@@ -767,18 +812,28 @@ See the [`examples/`](./examples) directory:
767
812
 
768
813
  ---
769
814
 
770
- ## Ecosystem
815
+ ## Part of the Forma Stack
771
816
 
772
- FormaJS is the reactive frontend layer of a full-stack Rust + TypeScript framework.
817
+ ### Frontend (TypeScript)
773
818
 
774
- | Package | Language | Description |
775
- |---|---|---|
776
- | [@getforma/core](https://www.npmjs.com/package/@getforma/core) | TypeScript | This library — reactive DOM, signals, islands, SSR hydration |
777
- | [@getforma/compiler](https://github.com/getforma-dev/forma-tools) | TypeScript | TypeScript-to-FMIR compiler, Vite plugin, esbuild SSR plugin |
778
- | [@getforma/build](https://github.com/getforma-dev/forma-tools) | TypeScript | esbuild pipeline with content hashing, compression, manifest |
779
- | [@getforma/create-app](https://github.com/getforma-dev/create-forma-app) | TypeScript | `npx @getforma/create-app` — scaffold a new Forma project |
780
- | [forma-ir](https://crates.io/crates/forma-ir) | Rust | FMIR binary format: parser, walker, WASM exports |
781
- | [forma-server](https://crates.io/crates/forma-server) | Rust | Axum middleware for SSR, asset serving, CSP |
819
+ | Package | Description |
820
+ |---|---|
821
+ | [@getforma/core](https://www.npmjs.com/package/@getforma/core) | **This library** — reactive DOM, signals, islands, SSR hydration |
822
+ | [@getforma/compiler](https://www.npmjs.com/package/@getforma/compiler) | Vite plugin h() optimization, server function transforms, FMIR emission |
823
+ | [@getforma/build](https://www.npmjs.com/package/@getforma/build) | Production pipeline esbuild bundling, content hashing, compression, manifest |
824
+
825
+ ### Backend (Rust)
826
+
827
+ | Package | Description |
828
+ |---|---|
829
+ | [forma-ir](https://crates.io/crates/forma-ir) | FMIR binary format — parser, walker, WASM exports |
830
+ | [forma-server](https://crates.io/crates/forma-server) | Axum middleware — SSR page rendering, asset serving, CSP headers |
831
+
832
+ ### Full Framework
833
+
834
+ | Package | Description |
835
+ |---|---|
836
+ | [@getforma/create-app](https://github.com/getforma-dev/create-forma-app) | `npx @getforma/create-app` — scaffolds a Rust server + TypeScript frontend project |
782
837
 
783
838
  ---
784
839
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@getforma/core",
3
3
  "author": "Forma <victor@getforma.dev>",
4
- "version": "1.0.2",
4
+ "version": "1.0.4",
5
5
  "description": "Real DOM reactive library — fine-grained signals, islands architecture, SSR hydration. No virtual DOM, no diffing. ~15KB gzipped.",
6
6
  "type": "module",
7
7
  "main": "./dist/index.cjs",
@@ -138,12 +138,31 @@
138
138
  "fine-grained",
139
139
  "real-dom",
140
140
  "no-vdom",
141
+ "no-virtual-dom",
141
142
  "tc39-signals",
142
- "preact-signals",
143
+ "alien-signals",
143
144
  "lightweight",
144
145
  "typescript",
146
+ "jsx",
145
147
  "hyperscript",
146
- "state-management"
148
+ "state-management",
149
+ "islands",
150
+ "islands-architecture",
151
+ "hydration",
152
+ "ssr",
153
+ "server-side-rendering",
154
+ "csp",
155
+ "csp-safe",
156
+ "content-security-policy",
157
+ "declarative",
158
+ "data-attributes",
159
+ "alpine-alternative",
160
+ "solidjs-alternative",
161
+ "rust-ssr",
162
+ "web-components",
163
+ "progressive-enhancement",
164
+ "zero-build",
165
+ "cdn"
147
166
  ],
148
167
  "license": "MIT",
149
168
  "repository": {