jails-js 6.9.8 → 6.9.10
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/ai/anti-patterns.md +102 -0
- package/ai/api.md +388 -0
- package/ai/architecture.md +79 -0
- package/ai/best-practices.md +183 -0
- package/ai/concepts.md +228 -0
- package/ai/directives.md +556 -0
- package/ai/examples.md +199 -0
- package/ai/faq.md +70 -0
- package/ai/glossary.md +28 -0
- package/ai/json/api.json +190 -0
- package/ai/json/directives.json +107 -0
- package/ai/json/patterns.json +69 -0
- package/ai/json/recipes.json +96 -0
- package/ai/llms.txt +96 -0
- package/ai/overview.md +45 -0
- package/ai/patterns.md +182 -0
- package/ai/recipes.md +393 -0
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/jails.js +1 -1
- package/dist/jails.js.map +1 -1
- package/package.json +24 -2
- package/readme.md +22 -9
- package/src/element.ts +4 -0
- package/src/index.ts +5 -3
- package/tsconfig.json +0 -1
- package/types.d.ts +3 -3
package/readme.md
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img width="200" src="https://github.com/user-attachments/assets/8b4dbfb9-f05e-4b83-8d42-8847038a97e2" alt="Jails" />
|
|
3
|
-
</p>
|
|
4
1
|
|
|
5
|
-
<h1 align="center">Jails</h1>
|
|
6
2
|
|
|
7
|
-
<
|
|
3
|
+
<p align="center" height="100">
|
|
4
|
+
<img width="250" alt="Jails - A minimalistic Micro Framework" src="https://github.com/user-attachments/assets/5e2eee1a-5f8f-4eed-abba-7422a5258245" />
|
|
5
|
+
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<h1 align="center">An Elegant and Minimalistic<br /> Micro-Framework</h3>
|
|
8
9
|
|
|
9
10
|
<div align="center">
|
|
10
|
-
<
|
|
11
|
+
<br />
|
|
12
|
+
<br />
|
|
13
|
+
<table width="100%" align="center" border="0">
|
|
11
14
|
<tr><td align="center">🏝 Built for <br/><a href="https://www.patterns.dev/posts/islands-architecture/" target="_blank">Island Architecture</a></td</tr>
|
|
12
15
|
<td align="center">ƛ Inspired by <br/><a href="https://guide.elm-lang.org/architecture/" target="_blank">Elm Architecture</a></td>
|
|
13
16
|
<td align="center">🔗 Ready for <br/><a href="https://htmx.org/essays/hypermedia-driven-applications" target="_blank">hypermedia applications</a></td></tr>
|
|
@@ -28,9 +31,19 @@
|
|
|
28
31
|
The JavaScript ecosystem, including browsers and tools, has undergone significant evolution over the years. However, it's evident that many of the complexities introduced by frameworks today may not be essential for the majority of web applications. The prevailing trend in modern app development seems to prioritize expertise in frameworks over mastery of the language itself, often leading to a sense of being confined within the framework ecosystem.
|
|
29
32
|
|
|
30
33
|
Jails was designed to be:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
|
|
35
|
+
<table width="100%" align="center" border="0">
|
|
36
|
+
<tr>
|
|
37
|
+
<th>🧩 Decoupled</th>
|
|
38
|
+
<th>⚡️ Lightweight</th>
|
|
39
|
+
<th>📦 Interoperable</th>
|
|
40
|
+
</tr>
|
|
41
|
+
<tr>
|
|
42
|
+
<td align="center">Backend-agnostic, our solution seamlessly integrates with any backend framework or back-end programming language.</td>
|
|
43
|
+
<td align="center">Lightweight, just around 5kb when gzipped. It enhances your application's performance by progressively, separating HTML from your JavaScript code. </td>
|
|
44
|
+
<td align="center">It seamlessly integrates and functions alongside any other vanilla UI or behavioral libraries. </td>
|
|
45
|
+
</tr>
|
|
46
|
+
</table>
|
|
34
47
|
|
|
35
48
|
<br clear="all" />
|
|
36
49
|
<br />
|
package/src/element.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { Element } from './element'
|
|
1
|
+
import { Element, getInstance } from './element'
|
|
2
2
|
import { template, templateConfig as config } from './template-system'
|
|
3
3
|
|
|
4
|
+
globalThis.__jails__ = globalThis.__jails__ || { components: {} }
|
|
5
|
+
globalThis.__jails__.getInstance = getInstance
|
|
6
|
+
|
|
7
|
+
export { getInstance }
|
|
4
8
|
export { publish, subscribe } from './utils/pubsub'
|
|
5
9
|
|
|
6
10
|
export const templateConfig = (options) => {
|
|
7
11
|
config( options )
|
|
8
12
|
}
|
|
9
13
|
|
|
10
|
-
globalThis.__jails__ = globalThis.__jails__ || { components: {} }
|
|
11
|
-
|
|
12
14
|
export const register = ( name, module, dependencies ) => {
|
|
13
15
|
const { components } = globalThis.__jails__
|
|
14
16
|
components[ name ] = { name, module, dependencies }
|
package/tsconfig.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare const templateConfig: (options: any) => void;
|
|
|
9
9
|
export declare const register: (name: string, module: any, dependencies?: any) => void
|
|
10
10
|
export declare const start: (target?: HTMLElement) => void;
|
|
11
11
|
export declare const subscribe:( subject: string, callback: (data:any) => void ) => Function
|
|
12
|
-
export declare const publish: ( subject: string, data
|
|
12
|
+
export declare const publish: ( subject: string, data ?:any ) => void
|
|
13
13
|
|
|
14
14
|
export type Component = {
|
|
15
15
|
|
|
@@ -24,11 +24,11 @@ export type Component = {
|
|
|
24
24
|
getRaw() : any
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
effect( callback: ( state: any ) => Promise<any> | void )
|
|
27
|
+
effect( callback: ( state: any ) => Promise<any> | void ): void
|
|
28
28
|
|
|
29
29
|
main( mainArgs: ( t: Component ) => void ): void
|
|
30
30
|
|
|
31
|
-
publish( name: string, value
|
|
31
|
+
publish( name: string, value?: any ) : void
|
|
32
32
|
|
|
33
33
|
subscribe( name: string, value: Function ) : Function
|
|
34
34
|
|