fusee-framework 2.7.1 → 2.7.3

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 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.1 — Signals-First JS Framework | Atomic Reactivity | Rust Compiler | Go Toolchain</strong>
8
+ <strong>v2.7.3 — Signals-First JS Framework | Atomic Reactivity | Rust Compiler | Go Toolchain</strong>
9
9
  </p>
10
10
 
11
11
  <br />
@@ -14,7 +14,7 @@ Fusée is a custom, high-performance fine-grained reactive JavaScript framework
14
14
 
15
15
  ---
16
16
 
17
- ## What's New in 2.7.0
17
+ ## What's New in 2.7.3
18
18
 
19
19
  - Added **Web Components**: `defineElement()` turns a fusée component into a native custom
20
20
  element with reactive props synced to attributes, shadow DOM, scoped `css` styles, native
@@ -45,14 +45,25 @@ Fusée is a custom, high-performance fine-grained reactive JavaScript framework
45
45
  JSX components use it automatically.
46
46
  - Fixed the JSX runtime: it failed to load (wrong import path), and text and `{expression}`
47
47
  children were not rendered.
48
-
49
- ## What's New in 2.6.1
50
-
51
- - Added package manager choice in the `fusee init` command and automatic installation
52
- of dependencies; (2.6.0)
53
- - Added `--install` and `--skip-install` flags to the `fusee init` command; (2.6.0)
54
- - Added `pm` flag to the `fusee init` command; (2.6.0)
55
- - Updated dev dependency for vite babel plugin. (2.6.1)
48
+ - Fixed dependency tracking in f-for for h.js
49
+ - Fixed shipping of intended libraries into separated dedicated libraries in npm (like router, di, store, etc.).
50
+ `fusee-framework` is now the core only (reactivity, components, elements, templates,
51
+ `createApp`). The rest has its own entry point:
52
+
53
+ | Entry | Exports |
54
+ | ------------------------- | -------------------------------------------------------------------- |
55
+ | `fusee-framework/router` | `createRouter`, `navigate`, `generateRoutes`, guards, route signals |
56
+ | `fusee-framework/store` | `defineStore`, `storeToRefs`, `useNestedStore`, store plugins |
57
+ | `fusee-framework/di` | `InjectionToken`, `provideGlobal`, `EnvironmentInjector` |
58
+ | `fusee-framework/actions` | `defineAction`, `createActionProxy`, `useAction` (client side) |
59
+ | `fusee-framework/plugins` | `defineFuseePlugin` and the other plugin descriptors |
60
+ | `fusee-framework/server` | Node: `handleActionRequest`, SSR helpers, `generateManifest` |
61
+
62
+ **Breaking:** import these from their entry, e.g.
63
+ `import { createRouter } from 'fusee-framework/router'`. Auto-imports and new projects from
64
+ `fusee init` already do. `provide()` / `inject()` stay in the core.
65
+ FREL, Comet and the Go SSR engine are no longer in the npm package: install them with
66
+ `fusee add frel | comet | server`.
56
67
 
57
68
  ## Quick Start
58
69
 
@@ -493,13 +504,10 @@ my-app/
493
504
  Full type definitions are available for all framework primitives:
494
505
 
495
506
  ```typescript
496
- import type {
497
- Signal,
498
- Computed,
499
- Component,
500
- Router,
501
- ServerAction,
502
- } from "./framework/types";
507
+ import type { Signal, Computed, ComponentFactory } from "fusee-framework";
508
+ import type { Router, Route } from "fusee-framework/router";
509
+ import type { StoreHook } from "fusee-framework/store";
510
+ import type { ActionProxy } from "fusee-framework/actions";
503
511
  ```
504
512
 
505
513
  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.
@@ -516,21 +524,45 @@ It can be installed from the CLI after installing the SSR engine (default: not i
516
524
 
517
525
  ## Performance Benchmarks
518
526
 
519
- Framework Total Mean (Create, Update, Swap, Clear tests)
520
- Compared to other popular JS Frameworks:
521
-
522
- | Rank | Framework | Execution Time |
523
- | :----: | :--------------------- | :------------: |
524
- | **1** | **Qwik** | 117.55 ms |
525
- | **2** | <mark>**Fusée**</mark> | **120.30 ms** |
526
- | **3** | **Angular** | 121.29 ms |
527
- | **4** | **Solid** | 121.54 ms |
528
- | **5** | **Preact** | 123.18 ms |
529
- | **6** | **Vue** | 123.99 ms |
530
- | **7** | **Svelte** | 125.15 ms |
531
- | **8** | **React** | 126.12 ms |
532
- | **9** | **Mithril** | 128.35 ms |
533
- | **10** | **Lit** | 131.08 ms |
527
+ The benchmark runs the operations from
528
+ [js-framework-benchmark](https://github.com/krausest/js-framework-benchmark) on a keyed table in
529
+ headless Chromium. Each sample is read from a Chrome trace: it is the busy main-thread time from
530
+ the start of the operation until the frame that shows the result is committed (script, style,
531
+ layout and paint), with time spent idle waiting for the next frame left out. Every sample starts
532
+ from a freshly loaded page with 3 warmup runs, and the DOM is checked after each operation.
533
+ Some tests slow the CPU down, as js-framework-benchmark does.
534
+
535
+ Fusée (current `main`), median of 15 runs, AMD Ryzen 5 3500U laptop (lower is better):
536
+
537
+ | Operation | CPU slowdown | Median | ± 95% CI | Script |
538
+ | :--------------------- | :----------: | :------: | :------: | :------: |
539
+ | Create 1,000 rows | 1x | 51.6 ms | ± 4.4 ms | 14.5 ms |
540
+ | Replace 1,000 rows | 1x | 51.0 ms | ± 4.2 ms | 20.1 ms |
541
+ | Update every 10th row | 4x | 56.9 ms | ± 4.6 ms | 5.0 ms |
542
+ | Select row | 4x | 9.0 ms | ± 0.8 ms | 2.5 ms |
543
+ | Swap 2 rows | 4x | 39.3 ms | ± 2.4 ms | 3.2 ms |
544
+ | Remove row | 2x | 25.7 ms | ± 3.6 ms | 2.6 ms |
545
+ | Append 1,000 rows | 1x | 47.1 ms | ± 4.1 ms | 13.4 ms |
546
+ | Clear 1,000 rows | 4x | 39.1 ms | ± 8.2 ms | 36.9 ms |
547
+
548
+ "Script" is the part of the median spent in JavaScript, including garbage collection; the rest
549
+ is the browser's style, layout and paint work.
550
+
551
+ ### Memory
552
+
553
+ JS heap after a forced garbage collection:
554
+
555
+ | Version | Fresh page | 1,000 rows | After 5× create + clear |
556
+ | :------------- | :--------: | :--------: | :---------------------: |
557
+ | Current `main` | 1.10 MB | 4.38 MB | **1.36 MB** |
558
+ | 2.7.2 | 1.10 MB | 4.41 MB | 10.81 MB |
559
+
560
+ Up to 2.7.1, `f-for` kept every row it had ever rendered reachable, so each create + clear
561
+ cycle left about 1.9 MB behind. Removed rows are now freed.
562
+
563
+ A ranking against React, Vue, Angular, Svelte, Solid, Preact, Qwik, Lit and Mithril with this
564
+ method is being re-measured. The previous ranking measured each operation plus two animation
565
+ frames, so frame timing (about 33 ms) hid most of the differences between frameworks.
534
566
 
535
567
  ### Bundle size
536
568
 
@@ -0,0 +1,12 @@
1
+ // fusee-framework/actions — client side of server actions (browser-safe, no Node imports).
2
+ // The server side (defineAction(fn), handleActionRequest) lives in fusee-framework/server.
3
+ export {
4
+ defineAction,
5
+ createActionProxy,
6
+ useAction,
7
+ hydrateAction,
8
+ getHydratedAction,
9
+ clearActionHydration,
10
+ extractActionHydration,
11
+ loadActionHydration
12
+ } from '../server/actions.js'
@@ -1,3 +1,5 @@
1
+ // Auto-import preset for unplugin-auto-import: every public name, mapped to the entry
2
+ // point that exports it. Add-ons (FREL, Comet) are not auto-imported; import them explicitly.
1
3
  export const FuseePreset = {
2
4
  'fusee-framework': [
3
5
  'signal', 'computed', 'effect', 'watch',
@@ -6,14 +8,25 @@ export const FuseePreset = {
6
8
  'defineComponent', 'defineCompiledComponent', 'defineAsyncComponent', 'onMount', 'onUnmount', 'parseSlots',
7
9
  'defineElement', 'toCustomElement', 'css', 'unsafeCSS',
8
10
  'directive', 'reconcile', 'mountTemplate', 'emit',
9
- 'provide', 'inject', 'provideGlobal', 'InjectionToken', 'getCurrentInstance',
11
+ 'provide', 'inject', 'getCurrentInstance',
10
12
  'defineComposable', 'assertSetupContext',
13
+ 'createApp'
14
+ ],
15
+ 'fusee-framework/router': [
11
16
  'createRouter', 'navigate', 'mountOutlet', 'currentRoute', 'routeParams', 'routeQuery',
12
- 'matchedRoutes', 'generateRoutes',
17
+ 'matchedRoutes', 'routeMeta', 'generateRoutes', 'beforeEach', 'afterEach'
18
+ ],
19
+ 'fusee-framework/store': [
13
20
  'defineStore', 'resetStore', 'clearStores', 'registerStorePlugin', 'storeToRefs',
14
- 'storeToState', 'storeToGetters', 'useNestedStore', 'MutationType',
15
- 'defineAction', 'createActionProxy', 'useAction',
16
- 'createApp',
21
+ 'storeToState', 'storeToGetters', 'useNestedStore', 'MutationType'
22
+ ],
23
+ 'fusee-framework/di': [
24
+ 'InjectionToken', 'provideGlobal'
25
+ ],
26
+ 'fusee-framework/actions': [
27
+ 'defineAction', 'createActionProxy', 'useAction'
28
+ ],
29
+ 'fusee-framework/plugins': [
17
30
  'defineCompilerPlugin', 'defineServerPlugin', 'defineDevToolsPlugin', 'defineRuntimeAdapter',
18
31
  'defineFuseePlugin'
19
32
  ]
@@ -6,63 +6,66 @@
6
6
  // biome-ignore lint: disable
7
7
  export {}
8
8
  declare global {
9
- const InjectionToken: typeof import('fusee-framework').InjectionToken
10
- const MutationType: typeof import('fusee-framework').MutationType
9
+ const afterEach: typeof import('fusee-framework/router').afterEach
11
10
  const assertSetupContext: typeof import('fusee-framework').assertSetupContext
12
11
  const batch: typeof import('fusee-framework').batch
13
- const clearStores: typeof import('fusee-framework').clearStores
12
+ const beforeEach: typeof import('fusee-framework/router').beforeEach
13
+ const clearStores: typeof import('fusee-framework/store').clearStores
14
14
  const computed: typeof import('fusee-framework').computed
15
- const createActionProxy: typeof import('fusee-framework').createActionProxy
15
+ const createActionProxy: typeof import('fusee-framework/actions').createActionProxy
16
16
  const createApp: typeof import('fusee-framework').createApp
17
- const createRouter: typeof import('fusee-framework').createRouter
17
+ const createRouter: typeof import('fusee-framework/router').createRouter
18
18
  const createSuspense: typeof import('fusee-framework').createSuspense
19
19
  const css: typeof import('fusee-framework').css
20
- const currentRoute: typeof import('fusee-framework').currentRoute
21
- const defineAction: typeof import('fusee-framework').defineAction
20
+ const currentRoute: typeof import('fusee-framework/router').currentRoute
21
+ const defineAction: typeof import('fusee-framework/actions').defineAction
22
22
  const defineAsyncComponent: typeof import('fusee-framework').defineAsyncComponent
23
23
  const defineCompiledComponent: typeof import('fusee-framework').defineCompiledComponent
24
- const defineCompilerPlugin: typeof import('fusee-framework').defineCompilerPlugin
24
+ const defineCompilerPlugin: typeof import('fusee-framework/plugins').defineCompilerPlugin
25
25
  const defineComponent: typeof import('fusee-framework').defineComponent
26
26
  const defineComposable: typeof import('fusee-framework').defineComposable
27
- const defineDevToolsPlugin: typeof import('fusee-framework').defineDevToolsPlugin
27
+ const defineDevToolsPlugin: typeof import('fusee-framework/plugins').defineDevToolsPlugin
28
28
  const defineElement: typeof import('fusee-framework').defineElement
29
- const defineFuseePlugin: typeof import('fusee-framework').defineFuseePlugin
29
+ const defineFuseePlugin: typeof import('fusee-framework/plugins').defineFuseePlugin
30
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
31
+ const defineRuntimeAdapter: typeof import('fusee-framework/plugins').defineRuntimeAdapter
32
+ const defineServerPlugin: typeof import('fusee-framework/plugins').defineServerPlugin
33
+ const defineStore: typeof import('fusee-framework/store').defineStore
34
34
  const directive: typeof import('fusee-framework').directive
35
35
  const effect: typeof import('fusee-framework').effect
36
36
  const emit: typeof import('fusee-framework').emit
37
- const generateRoutes: typeof import('fusee-framework').generateRoutes
37
+ const generateRoutes: typeof import('fusee-framework/router').generateRoutes
38
38
  const getCurrentInstance: typeof import('fusee-framework').getCurrentInstance
39
39
  const inject: typeof import('fusee-framework').inject
40
+ const InjectionToken: typeof import('fusee-framework/di').InjectionToken
40
41
  const inspect: typeof import('fusee-framework').inspect
41
- const matchedRoutes: typeof import('fusee-framework').matchedRoutes
42
- const mountOutlet: typeof import('fusee-framework').mountOutlet
42
+ const matchedRoutes: typeof import('fusee-framework/router').matchedRoutes
43
+ const mountOutlet: typeof import('fusee-framework/router').mountOutlet
43
44
  const mountTemplate: typeof import('fusee-framework').mountTemplate
44
- const navigate: typeof import('fusee-framework').navigate
45
+ const MutationType: typeof import('fusee-framework/store').MutationType
46
+ const navigate: typeof import('fusee-framework/router').navigate
45
47
  const onCleanup: typeof import('fusee-framework').onCleanup
46
48
  const onMount: typeof import('fusee-framework').onMount
47
49
  const onUnmount: typeof import('fusee-framework').onUnmount
48
50
  const parseSlots: typeof import('fusee-framework').parseSlots
49
51
  const provide: typeof import('fusee-framework').provide
50
- const provideGlobal: typeof import('fusee-framework').provideGlobal
52
+ const provideGlobal: typeof import('fusee-framework/di').provideGlobal
51
53
  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 registerStorePlugin: typeof import('fusee-framework/store').registerStorePlugin
55
+ const resetStore: typeof import('fusee-framework/store').resetStore
54
56
  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 routeMeta: typeof import('fusee-framework/router').routeMeta
58
+ const routeParams: typeof import('fusee-framework/router').routeParams
59
+ const routeQuery: typeof import('fusee-framework/router').routeQuery
57
60
  const scheduleAsyncJob: typeof import('fusee-framework').scheduleAsyncJob
58
61
  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 storeToGetters: typeof import('fusee-framework/store').storeToGetters
63
+ const storeToRefs: typeof import('fusee-framework/store').storeToRefs
64
+ const storeToState: typeof import('fusee-framework/store').storeToState
62
65
  const toCustomElement: typeof import('fusee-framework').toCustomElement
63
66
  const unsafeCSS: typeof import('fusee-framework').unsafeCSS
64
67
  const untrack: typeof import('fusee-framework').untrack
65
- const useAction: typeof import('fusee-framework').useAction
66
- const useNestedStore: typeof import('fusee-framework').useNestedStore
68
+ const useAction: typeof import('fusee-framework/actions').useAction
69
+ const useNestedStore: typeof import('fusee-framework/store').useNestedStore
67
70
  const watch: typeof import('fusee-framework').watch
68
71
  }