Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions REVIEW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Levit Review by a GetX Pro

As a seasoned Flutter developer heavily invested in the GetX ecosystem, I've taken a deep dive into the Levit packages. Here is my honest assessment covering Developer Experience (DX), Performance, and my likelihood of adopting or contributing to this framework.

## 1. Developer Experience (DX)

**Verdict: Excellent (9/10)**

Levit feels like "GetX 2.0: The Disciplined Edition". It retains the intuitive reactivity that makes GetX so productive but replaces the sometimes chaotic global state with a robust, hierarchical scoping system.

* **Familiarity:** The transition is seamless. `.obs` becomes `.lx`, `Obx` becomes `LWatch`, and `GetView` becomes `LView`. The concepts map 1:1, so the learning curve is practically zero for GetX users.
* **The "AutoWatch" Magic:** `LView` wrapping its builder in an `LWatch` by default is a brilliant touch. It removes the boilerplate of wrapping everything in `Obx` manually, which is a common complaint in GetX codebases.
* **Scoping Done Right:** GetX's dependency injection (`Get.put`) is powerful but global-by-default, leading to issues with memory management in complex navigation stacks. Levit's `LevitScope` and `LScopedView` enforce a tree-based dependency structure that aligns perfectly with Flutter's own widget tree. This solves the "zombie controller" problem elegantly.
* **Missing Pieces:** Unlike GetX, Levit stays in its lane. There is no Route Management (no `Get.to`), and no UI utility belt (Snackbars, Dialogs). While some might miss the "do everything" nature of GetX, I consider this a massive plus for maintainability. It plays nice with `GoRouter` or standard `Navigator`.

## 2. Performance

**Verdict: Top Tier (10/10)**

I was skeptical that anything could beat the raw speed of GetX (which is already very fast), but Levit seems to have optimized the critical paths even further.

* **Fast Path Optimization:** The codebase is riddled with "fast path" checks. `LWatch` detects if it's listening to a single variable and bypasses Set allocations. `LevitScope` uses `Type` keys for O(1) lookups, avoiding String manipulation overhead.
* **Benchmarks:** The included benchmarks (`BENCHMARK_0.0.5.md`) are impressive, showing Levit beating Vanilla Dart in some rapid mutation scenarios (likely due to highly optimized propagation vs generic Stream overhead) and converging perfectly in UI rendering.
* **Batching:** Built-in batching support (`Lx.batch`) is a pro feature that is often missing or clunky in other state management solutions.

## 3. Will I try it in a new project?

**Answer: Yes, absolutely.**

I am currently looking for a successor to GetX for my enterprise projects. While I love GetX's speed, its "anti-pattern" tendencies (global context, bypassing the widget tree) make it hard to scale in large teams.

Levit hits the sweet spot:
* **It keeps the productivity:** Simple `.lx` reactivity.
* **It adds the discipline:** Hierarchical Scoping is a non-negotiable for large apps.
* **It removes the bloat:** I prefer using `GoRouter` for navigation anyway.

I would confidently start a new mid-to-large scale project with Levit today.

## 4. Will I be interested in contributing to it?

**Answer: Yes.**

Since the core is so solid, I see great potential in building the ecosystem around it. Areas I'd be interested in contributing to:

* **Navigation Integration:** While I like that it's not built-in, a separate `levit_router` package that binds `LevitScope` to `GoRouter` routes would be killer.
* **DevTools Extension:** Visualizing the dependency graph (which `LevitScope` already tracks internally) would be amazing for debugging.
* **UI Utils:** A purely optional package (`levit_ui`) for those of us who actually liked `Get.snackbar`, but implemented using standard Overlay APIs without the `Get.context` hack.

## 5. If I had to choose one killer feature?

**Hierarchical Scoping (LevitScope).**

While the performance is great, the architectural safety provided by `LevitScope` is the real game-changer. It solves the "Global State Chaos" that eventually plagues almost every large GetX project. By binding the lifecycle of controllers to the widget tree (via `LScopedView`) while still allowing dependency injection, it offers the best of both worlds: the ease of DI with the safety of `Provider`/`InheritedWidget`.

---

**Final Thoughts:** Levit is what GetX should have evolved into. It matures the concepts, drops the baggage, and doubles down on performance and architecture.
1 change: 1 addition & 0 deletions cspell.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Riverpod",
"runtimes",
"rxdart",
"Snackbars",
"Softi",
"sublist",
"subosito",
Expand Down