@erickxavier/no-js 1.10.0 → 1.11.0
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 +68 -6
- package/dist/cjs/no.js +7 -7
- package/dist/cjs/no.js.map +4 -4
- package/dist/esm/no.js +7 -7
- package/dist/esm/no.js.map +4 -4
- package/dist/iife/no.js +7 -7
- package/dist/iife/no.js.map +4 -4
- package/package.json +1 -1
- package/src/animations.js +11 -7
- package/src/context.js +6 -1
- package/src/devtools.js +36 -6
- package/src/directives/binding.js +43 -8
- package/src/directives/dnd.js +11 -2
- package/src/directives/events.js +1 -0
- package/src/directives/head.js +142 -0
- package/src/directives/http.js +12 -24
- package/src/directives/i18n.js +4 -3
- package/src/directives/loops.js +4 -2
- package/src/directives/refs.js +9 -0
- package/src/directives/state.js +26 -6
- package/src/directives/styling.js +1 -1
- package/src/directives/validation.js +34 -13
- package/src/dom.js +68 -2
- package/src/evaluate.js +149 -4
- package/src/fetch.js +153 -9
- package/src/filters.js +6 -1
- package/src/globals.js +28 -1
- package/src/index.js +284 -31
- package/src/registry.js +12 -1
- package/src/router.js +39 -8
package/README.md
CHANGED
|
@@ -25,13 +25,16 @@ No build step. No virtual DOM. No transpiler. No JSX. Just HTML.
|
|
|
25
25
|
- **Conditionals & Loops** — `if`, `else-if`, `show`, `hide`, `each`, `foreach`, `switch`
|
|
26
26
|
- **State Management** — `state` (local), `store` (global), `computed`, `watch`, `notify()`
|
|
27
27
|
- **SPA Routing** — `route`, `route-view`, guards, params, nested routes, wildcard catch-all
|
|
28
|
-
- **Forms & Validation** — Built-in validators
|
|
28
|
+
- **Forms & Validation** — Built-in + custom validators, per-rule errors, async support, `$form` context
|
|
29
|
+
- **Plugin System** — Extend with reusable packages: interceptors, globals, directives, lifecycle hooks
|
|
29
30
|
- **Animations** — `animate`, `transition` with stagger support
|
|
30
|
-
- **i18n** — `t` directive with pluralization
|
|
31
|
+
- **i18n** — `t` directive with pluralization, namespaces, browser detection
|
|
31
32
|
- **Filters** — `uppercase`, `currency`, `date`, `truncate`, 32 built-in pipes
|
|
32
|
-
- **Drag & Drop** — `drag`, `drop`, `drag-
|
|
33
|
+
- **Drag & Drop** — `drag`, `drop`, `drag-list`, multi-select, keyboard DnD
|
|
34
|
+
- **DevTools** — Built-in inspector with context mutation, store inspection, element highlighting
|
|
35
|
+
- **Security** — DOMParser-based sanitization, CSP-safe (no eval/Function), header redaction, prototype pollution protection
|
|
33
36
|
- **Custom Directives** — Extend with `NoJS.directive()`
|
|
34
|
-
-
|
|
37
|
+
- **TypeScript Support** — Type definitions for plugin authors (`types/nojs-plugin.d.ts`)
|
|
35
38
|
|
|
36
39
|
---
|
|
37
40
|
|
|
@@ -56,6 +59,20 @@ NoJS.config({
|
|
|
56
59
|
</script>
|
|
57
60
|
```
|
|
58
61
|
|
|
62
|
+
### NPM
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npm install no-js-framework
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
```javascript
|
|
69
|
+
// ESM
|
|
70
|
+
import NoJS from 'no-js-framework';
|
|
71
|
+
|
|
72
|
+
// CommonJS
|
|
73
|
+
const NoJS = require('no-js-framework');
|
|
74
|
+
```
|
|
75
|
+
|
|
59
76
|
---
|
|
60
77
|
|
|
61
78
|
## Example
|
|
@@ -98,6 +115,40 @@ No `app.mount()`. No `createApp()`. No `NgModule`. It just works.
|
|
|
98
115
|
|
|
99
116
|
---
|
|
100
117
|
|
|
118
|
+
## Plugin System
|
|
119
|
+
|
|
120
|
+
Extend No.JS with reusable packages — analytics, auth, feature flags, UI libraries — without modifying the core.
|
|
121
|
+
|
|
122
|
+
```html
|
|
123
|
+
<script>
|
|
124
|
+
NoJS.use({
|
|
125
|
+
name: 'analytics',
|
|
126
|
+
version: '1.0.0',
|
|
127
|
+
capabilities: ['interceptors', 'globals'],
|
|
128
|
+
|
|
129
|
+
install(app, options) {
|
|
130
|
+
app.global('analytics', { pageViews: 0 });
|
|
131
|
+
app.interceptor('response', (response, url) => {
|
|
132
|
+
console.log('API call:', url, response.status);
|
|
133
|
+
return response;
|
|
134
|
+
});
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
init(app) {
|
|
138
|
+
console.log('Analytics ready');
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
dispose(app) {
|
|
142
|
+
console.log('Analytics cleaned up');
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
</script>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Plugins have access to the full API: `directive()`, `filter()`, `validator()`, `interceptor()`, `global()`, `on()`, and more.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
101
152
|
## Documentation
|
|
102
153
|
|
|
103
154
|
Full documentation is available in the [docs/](docs/) folder:
|
|
@@ -119,6 +170,7 @@ Full documentation is available in the [docs/](docs/) folder:
|
|
|
119
170
|
| [i18n](docs/md/i18n.md) | Translations, pluralization, formatting |
|
|
120
171
|
| [Filters](docs/md/filters.md) | Built-in filters, chaining, custom filters |
|
|
121
172
|
| [Actions & Refs](docs/md/actions-refs.md) | `call`, `trigger`, `ref`, `$refs` |
|
|
173
|
+
| [Plugins](docs/md/plugins.md) | Plugin API, interceptors, globals, lifecycle |
|
|
122
174
|
| [Custom Directives](docs/md/custom-directives.md) | Extend No.JS |
|
|
123
175
|
| [Error Handling](docs/md/error-handling.md) | Error boundaries, global handler |
|
|
124
176
|
| [Configuration](docs/md/configuration.md) | Global settings, interceptors, template caching, security |
|
|
@@ -133,6 +185,16 @@ Full documentation is available in the [docs/](docs/) folder:
|
|
|
133
185
|
2. **Resolve** — Each attribute maps to a directive, executed by priority
|
|
134
186
|
3. **React** — Data lives in Proxy-backed reactive contexts; changes auto-update the DOM
|
|
135
187
|
4. **Scope** — Contexts inherit from parents, like lexical scoping
|
|
188
|
+
5. **Secure** — Expressions run in a sandboxed evaluator (no eval, no Function); HTML is sanitized via DOMParser
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Ecosystem
|
|
193
|
+
|
|
194
|
+
| Tool | Description |
|
|
195
|
+
|------|-------------|
|
|
196
|
+
| [NoJS-LSP](https://github.com/ErickXavier/nojs-lsp) | VS Code extension — autocomplete, hover docs, diagnostics for No.JS HTML |
|
|
197
|
+
| [NoJS-MCP](https://github.com/ErickXavier/nojs-mcp) | MCP server — AI tools for building No.JS apps |
|
|
136
198
|
|
|
137
199
|
---
|
|
138
200
|
|
|
@@ -157,5 +219,5 @@ Contributions are welcome! Please open an issue or submit a pull request.
|
|
|
157
219
|
|
|
158
220
|
<p align="center">
|
|
159
221
|
<strong>No.JS</strong> — Because the best JavaScript is the JavaScript you don't write.<br>
|
|
160
|
-
<code
|
|
161
|
-
</p>
|
|
222
|
+
<code>Zero dependencies</code> · <code>MIT License</code>
|
|
223
|
+
</p>
|