Fusée Framework
Fusée is a JavaScript framework, currently at v1.6.0, designed for high-performance and fine-grained reactivity. It emphasizes a "signals-first" approach, where atomic updates ensure only modified DOM parts are rendered, aiming for peak performance. The framework features a recursive, non-greedy compiler for efficient node traversal and a strict component system that includes prop validation, lifecycle hooks like `onMount` and `onUnmount`, and automated cleanup. It also provides optimized directives such as `f-if`, `f-for`, and `f-model`, alongside a `Performance Shield (f-once)` for stabilizing static subtrees. Fusée integrates with Vite for a fast development workflow and offers a comprehensive CLI for project scaffolding, supporting both JavaScript and TypeScript templates. It differentiates itself through its custom compiler and strong focus on explicit performance optimizations, backed by a robust test suite covering reactivity, components, dependency injection, and type safety. There's no fixed release cadence mentioned, but updates appear regular.
Common errors
-
ReferenceError: defineComponent is not defined
cause The `defineComponent` function was not imported or is out of scope.fixAdd `import { defineComponent } from 'fusee-framework';` at the top of your component file. -
TypeError: signal is not a function
cause Attempted to call `signal` without importing it, or `signal` was overshadowed by another variable.fixEnsure `import { signal } from 'fusee-framework';` is present and that `signal` is not redeclared in your scope. -
Failed to parse template: Invalid directive f-model syntax
cause The `f-model` directive expects a variable name for two-way binding, but received an expression or incorrect syntax.fixEnsure `f-model` is assigned directly to a signal's name (e.g., `<input f-model="mySignal" />`) and not an expression like `mySignal()` or `mySignal.value`.
Warnings
- gotcha Directly modifying a signal's value outside its setter (e.g., `signalObject.value = 'new'`) will not trigger reactivity. Always use the signal function as a setter (`signal('new value')`).
- gotcha Using the `f-once` directive incorrectly on dynamic content can prevent updates from propagating, effectively freezing that subtree's reactivity.
- gotcha Lifecycle hooks like `onMount` and `onUnmount` must be called synchronously within the `setup` function of `defineComponent`. Calling them conditionally or asynchronously will lead to undefined behavior or errors.
- gotcha While Fusée supports Vite, ensure your Vite configuration is set up correctly for client-side rendering. Attempting SSR without explicit framework support or using a misconfigured Vite setup can lead to hydration issues.
Install
-
npm install fusee-framework -
yarn add fusee-framework -
pnpm add fusee-framework
Imports
- defineComponent
const defineComponent = require('fusee-framework').defineComponent;import { defineComponent } from 'fusee-framework'; - signal
import signal from 'fusee-framework/signal';
import { signal } from 'fusee-framework'; - computed
import { computedValue } from 'fusee-framework';import { computed } from 'fusee-framework'; - onMount
import { OnMount } from 'fusee-framework';import { onMount } from 'fusee-framework';
Quickstart
npm install -g fusee-framework create-fusee-app my-fusee-app cd my-fusee-app npm install npm run dev