@getforma/core 0.8.1 → 0.8.2
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.
- package/README.md +33 -8
- package/dist/formajs-runtime-hardened.global.js.map +1 -1
- package/dist/formajs-runtime.global.js.map +1 -1
- package/dist/runtime-hardened.cjs.map +1 -1
- package/dist/runtime-hardened.js.map +1 -1
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -162,14 +162,39 @@ mount(() => <Counter />, '#app');
|
|
|
162
162
|
|
|
163
163
|
## CDN Usage
|
|
164
164
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
165
|
+
### Script tag (IIFE — auto-initializes)
|
|
166
|
+
|
|
167
|
+
```html
|
|
168
|
+
<!-- unpkg -->
|
|
169
|
+
<script src="https://unpkg.com/@getforma/core@0.8.1/dist/formajs-runtime.global.js"></script>
|
|
170
|
+
|
|
171
|
+
<!-- jsDelivr (faster globally) -->
|
|
172
|
+
<script src="https://cdn.jsdelivr.net/npm/@getforma/core@0.8.1/dist/formajs-runtime.global.js"></script>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### ESM import (no bundler, modern browsers)
|
|
176
|
+
|
|
177
|
+
```html
|
|
178
|
+
<script type="module">
|
|
179
|
+
import { createSignal, h, mount } from 'https://cdn.jsdelivr.net/npm/@getforma/core@0.8.1/dist/index.js';
|
|
180
|
+
|
|
181
|
+
const [count, setCount] = createSignal(0);
|
|
182
|
+
mount(() => h('button', { onClick: () => setCount(count() + 1) }, () => `${count()}`), '#app');
|
|
183
|
+
</script>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### All CDN builds
|
|
187
|
+
|
|
188
|
+
| Build | Filename |
|
|
189
|
+
|-------|----------|
|
|
190
|
+
| **Standard** (recommended) | `formajs-runtime.global.js` |
|
|
191
|
+
| **CSP-safe** (no `new Function`) | `formajs-runtime-hardened.global.js` |
|
|
192
|
+
| Standard (short alias) | `forma-runtime.js` |
|
|
193
|
+
| CSP-safe (short alias) | `forma-runtime-csp.js` |
|
|
194
|
+
|
|
195
|
+
Available from both `unpkg.com/@getforma/core@VERSION/dist/` and `cdn.jsdelivr.net/npm/@getforma/core@VERSION/dist/`.
|
|
196
|
+
|
|
197
|
+
For production, always pin the version (e.g., `@0.8.1`). Unversioned URLs resolve to latest.
|
|
173
198
|
|
|
174
199
|
> The CSP build uses a hand-written expression parser and never calls `new Function`.
|
|
175
200
|
> It supports most common patterns. See [examples/csp](./examples/csp) for a working demo.
|