yet_another_json_isolate
2.1.1, released 5 months ago by supabase.io
Parse and encode JSON in a dedicated isolate to avoid blocking the main thread.
WASM-readyRepository archived
What it does
The package runs a persistent isolate that can encode Dart objects to JSON strings and decode JSON strings back to Dart objects. It provides simple methods to initialize, use, and dispose the isolate.
AI-written summary of version 2.1.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need heavy JSON processing that could freeze the UI
- You want to offload JSON work without managing isolates yourself
Skip it when
- JSON payloads are tiny and performance impact is negligible
- You already use a code‑gen solution like json_serializable
Strengths
- Keeps the main isolate responsive
- Simple API – just initialize, encode/decode, dispose
Weaknesses
- Adds an extra isolate overhead even for small tasks
- No code‑generation integration; you must handle model serialization yourself
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
final isolate = YAJsonIsolate()..initialize();
final json = await isolate.encode(myObject);
final obj = await isolate.decode(jsonString);
isolate.dispose();Alternatives
Packages that do the same job and could replace yet_another_json_isolate.
- json_annotation
Provides compile‑time JSON serialization without runtime isolates
84Compare - freezed_annotation
Generates immutable models with built‑in JSON support
78Compare
Works with
Packages commonly used together with yet_another_json_isolate: ones it builds on, ones built on it, and its own family.
- asyncyet_another_json_isolate depends on itUtility classes and helpers that extend Dart's async library.
- supabaseBuilt on yet_another_json_isolateDart client for Supabase, usable in non-Flutter Dart environments.
- postgrestBuilt on yet_another_json_isolateDart client library offering an ORM‑like interface to PostgREST/Supabase databases.
- functions_clientBuilt on yet_another_json_isolateDart client for invoking Supabase Edge Functions.