typelevel/fabric
55.5
Adequate · 20 September 2026
8.4k
lines of production code
Scala
primary language
1
measurement over time
What this system is
Fabric is a cross-platform Scala library for handling JSON data, providing a comprehensive toolkit for parsing, serializing, and manipulating JSON structures. It features automatic code generation for case classes via compile-time macros, flexible merging and filtering strategies, and support for binary serialization through Cryo. The system also includes utilities for runtime type introspection, reactive state management, and parsing various configuration formats like YAML and XML on the JVM.
How it got here
2021 — Fabric library initial release and Scala 3 migration
9 changes.
The project was rebranded to Fabric and migrated to Scala 3, establishing a new core library for AST-based JSON handling and serialization. This period focused on implementing compile-time Reader/Writer derivation for both Scala 2 and Scala 3, adding runtime polymorphic type support, and introducing utilities for JSON filtering and constraint validation.
2022 — I/O module and code generation expansion
13 changes.
This period focused on expanding the library's I/O capabilities by introducing a new io module with support for multiple data formats like JSON, YAML, and XML across JVM and JavaScript targets. It also advanced the code generation system by adding runtime type introspection, configurable merge strategies, and logic for writing generated Scala classes to disk.
2023–2026 — JSON-centric data manipulation and serialization
8 changes.
This period focused on expanding the library's capabilities for handling JSON data through new search, transformation, and reactive state management features. It also introduced high-performance binary serialization via the Cryo library and enhanced platform-specific support for JavaScript and JVM file systems.
Features
Added Cryo binary serialization with ByteBuffer pooling
This change introduces the Cryo library for serializing and deserializing JSON-like structures into compact binary formats. It adds a new ObjectPool abstraction and a specific ByteBufferPool implementation to manage memory efficiently, allowing users to freeze JSON objects into byte arrays and thaw them back without excessive garbage collection overhead. The core Cryo object provides methods to convert between JSON representations and binary data, leveraging the pool for performance.
core/shared/src/main/scala/fabric/cryo · high confidence
Added JSON parsing and case-class conversion benchmarks
The benchmark suite now includes new JMH benchmarks for parsing JSON and converting it to case classes, comparing the fabric library against circe and uPickle. These benchmarks cover small, medium, and large JSON payloads, with a specific large dataset sourced from GitHub event data, and a dedicated tight-loop test for performance analysis using the Jackson parser.
bench/src · high confidence
Added JavaScript-specific JSON parser implementation
The io/js module now includes a dedicated JSON parser (\JSJsonParser\) that leverages the native \scala.scalajs.js.JSON\ API for parsing. This implementation handles JavaScript-specific types such as \js.BigInt\ and ensures that whole-number \Double\ values are correctly converted to integers, providing a native JSON parsing capability for Scala.js targets.
io/js · high confidence
Added Scala 2 macro-based RW generation with constraint validation support
The \fabric.rw\ package in the Scala 2 source directory now includes \CompileRW\ and \RWMacros\ to provide macro-driven \RW.gen\ generation for case classes. This implementation enables automatic derivation of Reader/Writer instances and supports advanced features such as extracting field constraints (e.g., pattern, min/max length, numeric bounds) from annotations, handling default values, and managing generic type parameters. This change introduces the core Scala 2 implementation for the RW generation system, distinct from the Scala 3 support.
core/shared/src/main/scala-2 · high confidence
Added code generation output logic with validation support
The \define\ package now includes logic to write generated Scala classes to disk. This new \write\ method on \GeneratedClass\ handles directory creation, prevents duplicate writes via thread-local tracking, and optionally validates that existing files have not been modified by comparing the generated code against the current file content before overwriting.
core/jvm/src/main/scala/fabric/define · high confidence
Added platform-specific read-write support for Java NIO Path and File
The library now includes built-in read-write (RW) instances for \java.nio.file.Path\ and \java.io.File\ on the JVM platform. These new implicits allow these standard Java file-system types to be seamlessly serialized and deserialized as strings within the fabric framework, extending the existing \RWImplicits\ via the new \PlatformRWImplicits\ trait.
core/jvm/src/main/scala/fabric/rw · high confidence
Compile-time validated JSON string interpolation
Users can now use string interpolation to create JSON values at compile time (e.g., json"{...}"). This feature validates that the interpolated string is well-formed JSON during compilation, failing the build with a clear error if the syntax is invalid, and generates efficient parsing code for the literal.
io/shared/src/main/scala-2 · high confidence
Configurable JSON merge strategy with pluggable array and object handlers
The library now provides a flexible merge system in the \fabric.merge\ package, allowing users to define how JSON objects and arrays are combined. This includes a \MergeConfigBuilder\ that supports three global strategies—Overwrite, Add, and ErrorOnDuplicate—and allows specific path overrides. For arrays, users can choose between concatenation (\ArrConcatMerge\), concatenation with deduplication (\ArrConcatDedupeMerge\), or replacement (\ArrReplaceMerge\). For objects, the default behavior merges keys recursively, while \ObjReplaceMerge\ allows full replacement. This enables precise control over how conflicting JSON structures are resolved.
core/shared/src/main/scala/fabric/merge · high confidence
Initial project setup and tooling configuration
The repository has been initialized with the 'fabric' project, including a new MIT license, a comprehensive .scalafmt.conf for Scala 3 code formatting, and a .git-blame-ignore-revs file to track formatting commits. A validate.sh script and publish.sh script have been added to automate CI checks (headers, formatting, compilation, tests) and release processes, respectively. The README documents the library's features, such as AST-based JSON handling, deep merging, and compile-time case class conversions, while .gitignore has been updated to exclude build artifacts and IDE files.
(repo-wide) · high confidence
Initial release of the Fabric JSON library
This change introduces the core Fabric library for Scala, providing a comprehensive toolkit for working with JSON data. It includes a sealed trait hierarchy for JSON types (Obj, Arr, Str, Num, Bool, Null), a path-based API for querying and modifying JSON structures, and utilities for comparing JSON objects to find differences. The library also features a serialization/deserialization system (RW) with support for polymorphic types, automatic code generation from definitions, and configurable merging strategies.
core/shared/src/main/scala/fabric · high confidence
Introduce runtime type introspection and code generation via Definition and DefType
The \fabric.define\ package now provides a structured way to introspect and generate code from runtime type definitions. \DefType\ represents the pure structural JSON type (e.g., \Obj\, \Arr\, \Str\, \Poly\), while \Definition\ wraps it with metadata like class names, descriptions, formats, and constraints. This enables \RW\[T\].definition\ to expose type information for schema generation (e.g., OpenAPI) and allows \FabricGenerator\ to produce Scala case classes from these definitions, including support for polymorphic types, custom class mixins, and field constraints.
core/shared/src/main/scala/fabric/define · high confidence
Introduces runtime polymorphic type registry and field constraint annotations
The \fabric.rw\ module now supports open polymorphic hierarchies via the new \PolyType\ and \PolyName\ classes, allowing subtypes to be registered dynamically at runtime rather than requiring all variants to be known at compile time. Additionally, a suite of static annotations (\@pattern\, \@minimum\, \@maxLength\, \@notSerialized\, \@description\, etc.) has been added to define field-level constraints and metadata, which are reflected in the generated \Definition\ schemas for validation and documentation purposes.
core/shared/src/main/scala/fabric/rw · high confidence
JVM-specific parsers for HOCON, JSON Lines, Properties, XML, and YAML
The JVM module now includes dedicated parsers for HOCON, Properties, XML, and YAML, converting these formats into the internal JSON representation, and adds support for reading JSON Lines files via \JsonParser.lines\. A new \JsoniterParser\ is also provided as an alternative JSON parsing implementation.
io/jvm/src/main · high confidence
New JSON filtering and transformation utilities
The \core/shared/src/main/scala/fabric/filter\ package now provides a suite of built-in filters for transforming and cleaning JSON data. Users can convert key casing between \snake\_case\ and \camelCase\ using \SnakeToCamelFilter\ and \CamelToSnakeFilter\, fix Scala reserved keywords with \ScalaFieldFixFilter\, and remove unwanted elements like nulls, empty objects/arrays, or empty strings via \RemoveNullsFilter\, \RemoveEmptyFilter\, and \RemoveEmptyStringFilter\. Additionally, \RemovePathFilter\ allows removing specific paths, \ReplaceFilter\ enables value substitution, and the new \JsonFilter\ trait supports chaining multiple filters together. These capabilities are exposed via convenient extension methods on \Json\ objects in the \filter\ package object.
core/shared/src/main/scala/fabric/filter · high confidence
New ReactParent trait for reactive JSON-backed state
Added a new \ReactParent\ trait in \fabric.react\ that provides reactive variables (\Var\) backed by JSON persistence. This allows users to define reactive state (e.g., \name\, \age\) that automatically syncs changes to a JSON representation, facilitating FRP-based UI state management with built-in serialization support.
reactify/shared · high confidence
New Scala 3 compile-time RW derivation implementation
Added a new \CompileRW\ trait in the Scala 3 source directory that provides compile-time derivation for Reader/Writer instances using Scala 3 macros and \scala.deriving.Mirror\. This implementation introduces \gen\ for generic product derivation, \genEnum\ for sealed traits with case objects, and \genSealedTrait\ for polymorphic sealed traits with type discriminators. It also includes support for case-insensitive key matching, stable class names for enum cases, and runtime definition introspection via \Definition\ and \DefType\.
core/shared/src/main/scala-3 · high confidence
New Transformer class for JSON path operations
A new Transformer class has been added to the fabric.transform package, enabling users to perform various JSON manipulation operations such as modifying, moving, copying, renaming, merging, concatenating, and extracting data based on specified paths. The class also includes a read/write (RW) instance for serialization and deserialization, along with definition support for enhanced type safety.
core/shared/src/main/scala/fabric/transform · high confidence
New automated release utility for versioning and git operations
Added a new \DoRelease\ utility script that automates the release process by calculating the next version based on existing git tags, updating the README with the new version number, and performing the necessary git commit, tag, and push operations. The tool validates that the new version maintains the same major and minor version as the base version defined in \build.sbt\ and supports an optional command-line argument to override the version calculation.
util · high confidence
New composite JSON search abstraction
The \fabric.search\ package now provides a new system for locating data within JSON structures. Users can construct queries using named fields (\ByName\), array offsets (\ByOffset\ with \FromTop\/\FromBottom\ directions), or regex patterns (\ByRegex\). These individual search entries can be combined into composite searches (\CompositeSearch\) or chained via \SearchQuery\. The package also exposes convenient implicit conversions (e.g., \String\ to \ByName\, \Int\ to \ByOffset\) and shorthand values like \\\ (Wildcard) and \\\*\ (DoubleWildcard) to simplify navigation through JSON objects and arrays.
core/shared/src/main/scala/fabric/search · high confidence
New io module with JSON/YAML parsing and formatting capabilities
The \io/shared/src/main/scala\ area introduces a new \fabric.io\ module that provides a unified interface for parsing and formatting data. It adds support for JSON and YAML via \Format\ enums, \FormatParser\ traits, and specific implementations like \JacksonParser\ and \YamlFormatter\. Users can now convert strings or byte arrays to internal \Json\ representations and back to formatted strings using \IOFeatures\ extension methods. Additionally, a Scala 3-specific \json\ string interpolation is provided for compile-time validation of JSON literals.
io/shared/src/main/scala · high confidence
Removals
Removal of hierarchical data model implementation
The \hierarchical\ package has been removed from the source code. This deletion eliminates the previous implementation of hierarchical data structures, including the \Value\ trait hierarchy (Obj, Str, Num, Bool, Arr, Null), the \Path\ class for navigating nested structures, and the associated implicit conversions and factory methods. Users can no longer access or utilize these specific data types and path-based modification capabilities within this package.
src/main · high confidence
Behavioural changes
Added Scala 2.12 VectorMap compatibility shim
A new \VectorMap\ object has been added to the \scala.collection.immutable\ package for Scala 2.12. This shim provides \apply\ and \empty\ methods that delegate to \ListMap\, ensuring consistent API availability across Scala versions despite \VectorMap\ not being a standard collection in Scala 2.12.
core/shared/src/main/scala-2.12 · high confidence
Platform-specific read-write implicits and sleep implementation for JavaScript
The JavaScript platform module now includes a \Platform\ object with a \sleep\ method that asserts non-negative delays rather than blocking, reflecting JavaScript's non-blocking nature. Additionally, a \PlatformRWImplicits\ trait has been added to the \fabric.rw\ package to provide platform-specific read-write implicits, ensuring consistent behavior across different target platforms.
core/js · high confidence
Test coverage
Added Scala 3-specific serialization tests for enums, unions, and generics; Added comprehensive test coverage for Fabric core features; Added property-based tests for JSON serialization and value generation; Added property-based tests for Record and Enum serialization; Added test coverage for JSON formatting, parsing, and simple parsing; Added test coverage for complex definitions and multi-format parsing.
Dependencies
Project rebranded to Fabric with Typelevel organization and Scala 3.3.8 default
The project has been renamed from 'hierarchical' to 'fabric' and migrated to the 'org.typelevel' organization, with the base version set to 1.30. The default Scala version is now 3.3.8, while maintaining cross-compilation support for Scala 2.13.18. Key dependency versions have been updated to Jackson 2.21.4, ScalaTest 3.2.20, ScalaCheck 3.2.19.0, and Reactify 4.2.0. The build structure now explicitly defines core, io, and reactify subprojects across JVM, JS, and Native platforms, with the io module depending on core and the reactify module also depending on core.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 56.
Lenses
- Code Health 93
- Architecture 100
- Maturity 36
- Readiness 67
- Security 65
Changes since last survey
- 300 commits — 292 feature/other, 8 fixes
By area
- (repo) — 105 commits
- (root) — 89 commits
- core/shared — 56 commits
- project/plugins.sbt — 27 commits
- project/build.properties — 13 commits
- .github/workflows — 4 commits
- io/jvm — 2 commits
- core/js — 1 commit
- docs/README.md — 1 commit
- io/js — 1 commit
- util/src — 1 commit
Notable commits
- fix: Bug fixes to CompileRW on Scala 3
- fix: Fix scaladoc errors on Scala 2.13
- fix: Fixed merge ordering
- fix: Fixes to SnakeToCamelFilter
- fix: Minor fix to DefType.merge
- fix: Minor update to fix Scala 3 RW gen
- fix: More fixes for consistency between Scala 2 and 3
- fix: Temporarily disabled Scala Native to fix Scala 3
- change: Add 'Reformat with scalafmt 3.9.8' to .git-blame-ignore-revs
- change: Add _generic field for serialization of generics, allow exclusion with SerializeGenerics flag, and improve handling of union type discriminators
- change: Add tests for enhanced RW functionality: legacy-leaf fallback, type mapping, and consistent schema transforms
- change: Added Array RW support
- change: Added Json Ordering implicit
- change: Added RW.gen support for AnyVal (Resolves #400)
- change: Added Scala 3 genEnum support
- change: Added PlatformRWImplicits for platform-specific read-write implicits and integrated it into RWImplicits
- change: Added polymorphic RW support and improved error handling
- change: Added proper abstract derivation support for Scala 3 via RW.gen
- change: Added support for @description annotations to generate enriched DefType definitions
- change: Added support for @serialized and @notSerialized annotations to enhance RW serialization
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
typelevel/fabric was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 9ca6c933433b77bf8691675b0b6d027be0876bcc — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.