typelevel/fabric
52.1
Adequate · 7 November 2026
9.1k
lines of production code
Scala
primary language
4
measurements over time
What this system is
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; Added tests for nested class RW initialization order.
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 cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 59 → 52 (-6.5)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 72 → 72 (-0.3)
- Architecture 90 → 89 (-1.3)
- Maturity 51 → 50 (-0.9)
- Readiness 53 → 41 (-12.0)
- Security 78 → 65 (-12.7)
- Performance 76 → 85 (+8.6)
Resolved (10)
- Off-boarding risk: anonymized user #1
- Outdated: com.fasterxml.jackson.core:jackson-core
- Outdated: com.fasterxml.jackson.dataformat:jackson-dataformat-xml
- Outdated: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml
- Outdated: com.lihaoyi:upickle_3
- Outdated: io.circe:circe-generic_3
- Outdated: io.circe:circe-parser_3
- SimpleJsonParser.apply (cognitive 21) (io/shared/src/main/scala/fabric/io/SimpleJsonParser.scala)
- SimpleJsonParser.apply (cyclomatic 26) (io/shared/src/main/scala/fabric/io/SimpleJsonParser.scala)
- TodoComment (io/shared/src/main/scala/fabric/io/SimpleJsonParser.scala)
New (9)
- Dependency hygiene PARTLY measured — sbt declarations read, dependency currency not (Maven Central unreachable)
- Hotspot: io/jvm/src/main/scala/fabric/io/JsonEscaper.scala (io/jvm/src/main/scala/fabric/io/JsonEscaper.scala)
- JSJsonParser.doublesHold (cognitive 36) (io/js/src/main/scala/fabric/io/JSJsonParser.scala)
- JSJsonParser.doublesHold (cyclomatic 20) (io/js/src/main/scala/fabric/io/JSJsonParser.scala)
- JsonEscaper.appendFrom (cognitive 16) (io/jvm/src/main/scala/fabric/io/JsonEscaper.scala)
- Off-boarding risk: anonymized user #1
- Reader.number (cognitive 16) (io/shared/src/main/scala/fabric/io/SimpleJsonParser.scala)
- Reader.string (cognitive 21) (io/shared/src/main/scala/fabric/io/SimpleJsonParser.scala)
- Reader.string (cyclomatic 17) (io/shared/src/main/scala/fabric/io/SimpleJsonParser.scala)
Changes since last survey
- 5 commits — 5 feature/other, 0 fixes
By area
- io/jvm — 2 commits
- io/shared — 2 commits
- (root) — 1 commit
Notable commits
- change: Every JSON parser reads a number at full precision. JacksonParser reads a decimal with getDecimalValue instead of getValueAsDouble and an integer beyond Long as a NumDec of its exact value instead of failing; JsoniterParser no longer truncates an integer beyond Long to a NumInt; YamlParser reads floats as BigDecimal. A NumDec holds BigDecimal.exact of the parsed value, so later arithmetic on it is not rounded to 34 digits. On JS, JSON.parse holds numbers as Doubles, so a document with a number of more than 15 significant digits or an extreme exponent is read by SimpleJsonParser, now a complete parser (negative numbers, exponents, every escape, trailing-content check) that reads every number exactly; a whole Double outside Long is a NumDec instead of a saturated NumInt. Integers within Long stay NumInt and decimals NumDec; a parsed decimal keeps its written scale (1.50, 1E+5). The writer already wrote BigDecimal.toString, which is exact. Reading a decimal from Jackson is about three times faster than the Double route. ioJVM 49 and ioJS 32 pass on Scala 3 and 2.13.
- change: Every string writer writes an unpaired UTF-16 surrogate as U+FFFD instead of a lone surrogate, which strict JSON readers refuse. The JVM escaper writes it as \uFFFD, keeping its \uXXXX style for everything from U+007F up; Str.escape (Str.toString and the JS writer) writes the raw U+FFFD character, as it writes every other non-control character raw; YamlFormatter replaces it in keys and values. A valid pair is written exactly as before. JsonEscapeSpec's oracle is the previous escaper over the string with lone surrogates replaced. coreJVM 204, ioJVM 33, coreJS 199, ioJS 18, coreNative 199 pass; on 2.13 coreJVM 143, ioJVM 33, ioJS 18 pass.
- change: LoneSurrogateSpec, failing first: an unpaired UTF-16 surrogate in a string is written as a bare \uD83D-style escape (JVM) or the raw lone character (Str.escape, Str.toString, the JS writer and YAML). The JSON grammar allows it, but strict readers refuse it. The cases expect a lone high surrogate, a lone low surrogate, a reversed pair, a lone surrogate at the end and one next to a valid pair each written as U+FFFD, in values and keys, compact and pretty, from Str.escape and Str.toString and in YAML, with the output read back to the replaced string; a valid pair is unchanged. Four of the five fail.
- change: NumberPrecisionSpec and JVMNumberPrecisionSpec, failing first: a decimal is read through a Double, so a 30-digit decimal, 1e-18 beside a large balance, an integer beyond Long and a number a Double cannot hold (1e400) do not read back equal, from a parsed string, from a formatted Json or from a case class's BigDecimal and BigInt fields. The cases also pin the NumInt and NumDec choices for ordinary numbers and that Double-typed fields read as before; the JVM spec covers JsoniterParser and YAML. SimpleJsonParserSpec adds negative numbers, exponents, full-precision numbers, string escapes, whitespace and trailing content.
- change: Release v1.30.4
Written by cca.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 7 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 181fa860acaaab491ab0c234ae0dabb6c0fb81cc — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-110e4fee044f.