fusee-framework 2.7.0 → 2.7.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 +56 -2
- package/bin/create-fusee-linux +0 -0
- package/bin/create-fusee-mac-arm64 +0 -0
- package/bin/create-fusee-mac-intel +0 -0
- package/bin/create-fusee-win.exe +0 -0
- package/framework/auto-import-preset.js +20 -12
- package/framework/auto-imports.d.ts +68 -39
- package/framework/core/compiler.js +310 -310
- package/framework/core/component-core.js +445 -0
- package/framework/core/component.js +11 -440
- package/framework/core/composable.js +29 -29
- package/framework/core/h.js +588 -557
- package/framework/core/jsx-helpers.js +11 -2
- package/framework/core/jsx-runtime.js +73 -73
- package/framework/core/rust-compiler/pkg/fusee_compiler_bg.wasm +0 -0
- package/framework/core/store.js +333 -333
- package/framework/globals.js +42 -0
- package/framework/index.js +22 -55
- package/framework/router/file-router.js +184 -184
- package/framework/server/actions.js +183 -183
- package/framework/server/generate-manifest.js +3 -3
- package/framework/types/component.d.ts +97 -86
- package/framework/types/index.d.ts +118 -117
- package/package.json +83 -80
- package/framework/core/rust-compiler/Cargo.toml +0 -31
- package/framework/core/rust-compiler/README.md +0 -69
- package/framework/core/rust-compiler/pkg/README.md +0 -69
- package/framework/core/rust-compiler/pkg/fusee_compiler.d.ts +0 -6
- package/framework/core/rust-compiler/pkg/fusee_compiler.js +0 -9
- package/framework/core/rust-compiler/pkg/fusee_compiler_bg.js +0 -137
- package/framework/core/rust-compiler/pkg/fusee_compiler_bg.wasm.d.ts +0 -11
- package/framework/core/rust-compiler/pkg/package.json +0 -18
- package/framework/core/rust-compiler/src/ast.rs +0 -274
- package/framework/core/rust-compiler/src/errors.rs +0 -204
- package/framework/core/rust-compiler/src/generator.rs +0 -583
- package/framework/core/rust-compiler/src/lexer.rs +0 -414
- package/framework/core/rust-compiler/src/lib.rs +0 -87
- package/framework/core/rust-compiler/src/main_compiler.rs +0 -165
- package/framework/core/rust-compiler/src/parser.rs +0 -516
- package/framework/core/rust-compiler/src/ssr_generator.rs +0 -688
- package/framework/core/rust-compiler/src/transformer.rs +0 -562
- package/framework/core/rust-compiler/src/utils.rs +0 -10
- package/framework/engine-go/actions.go +0 -112
- package/framework/engine-go/cmd/server/main.go +0 -233
- package/framework/engine-go/comet/comet.go +0 -41
- package/framework/engine-go/comet/fragment.go +0 -51
- package/framework/engine-go/dispatcher.go +0 -120
- package/framework/engine-go/elements.go +0 -248
- package/framework/engine-go/evalexpr/evalexpr.go +0 -733
- package/framework/engine-go/go.mod +0 -3
- package/framework/engine-go/hydration.go +0 -43
- package/framework/engine-go/load-helpers.go +0 -29
- package/framework/engine-go/manifest.go +0 -41
- package/framework/engine-go/reactive.go +0 -123
- package/framework/engine-go/render.go +0 -635
- package/framework/engine-go/reqcontext.go +0 -48
- package/framework/engine-go/router.go +0 -85
- package/framework/engine-go/rustast/rustast.go +0 -317
- package/framework/engine-go/ssr.go +0 -103
- package/framework/engine-go/static-assets.go +0 -139
- package/framework/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<h1 align="center">Fusée Framework</h1>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
<strong>v2.7.
|
|
8
|
+
<strong>v2.7.1 — Signals-First JS Framework | Atomic Reactivity | Rust Compiler | Go Toolchain</strong>
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<br />
|
|
@@ -25,10 +25,26 @@ Fusée is a custom, high-performance fine-grained reactive JavaScript framework
|
|
|
25
25
|
(`renderElementsSSR()`) and in the Go SSR engine (elements are read from `app/elements`
|
|
26
26
|
by `npm run manifest`).
|
|
27
27
|
- Added `fusee generate element <tag-name>`.
|
|
28
|
+
- **Smaller bundles:** importing `fusee-framework` no longer copies the API onto `globalThis`,
|
|
29
|
+
so bundlers drop the modules an app doesn't use (a counter app went from 23.6 KB to
|
|
30
|
+
11.0 KB gzip). The auto-import preset now covers every export.
|
|
31
|
+
**Breaking:** code that calls the API with neither imports nor auto-imports (e.g. a plain
|
|
32
|
+
`<script>`) must add `import 'fusee-framework/globals'`.
|
|
28
33
|
- Fixed: delegated events (`@click`) inside shadow roots; the first `:binding` on a tag being
|
|
29
34
|
ignored in string templates; content right after an `f-if` element being dropped by the
|
|
30
35
|
compiler; manifest pages in the Go dev server not receiving their `Load` data;
|
|
31
36
|
`fusee-framework` and `fusee-framework/server` failing to import in plain Node.
|
|
37
|
+
- Fixed compiled templates (`.fusee` files and JSX `render()`): nested elements were flattened
|
|
38
|
+
into the component's container; `f-for` lists and `f-if` branches that were already non-empty
|
|
39
|
+
or true at mount rendered nothing; swapping two keyed rows had no effect; loops without
|
|
40
|
+
`:key` rendered only their last item.
|
|
41
|
+
- `f-for` items now use the same syntax on the client, in SSR and in the Go engine:
|
|
42
|
+
`{{ row.id }}`. Compiled client templates used to need `{{ row().id }}`, which still works.
|
|
43
|
+
- Added `defineCompiledComponent()` for components with a compiled `render`: it leaves the
|
|
44
|
+
runtime template compiler out of the bundle (a counter component: 11.9 KB → 6.4 KB gzip).
|
|
45
|
+
JSX components use it automatically.
|
|
46
|
+
- Fixed the JSX runtime: it failed to load (wrong import path), and text and `{expression}`
|
|
47
|
+
children were not rendered.
|
|
32
48
|
|
|
33
49
|
## What's New in 2.6.1
|
|
34
50
|
|
|
@@ -486,7 +502,9 @@ import type {
|
|
|
486
502
|
} from "./framework/types";
|
|
487
503
|
```
|
|
488
504
|
|
|
489
|
-
|
|
505
|
+
Every fusée export is auto-imported in Vite builds (`framework/auto-import-preset.js`, typed in `framework/auto-imports.d.ts`). Your own services, components, stores, actions, utilities, and types should be imported explicitly.
|
|
506
|
+
|
|
507
|
+
Outside Vite (a plain `<script type="module">`, a quick demo), either import what you use or load `import 'fusee-framework/globals'`, which puts the whole API on `globalThis`. Avoid it in bundled apps: it keeps the entire framework in the bundle.
|
|
490
508
|
|
|
491
509
|
---
|
|
492
510
|
|
|
@@ -514,6 +532,42 @@ Compared to other popular JS Frameworks:
|
|
|
514
532
|
| **9** | **Mithril** | 128.35 ms |
|
|
515
533
|
| **10** | **Lit** | 131.08 ms |
|
|
516
534
|
|
|
535
|
+
### Bundle size
|
|
536
|
+
|
|
537
|
+
Production JavaScript of the same benchmark app (a keyed 1,000-row table), built with Vite
|
|
538
|
+
and compressed with gzip level 9 and brotli quality 11:
|
|
539
|
+
|
|
540
|
+
| Rank | Framework | gzip | brotli |
|
|
541
|
+
| :----: | :--------------------- | :----------: | :----------: |
|
|
542
|
+
| **1** | **Solid** | 3.9 KB | 3.5 KB |
|
|
543
|
+
| **2** | **Preact** | 5.9 KB | 5.4 KB |
|
|
544
|
+
| **3** | **Lit** | 6.3 KB | 5.7 KB |
|
|
545
|
+
| **4** | <mark>**Fusée**</mark> | **6.3 KB** | **5.7 KB** |
|
|
546
|
+
| **5** | **Svelte** | 12.8 KB | 11.7 KB |
|
|
547
|
+
| **6** | **Mithril** | 13.8 KB | 12.1 KB |
|
|
548
|
+
| **7** | **Vue** | 24.5 KB | 22.1 KB |
|
|
549
|
+
| **8** | **Qwik** | 27.3 KB | 24.4 KB |
|
|
550
|
+
| **9** | **Angular** | 34.6 KB | 31.0 KB |
|
|
551
|
+
| **10** | **React** | 44.9 KB | 39.3 KB |
|
|
552
|
+
|
|
553
|
+
Lit and Fusée are within a few bytes of each other: Lit is 12 bytes smaller with gzip, Fusée
|
|
554
|
+
9 bytes smaller with brotli.
|
|
555
|
+
|
|
556
|
+
Fusée is tree-shakable: an app only ships the parts it uses. The main cost to watch is the
|
|
557
|
+
runtime template compiler, which string templates (`template: '...'`) need. Minimal counter
|
|
558
|
+
component, gzip:
|
|
559
|
+
|
|
560
|
+
| Component style | gzip |
|
|
561
|
+
| :------------------------------------------------------ | :-----: |
|
|
562
|
+
| Compiled template + `defineCompiledComponent()` | 6.4 KB |
|
|
563
|
+
| JSX (`render()`, via the fusée JSX runtime) | 6.5 KB |
|
|
564
|
+
| String template + `defineComponent()` | 11.1 KB |
|
|
565
|
+
| String template custom element, `defineElement()` | 13.3 KB |
|
|
566
|
+
|
|
567
|
+
`defineCompiledComponent()` works like `defineComponent()` for components with a compiled
|
|
568
|
+
`render` (a `.fusee` file, or `.template.html` through the compiler plugin), and leaves the
|
|
569
|
+
template compiler out. JSX components get the same saving automatically.
|
|
570
|
+
|
|
517
571
|
---
|
|
518
572
|
|
|
519
573
|
## Building the CLI
|
package/bin/create-fusee-linux
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/create-fusee-win.exe
CHANGED
|
Binary file
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
export const FuseePreset = {
|
|
2
|
-
'fusee-framework': [
|
|
3
|
-
'signal', 'computed', 'effect', 'watch',
|
|
4
|
-
'batch', 'untrack', 'inspect', 'onCleanup', 'resource', 'defineResource',
|
|
5
|
-
'createSuspense', 'scheduleAsyncJob',
|
|
6
|
-
'defineComponent', 'defineAsyncComponent', 'onMount', 'onUnmount', 'parseSlots',
|
|
7
|
-
'defineElement', 'toCustomElement', 'css', 'unsafeCSS',
|
|
8
|
-
'directive', 'reconcile', 'mountTemplate', 'emit',
|
|
9
|
-
'provide', 'inject', 'provideGlobal', 'InjectionToken',
|
|
10
|
-
'defineComposable', 'assertSetupContext'
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
export const FuseePreset = {
|
|
2
|
+
'fusee-framework': [
|
|
3
|
+
'signal', 'computed', 'effect', 'watch',
|
|
4
|
+
'batch', 'untrack', 'inspect', 'onCleanup', 'resource', 'defineResource',
|
|
5
|
+
'createSuspense', 'scheduleAsyncJob',
|
|
6
|
+
'defineComponent', 'defineCompiledComponent', 'defineAsyncComponent', 'onMount', 'onUnmount', 'parseSlots',
|
|
7
|
+
'defineElement', 'toCustomElement', 'css', 'unsafeCSS',
|
|
8
|
+
'directive', 'reconcile', 'mountTemplate', 'emit',
|
|
9
|
+
'provide', 'inject', 'provideGlobal', 'InjectionToken', 'getCurrentInstance',
|
|
10
|
+
'defineComposable', 'assertSetupContext',
|
|
11
|
+
'createRouter', 'navigate', 'mountOutlet', 'currentRoute', 'routeParams', 'routeQuery',
|
|
12
|
+
'matchedRoutes', 'generateRoutes',
|
|
13
|
+
'defineStore', 'resetStore', 'clearStores', 'registerStorePlugin', 'storeToRefs',
|
|
14
|
+
'storeToState', 'storeToGetters', 'useNestedStore', 'MutationType',
|
|
15
|
+
'defineAction', 'createActionProxy', 'useAction',
|
|
16
|
+
'createApp',
|
|
17
|
+
'defineCompilerPlugin', 'defineServerPlugin', 'defineDevToolsPlugin', 'defineRuntimeAdapter',
|
|
18
|
+
'defineFuseePlugin'
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -1,39 +1,68 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* prettier-ignore */
|
|
3
|
-
// @ts-nocheck
|
|
4
|
-
// noinspection JSUnusedGlobalSymbols
|
|
5
|
-
// Generated by unplugin-auto-import
|
|
6
|
-
// biome-ignore lint: disable
|
|
7
|
-
export {}
|
|
8
|
-
declare global {
|
|
9
|
-
const InjectionToken: typeof import('fusee-framework').InjectionToken
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* prettier-ignore */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
// noinspection JSUnusedGlobalSymbols
|
|
5
|
+
// Generated by unplugin-auto-import
|
|
6
|
+
// biome-ignore lint: disable
|
|
7
|
+
export {}
|
|
8
|
+
declare global {
|
|
9
|
+
const InjectionToken: typeof import('fusee-framework').InjectionToken
|
|
10
|
+
const MutationType: typeof import('fusee-framework').MutationType
|
|
11
|
+
const assertSetupContext: typeof import('fusee-framework').assertSetupContext
|
|
12
|
+
const batch: typeof import('fusee-framework').batch
|
|
13
|
+
const clearStores: typeof import('fusee-framework').clearStores
|
|
14
|
+
const computed: typeof import('fusee-framework').computed
|
|
15
|
+
const createActionProxy: typeof import('fusee-framework').createActionProxy
|
|
16
|
+
const createApp: typeof import('fusee-framework').createApp
|
|
17
|
+
const createRouter: typeof import('fusee-framework').createRouter
|
|
18
|
+
const createSuspense: typeof import('fusee-framework').createSuspense
|
|
19
|
+
const css: typeof import('fusee-framework').css
|
|
20
|
+
const currentRoute: typeof import('fusee-framework').currentRoute
|
|
21
|
+
const defineAction: typeof import('fusee-framework').defineAction
|
|
22
|
+
const defineAsyncComponent: typeof import('fusee-framework').defineAsyncComponent
|
|
23
|
+
const defineCompiledComponent: typeof import('fusee-framework').defineCompiledComponent
|
|
24
|
+
const defineCompilerPlugin: typeof import('fusee-framework').defineCompilerPlugin
|
|
25
|
+
const defineComponent: typeof import('fusee-framework').defineComponent
|
|
26
|
+
const defineComposable: typeof import('fusee-framework').defineComposable
|
|
27
|
+
const defineDevToolsPlugin: typeof import('fusee-framework').defineDevToolsPlugin
|
|
28
|
+
const defineElement: typeof import('fusee-framework').defineElement
|
|
29
|
+
const defineFuseePlugin: typeof import('fusee-framework').defineFuseePlugin
|
|
30
|
+
const defineResource: typeof import('fusee-framework').defineResource
|
|
31
|
+
const defineRuntimeAdapter: typeof import('fusee-framework').defineRuntimeAdapter
|
|
32
|
+
const defineServerPlugin: typeof import('fusee-framework').defineServerPlugin
|
|
33
|
+
const defineStore: typeof import('fusee-framework').defineStore
|
|
34
|
+
const directive: typeof import('fusee-framework').directive
|
|
35
|
+
const effect: typeof import('fusee-framework').effect
|
|
36
|
+
const emit: typeof import('fusee-framework').emit
|
|
37
|
+
const generateRoutes: typeof import('fusee-framework').generateRoutes
|
|
38
|
+
const getCurrentInstance: typeof import('fusee-framework').getCurrentInstance
|
|
39
|
+
const inject: typeof import('fusee-framework').inject
|
|
40
|
+
const inspect: typeof import('fusee-framework').inspect
|
|
41
|
+
const matchedRoutes: typeof import('fusee-framework').matchedRoutes
|
|
42
|
+
const mountOutlet: typeof import('fusee-framework').mountOutlet
|
|
43
|
+
const mountTemplate: typeof import('fusee-framework').mountTemplate
|
|
44
|
+
const navigate: typeof import('fusee-framework').navigate
|
|
45
|
+
const onCleanup: typeof import('fusee-framework').onCleanup
|
|
46
|
+
const onMount: typeof import('fusee-framework').onMount
|
|
47
|
+
const onUnmount: typeof import('fusee-framework').onUnmount
|
|
48
|
+
const parseSlots: typeof import('fusee-framework').parseSlots
|
|
49
|
+
const provide: typeof import('fusee-framework').provide
|
|
50
|
+
const provideGlobal: typeof import('fusee-framework').provideGlobal
|
|
51
|
+
const reconcile: typeof import('fusee-framework').reconcile
|
|
52
|
+
const registerStorePlugin: typeof import('fusee-framework').registerStorePlugin
|
|
53
|
+
const resetStore: typeof import('fusee-framework').resetStore
|
|
54
|
+
const resource: typeof import('fusee-framework').resource
|
|
55
|
+
const routeParams: typeof import('fusee-framework').routeParams
|
|
56
|
+
const routeQuery: typeof import('fusee-framework').routeQuery
|
|
57
|
+
const scheduleAsyncJob: typeof import('fusee-framework').scheduleAsyncJob
|
|
58
|
+
const signal: typeof import('fusee-framework').signal
|
|
59
|
+
const storeToGetters: typeof import('fusee-framework').storeToGetters
|
|
60
|
+
const storeToRefs: typeof import('fusee-framework').storeToRefs
|
|
61
|
+
const storeToState: typeof import('fusee-framework').storeToState
|
|
62
|
+
const toCustomElement: typeof import('fusee-framework').toCustomElement
|
|
63
|
+
const unsafeCSS: typeof import('fusee-framework').unsafeCSS
|
|
64
|
+
const untrack: typeof import('fusee-framework').untrack
|
|
65
|
+
const useAction: typeof import('fusee-framework').useAction
|
|
66
|
+
const useNestedStore: typeof import('fusee-framework').useNestedStore
|
|
67
|
+
const watch: typeof import('fusee-framework').watch
|
|
68
|
+
}
|