fusee-framework 1.0.1 → 1.1.1
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 +1 -1
- package/app/components/Counter.ts +0 -2
- package/app/components/CounterSection.ts +1 -2
- package/app/components/UserForm.js +0 -2
- package/app/main.js +1 -1
- package/app/routes/About.js +0 -2
- package/app/routes/Home.js +0 -1
- package/app/routes/Home.ts +3 -5
- package/app/routes/TestFor.js +0 -2
- package/app/routes/TestFor.ts +54 -0
- package/auto-imports.d.ts +19 -0
- package/framework/auto-import-preset.js +8 -0
- package/framework/bin/create-fusee.js +85 -33
- package/framework/core/compiler.js +45 -42
- package/framework/core/directives.js +292 -280
- package/framework/index.js +1 -0
- package/framework/router/router.js +5 -3
- package/framework/types/compiler.d.ts +0 -10
- package/framework/types/index.d.ts +7 -0
- package/index.html +12 -3
- package/package.json +2 -1
- package/tsconfig.json +7 -2
- package/vite.config.js +11 -3
package/framework/index.js
CHANGED
|
@@ -2,3 +2,4 @@
|
|
|
2
2
|
export { signal, computed, effect, batch, untrack } from './core/signal.js'
|
|
3
3
|
export { defineComponent, onMount, onUnmount } from './core/component.js'
|
|
4
4
|
export { createRouter, navigate, mountOutlet } from './router/router.js'
|
|
5
|
+
export { mountTemplate } from './core/compiler.js'
|
|
@@ -9,9 +9,11 @@ export function createRouter(routes) {
|
|
|
9
9
|
window.addEventListener('hashchange', handler)
|
|
10
10
|
|
|
11
11
|
if (document.readyState === 'loading') {
|
|
12
|
-
window.addEventListener('DOMContentLoaded', handler)
|
|
12
|
+
window.addEventListener('DOMContentLoaded', handler, { once: true })
|
|
13
13
|
} else {
|
|
14
|
-
|
|
14
|
+
setTimeout(() => {
|
|
15
|
+
if (!_currentInstance) _resolve()
|
|
16
|
+
}, 0)
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
return {
|
|
@@ -41,7 +43,7 @@ export function mountOutlet(el) {
|
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
function _resolve() {
|
|
44
|
-
if (!_outlet) {
|
|
46
|
+
if (!_outlet || _routes.length === 0) {
|
|
45
47
|
return
|
|
46
48
|
}
|
|
47
49
|
|
|
@@ -13,13 +13,3 @@ export function compileNode(
|
|
|
13
13
|
components: Record<string, ComponentFactory>,
|
|
14
14
|
effects: (() => void)[]
|
|
15
15
|
): void
|
|
16
|
-
|
|
17
|
-
function processTextNodes(root: HTMLElement, context: ComponentResult, effects: (() => void)[]): void
|
|
18
|
-
function processAttrBindings(root: HTMLElement, context: ComponentResult, effects: (() => void)[]): void
|
|
19
|
-
|
|
20
|
-
function bindComponents(
|
|
21
|
-
container: HTMLElement,
|
|
22
|
-
components: Record<string, ComponentFactory>,
|
|
23
|
-
context: ComponentResult,
|
|
24
|
-
effects: (() => void)[]
|
|
25
|
-
): void
|
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
export * from './signal'
|
|
5
5
|
export * from './component'
|
|
6
6
|
export * from './router'
|
|
7
|
+
export * from './compiler'
|
|
8
|
+
|
|
9
|
+
declare global {
|
|
10
|
+
type Signal<T = any> = import('./signal').Signal<T>
|
|
11
|
+
type Computed<T = any> = import('./signal').Computed<T>
|
|
12
|
+
type SignalAccessor<T> = import('./signal').SignalAccessor<T>
|
|
13
|
+
}
|
|
7
14
|
|
|
8
15
|
// Re-export as namespace for convenience
|
|
9
16
|
export as namespace Fusee
|
package/index.html
CHANGED
|
@@ -30,14 +30,23 @@
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
nav a {
|
|
33
|
-
color: #ff3333;
|
|
33
|
+
color: #ff3333;
|
|
34
|
+
/* Link-urile sunt acum roșii */
|
|
34
35
|
text-decoration: none;
|
|
35
36
|
font-weight: 500;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
/* Temă Red Fusée */
|
|
39
|
-
#app h1 {
|
|
40
|
-
|
|
40
|
+
#app h1 {
|
|
41
|
+
color: #ff3333;
|
|
42
|
+
text-shadow: 0 0 20px rgba(255, 51, 51, 0.4);
|
|
43
|
+
margin-bottom: 1rem;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
#app p {
|
|
47
|
+
color: #ff9999;
|
|
48
|
+
opacity: 0.9;
|
|
49
|
+
}
|
|
41
50
|
|
|
42
51
|
nav a:hover {
|
|
43
52
|
color: #fff;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fusee-framework",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Fusée - Signals-first JS Framework | Peak Performance",
|
|
5
5
|
"main": "framework/index.js",
|
|
6
6
|
"types": "framework/types/index.d.ts",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"typescript": "^6.0.2",
|
|
29
|
+
"unplugin-auto-import": "^21.0.0",
|
|
29
30
|
"vite": "^5.0.0"
|
|
30
31
|
}
|
|
31
32
|
}
|
package/tsconfig.json
CHANGED
|
@@ -23,11 +23,16 @@
|
|
|
23
23
|
"declaration": true,
|
|
24
24
|
"declarationDir": "./dist/types",
|
|
25
25
|
|
|
26
|
-
"resolveJsonModule": true
|
|
26
|
+
"resolveJsonModule": true,
|
|
27
|
+
"paths": {
|
|
28
|
+
"fusee-framework": ["./framework/types/index.d.ts"],
|
|
29
|
+
"fusee-framework/*": ["./framework/*"]
|
|
30
|
+
}
|
|
27
31
|
},
|
|
28
32
|
"include": [
|
|
29
33
|
"app/**/*",
|
|
30
|
-
"framework/**/*"
|
|
34
|
+
"framework/**/*",
|
|
35
|
+
"auto-imports.d.ts"
|
|
31
36
|
],
|
|
32
37
|
"exclude": [
|
|
33
38
|
"node_modules",
|
package/vite.config.js
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
import { defineConfig } from 'vite'
|
|
2
2
|
import path from 'path'
|
|
3
|
+
import AutoImport from 'unplugin-auto-import/vite'
|
|
4
|
+
import { FuseePreset } from './framework/auto-import-preset.js'
|
|
3
5
|
|
|
4
6
|
export default defineConfig({
|
|
5
7
|
root: '.',
|
|
8
|
+
plugins: [
|
|
9
|
+
AutoImport({
|
|
10
|
+
imports: [FuseePreset],
|
|
11
|
+
dts: true,
|
|
12
|
+
})
|
|
13
|
+
],
|
|
6
14
|
|
|
7
15
|
resolve: {
|
|
8
16
|
alias: {
|
|
9
|
-
'
|
|
17
|
+
'fusee-framework': path.resolve(__dirname, './framework'),
|
|
10
18
|
'@app': path.resolve(__dirname, './app'),
|
|
11
19
|
}
|
|
12
20
|
},
|
|
13
21
|
|
|
14
22
|
server: {
|
|
15
23
|
port: 3000,
|
|
16
|
-
open: true,
|
|
17
|
-
hmr: true,
|
|
24
|
+
open: true,
|
|
25
|
+
hmr: true,
|
|
18
26
|
},
|
|
19
27
|
|
|
20
28
|
build: {
|