搜尋套件、儲存庫與 APP 分類

套件詳情v7.0.0

preact_signals

Preact.js Signals 的 Dart 版本

AndroidiOSLinuxmacOSWebWindows
近 30 天下載
10.9萬
喜歡數
8
Pub 分數
130

安裝套件

flutter pub add preact_signals

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Preact Signals 是 Preact.js Signals 庫的 Dart 版本,為 Flutter 應用提供輕量級的反應式狀態管理解決方案。它透過信號實現細粒度的反應性,自動追蹤相依性並在值變更時觸發更新。設計簡潔且效能優異,可無縫整合至 Flutter 專案中,無需樣板程式碼即可管理狀態。該套件支援所有主要平台,包含 Web、行動裝置與桌面端,非常適合跨平台開發。強調極低的開銷,並根據實際資料變更實現可預測的重新渲染。

適用情境

  • 即時 UI 更新
  • 細粒度狀態更新
  • 跨平台反應式應用
  • 輕量級狀態管理
  • 高效依賴追蹤

主要特色

  • 自動依賴追蹤
  • 最小化重新渲染
  • 無樣板程式碼
  • 跨平台支援
  • 簡單的 API 設計

適合對象

  • 小型到中型的 Flutter 應用
  • 尋求輕量級狀態管理的開發者
  • 對高反應性要求高且開銷低的專案
  • 熟悉 React 類似模式的團隊
  • Web 與多平台應用

使用建議

  • 與更大的狀態管理工具相比,生態系統有限
  • 不適合非常複雜的狀態樹
  • 對不熟悉訊號模式的開發人員來說,學習曲線較陡
  • 可能需要額外的工具來進行除錯
  • 比成熟的替代方案社群支援較少

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Tests Website GitHub stars Coverage GitHub issues GitHub pull-requests melos

Signals.dart

Try chat with CodeWiki!

Features

  • 🪡 Fine grained reactivity: Based on Preact Signals and provides a fine grained reactivity system that will automatically track dependencies and free them when no longer needed
  • ⛓️ Lazy evaluation: Signals are lazy and will only compute values when read. If a signal is not read, it will not be computed
  • 🗜️ Flexible API: Every app is different and signals can be composed in multiple ways. There are a few rules to follow but the API surface is small
  • 🔬 Surgical Rendering: Widgets can be rebuilt surgically, only marking dirty the parts of the Widget tree that need to be updated and if mounted
  • 💙 100% Dart Native: Supports Dart JS (HTML), Shelf Server, CLI (and Native), VM, Flutter (Web, Mobile and Desktop). Signals can be used in any Dart project

To start using signals, check out the full documentation.

VS Code Extension: https://marketplace.visualstudio.com/items?itemName=rodydavis.signals-dart

Packages

Package Pub
signals signals
signals_core signals_core
signals_flutter signals_flutter
signals_lint signals_lint
signals_hooks signals_hooks
preact_signals signals_lint
signals_devtools_extension

AI Developer Skills

To enable AI coding assistants (like Google Antigravity, Gemini, Claude, Cursor, GitHub Copilot, and others) to build high-quality reactive systems with signals.dart, this repository includes prepackaged, high-fidelity developer Skills.

These skills are located under the ./skills directory and are fully modular:

  • signals-preact-dart: Deep knowledge and best practices for core reactive primitives (signal, computed, effect, batch, untracked).
  • signals-dart: Best practices for async signal operations (FutureSignal, StreamSignal), reactive collections, writable computed signals (linkedSignal), and value semantics.
  • signals-flutter: Comprehensive guides on element-level reactive UI integration, high-frequency GPU rendering bypasses, lifecycle side-effects, and .watch(context) extensions.
  • signals-migration-6-to-7: Detailed instructions, patterns, and refactoring techniques to safely upgrade applications from signals v6.x to v7.0.0.
How to use them:
1. One-Command Installation via skills.sh

You can instantly install all available signals skills into your global AI environment using the unified skills.sh registry CLI:

npx skills add rodydavis/signals.dart
2. Manual Reference

Simply reference the path to the desired skill directory in your AI prompt, or load the contents of the relevant SKILL.md files as context for your AI coding assistant.

Contributors

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。

所在榜單