json-as 1.2.6 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/CHANGELOG.md +417 -0
  2. package/README.md +135 -36
  3. package/assembly/custom/util.ts +24 -70
  4. package/assembly/deserialize/float.ts +181 -0
  5. package/assembly/deserialize/helpers/uint.ts +12 -0
  6. package/assembly/deserialize/index/arbitrary.ts +25 -0
  7. package/assembly/deserialize/index/array.ts +61 -0
  8. package/assembly/deserialize/index/bool.ts +1 -0
  9. package/assembly/deserialize/index/date.ts +1 -0
  10. package/assembly/deserialize/index/float.ts +1 -0
  11. package/assembly/deserialize/index/integer.ts +1 -0
  12. package/assembly/deserialize/index/map.ts +1 -0
  13. package/assembly/deserialize/index/object.ts +1 -0
  14. package/assembly/deserialize/index/raw.ts +1 -0
  15. package/assembly/deserialize/index/set.ts +1 -0
  16. package/assembly/deserialize/index/staticarray.ts +1 -0
  17. package/assembly/deserialize/index/string.ts +15 -0
  18. package/assembly/deserialize/index/struct.ts +1 -0
  19. package/assembly/deserialize/index/typedarray.ts +15 -0
  20. package/assembly/deserialize/index/unsigned.ts +1 -0
  21. package/assembly/deserialize/index.ts +14 -0
  22. package/assembly/deserialize/integer.ts +42 -0
  23. package/assembly/deserialize/simd/array/integer.ts +307 -0
  24. package/assembly/deserialize/simd/string.ts +130 -11
  25. package/assembly/deserialize/simple/arbitrary.ts +5 -12
  26. package/assembly/deserialize/simple/array/arbitrary.ts +12 -36
  27. package/assembly/deserialize/simple/array/array.ts +2 -8
  28. package/assembly/deserialize/simple/array/bool.ts +2 -8
  29. package/assembly/deserialize/simple/array/box.ts +2 -8
  30. package/assembly/deserialize/simple/array/float.ts +2 -8
  31. package/assembly/deserialize/simple/array/integer.ts +2 -8
  32. package/assembly/deserialize/simple/array/map.ts +6 -26
  33. package/assembly/deserialize/simple/array/object.ts +6 -26
  34. package/assembly/deserialize/simple/array/raw.ts +18 -61
  35. package/assembly/deserialize/simple/array/string.ts +5 -10
  36. package/assembly/deserialize/simple/array/struct.ts +6 -26
  37. package/assembly/deserialize/simple/array.ts +2 -5
  38. package/assembly/deserialize/simple/bool.ts +2 -6
  39. package/assembly/deserialize/simple/map.ts +29 -102
  40. package/assembly/deserialize/simple/object.ts +24 -81
  41. package/assembly/deserialize/simple/raw.ts +1 -4
  42. package/assembly/deserialize/simple/set.ts +11 -37
  43. package/assembly/deserialize/simple/staticarray/array.ts +1 -1
  44. package/assembly/deserialize/simple/staticarray/bool.ts +1 -1
  45. package/assembly/deserialize/simple/staticarray/float.ts +1 -1
  46. package/assembly/deserialize/simple/staticarray/integer.ts +1 -1
  47. package/assembly/deserialize/simple/staticarray/string.ts +7 -14
  48. package/assembly/deserialize/simple/staticarray/struct.ts +1 -1
  49. package/assembly/deserialize/simple/staticarray.ts +57 -21
  50. package/assembly/deserialize/simple/string.ts +90 -10
  51. package/assembly/deserialize/simple/struct.ts +25 -121
  52. package/assembly/deserialize/simple/typedarray.ts +94 -0
  53. package/assembly/deserialize/swar/array/arbitrary.ts +8 -0
  54. package/assembly/deserialize/swar/array/array.ts +39 -0
  55. package/assembly/deserialize/swar/array/bool.ts +47 -0
  56. package/assembly/deserialize/swar/array/box.ts +8 -0
  57. package/assembly/deserialize/swar/array/float.ts +39 -0
  58. package/assembly/deserialize/swar/array/integer.ts +461 -0
  59. package/assembly/deserialize/swar/array/map.ts +7 -0
  60. package/assembly/deserialize/swar/array/object.ts +44 -0
  61. package/assembly/deserialize/swar/array/raw.ts +8 -0
  62. package/assembly/deserialize/swar/array/shared.ts +96 -0
  63. package/assembly/deserialize/swar/array/string.ts +39 -0
  64. package/assembly/deserialize/swar/array/struct.ts +44 -0
  65. package/assembly/deserialize/swar/array.ts +49 -0
  66. package/assembly/deserialize/swar/string.ts +648 -15
  67. package/assembly/deserialize/unsigned.ts +75 -0
  68. package/assembly/index.d.ts +1 -3
  69. package/assembly/index.ts +316 -374
  70. package/assembly/serialize/index/arbitrary.ts +75 -0
  71. package/assembly/serialize/index/array.ts +1 -0
  72. package/assembly/serialize/index/bool.ts +1 -0
  73. package/assembly/serialize/index/date.ts +1 -0
  74. package/assembly/serialize/index/float.ts +1 -0
  75. package/assembly/serialize/index/integer.ts +1 -0
  76. package/assembly/serialize/index/map.ts +1 -0
  77. package/assembly/serialize/index/object.ts +46 -0
  78. package/assembly/serialize/index/raw.ts +1 -0
  79. package/assembly/serialize/index/set.ts +1 -0
  80. package/assembly/serialize/index/staticarray.ts +1 -0
  81. package/assembly/serialize/index/string.ts +15 -0
  82. package/assembly/serialize/index/struct.ts +1 -0
  83. package/assembly/serialize/index/typedarray.ts +66 -0
  84. package/assembly/serialize/index.ts +13 -0
  85. package/assembly/serialize/simd/string.ts +4 -13
  86. package/assembly/serialize/simple/arbitrary.ts +6 -0
  87. package/assembly/serialize/simple/raw.ts +1 -5
  88. package/assembly/serialize/simple/string.ts +3 -11
  89. package/assembly/serialize/simple/typedarray.ts +63 -0
  90. package/assembly/serialize/swar/string.ts +6 -21
  91. package/assembly/util/concat.ts +1 -5
  92. package/assembly/util/index.ts +1 -0
  93. package/assembly/util/masks.ts +12 -18
  94. package/assembly/util/memory.ts +0 -0
  95. package/assembly/util/snp.ts +1 -4
  96. package/assembly/util/stringScan.ts +24 -0
  97. package/assembly/util/swar.ts +50 -6
  98. package/lib/as-bs.ts +137 -127
  99. package/package.json +26 -5
  100. package/transform/lib/builder.d.ts.map +1 -1
  101. package/transform/lib/builder.js +5 -13
  102. package/transform/lib/builder.js.map +1 -1
  103. package/transform/lib/index.d.ts +1 -0
  104. package/transform/lib/index.d.ts.map +1 -1
  105. package/transform/lib/index.js +672 -757
  106. package/transform/lib/index.js.map +1 -1
  107. package/transform/lib/linkers/alias.d.ts.map +1 -1
  108. package/transform/lib/linkers/alias.js.map +1 -1
  109. package/transform/lib/linkers/custom.d.ts.map +1 -1
  110. package/transform/lib/linkers/custom.js +8 -9
  111. package/transform/lib/linkers/custom.js.map +1 -1
  112. package/transform/lib/linkers/imports.d.ts.map +1 -1
  113. package/transform/lib/linkers/imports.js.map +1 -1
  114. package/transform/lib/types.d.ts +6 -0
  115. package/transform/lib/types.d.ts.map +1 -1
  116. package/transform/lib/types.js +83 -21
  117. package/transform/lib/types.js.map +1 -1
  118. package/transform/lib/util.d.ts.map +1 -1
  119. package/transform/lib/util.js +1 -1
  120. package/transform/lib/util.js.map +1 -1
  121. package/transform/lib/visitor.d.ts.map +1 -1
  122. package/transform/lib/visitor.js +1 -2
  123. package/transform/lib/visitor.js.map +1 -1
  124. package/.prettierrc +0 -3
  125. package/ARCHITECTURE.md +0 -320
  126. package/CONTRIBUTING.md +0 -238
  127. package/TODO +0 -1
  128. package/assembly/deserialize/simple/float.ts +0 -11
  129. package/assembly/deserialize/simple/integer.ts +0 -9
  130. package/assembly/test.ts +0 -30
  131. package/eslint.config.js +0 -60
  132. package/lib/tsconfig.json +0 -8
  133. package/tools/assemblyscript-eslint-local.js +0 -29
  134. package/tools/assemblyscript-eslint.js +0 -29
  135. package/transform/tsconfig.json +0 -35
package/CHANGELOG.md ADDED
@@ -0,0 +1,417 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ - feat: allow `JSON.Value` to store and re-serialize built-in typed arrays and `ArrayBuffer`
6
+ - feat: support `JSON.stringify<ArrayBuffer>(...)` directly without a dedicated helper
7
+ - feat: let explicit `__SERIALIZE_CUSTOM` / `__DESERIALIZE_CUSTOM` hooks override built-in typed-array and `ArrayBuffer` handling while keeping generated hooks last
8
+ - feat: support optional JSON shape hints on `@serializer(...)` / `@deserializer(...)` decorators, defaulting to `any` and allowing nullable forms like `string | null`
9
+ - fix: preserve `bs` state across `JSON.internal.stringify(...)` and `JSON.internal.parse(...)`
10
+ - fix: make escaped string deserializers use local `bs` slices so nested parse/custom flows do not clobber active buffer state
11
+ - fix: allow nested `@json` fields that use decorator-based custom deserializers to deserialize correctly from string-valued object properties
12
+ - fix: restore correct object-value end pointers in generated field deserializers so nested maps and custom string-backed fields both deserialize correctly
13
+ - fix: make `JSON.Value` follow built-in subclass rules consistently for typed-array subclasses and custom `@json` subclasses
14
+ - fix: make generated custom serializer wrappers use the provided `ptr` so indirect-call sites like `JSON.Value` serialize correctly
15
+ - fix: resolve stdlib and `--lib` base classes during transform inheritance so `@json` subclasses of built-ins like `Uint8Array` include inherited fields instead of collapsing to empty objects
16
+ - fix: stop preloading transform imports through `parser.parseFile(...)`, so repeated `asc()` calls in the same process no longer poison parser state or trip `lookupForeignFile` assertions
17
+ - fix: rewrite nested `JSON.parse(...)` calls inside custom serializers and deserializers to `JSON.internal.parse(...)`, matching the existing internal stringify rewrite and documented behavior
18
+ - docs: clarify that custom serializers and deserializers must always produce and consume valid JSON
19
+ - docs: document how subclassing built-in container types behaves, including when `@json` custom overrides take effect
20
+ - fix: stop naive string deserialization scratch allocations from growing across repeated large payload parses by using local `ensureSize(...)` scratch capacity instead of serialization-style proposed growth
21
+ - tests: expand custom serializer/deserializer coverage for nullable fields, multiple custom fields, escaped content, whitespace, and repeated round-trips
22
+ - tests: add a repeated large string-heavy struct parse regression that exercises the naive deserialization scratch path
23
+ - tests: add override coverage for plain and custom subclasses of `Array`, `Map`, `Set`, and typed arrays
24
+ - tests: add `JSON.Value` regressions for undecorated and decorated typed-array subclasses
25
+ - tests: add regression coverage for generated `@json` subclasses inheriting stdlib typed-array fields
26
+ - chore: restrict published package contents to the runtime, declarations, built transform output, and top-level metadata files
27
+ - perf: raise the serialization buffer minimum size to 1024 bytes and add adaptive `bs.shrink()`
28
+ - perf: add a packed SWAR `u16_to_hex4_swar` helper for `\uXXXX` emission and use it across simple, SWAR, and SIMD string serializers
29
+ - tests: add dedicated SWAR hex helper coverage, including exhaustive full-range round-trip validation
30
+ - bench: add SWAR hex and SWAR string serializer head-to-head microbenchmarks
31
+
32
+ ## 2026-03-19 - 1.3.0
33
+
34
+ - chore: exclude generated `.as-test` build artifacts from ESLint, tighten generic deserializer offset math, and remove the obsolete `run-tests.sh` helper
35
+ - fix: add built-in typed array and `ArrayBuffer` serialization and deserialization support, including transform-generated field handling inside `@json` classes
36
+ - fix: finish subtype-aware `StaticArray` deserialization for nested arrays, maps, JSON value types, transform-backed structs, and related regressions
37
+ - fix: tighten default-path runtime correctness for signed `JSON.Value`, `@omitif("...")`, escaped nested strings, raw-array string handling, and `JSON.Obj.from(...)`
38
+ - perf: add a SIMD string-field deserializer for fast-path object deserialization and align transform codegen with mode-specific field helpers
39
+ - perf: add direct SWAR and SIMD integer-array deserializers with reusable-storage fast paths and dedicated throughput benches
40
+ - refactor: add `assembly/serialize/index/*` and `assembly/deserialize/index/*` dispatchers and route the public API through them
41
+ - perf: speed up float deserialization with handwritten parser paths, bitwise power-of-ten handling, and batched fractional parsing
42
+ - fix: avoid pulling SIMD code into non-SIMD bench builds and make benchmark temp-file cleanup tolerant of missing `asc --converge` outputs
43
+ - compat: add compatability between json-as and try-as by ignoring methods prefixed by __try
44
+ - feat: gate generated fast struct deserialization behind `JSON_USE_FAST_PATH=1`
45
+ - refactor: make generated struct `__DESERIALIZE` methods return the advanced source pointer
46
+ - perf: tune SWAR and SIMD string deserialization to return plain strings directly and only allocate scratch space after the first escape
47
+ - perf: streamline split SWAR string field deserialization and string-buffer reuse on the fast path
48
+ - perf: simplify generated fast integer field parsing to reuse `srcStart` and offset-based stores
49
+ - perf: parse generated numeric fields in a single pass with typed integer, unsigned, and float field helpers
50
+ - perf: hand-tune `small.bench.ts` and refresh benchmark runner turbofan flag configuration
51
+ - bench: add a string deserialization head-to-head benchmark and simplify throughput/chart comparisons back to the final JS/NAIVE/SWAR/SIMD view
52
+ - fix: keep the fast generated path opt-in by default and restore the `large` benchmark slow-path behavior
53
+ - refactor: split numeric deserializers into dedicated `assembly/deserialize/{integer,unsigned,float}` modules
54
+ - tooling: expand benchmark chart metadata parsing for custom string benchmark series
55
+ - tests: add escaped-quote SWAR deserialization regressions around block boundaries
56
+
57
+ ## 2026-02-18 - 1.2.6
58
+
59
+ - fix: support arbitrary nested arrays and objects [#176](https://github.com/JairusSW/json-as/pull/176)
60
+ - chore: add contributor from [#176](https://github.com/JairusSW/json-as/pull/176)
61
+ - tests: significantly expand coverage across every file in `assembly/__tests__`
62
+ - tests: add additional primitive, array, nested payload, and escaped string regression cases to all specs
63
+ - tests: add more file-specific deserialize/serialize scenarios for custom, struct, map, resolving, and related schema behaviors
64
+
65
+ ## 2026-02-17 - 1.2.5
66
+
67
+ - fix: stabilize ESLint for this repo by excluding AssemblyScript sources from standard TypeScript lint parsing
68
+ - fix: allow underscore-prefixed intentionally-unused TypeScript variables in transformer sources
69
+ - fix: add d8 globals for benchmark runner linting and make `bench/lib/bench.js` parseable by ESLint
70
+
71
+ ## 2026-01-23 - 1.2.4
72
+
73
+ - fix: `Set<T>` and `StaticArray<T>` members in classes were not deserializing correctly
74
+ - fix: Fully reset state of transformer between builds
75
+
76
+ ## 2026-01-03 - 1.2.3
77
+
78
+ - feat: handle surrogates and code units during string serialization and deserialization
79
+ - perf: add SWAR and SIMD string deserialization implementations
80
+
81
+ ## 2025-12-23 - 1.2.2
82
+
83
+ - chore: reduce package size to sub 70kb
84
+
85
+ ## 2025-12-23 - 1.2.1
86
+
87
+ - chore: fix chart link in readme
88
+
89
+ ## 2025-12-23 - 1.2.0
90
+
91
+ - feat: Implement SWAR based algorithms, SIMD improvements, and better documentation.
92
+
93
+ ## 2025-12-21 - 1.1.26
94
+
95
+ - chore: remove log
96
+
97
+ ## 2025-12-21 - 1.1.25
98
+
99
+ - feat: Implement SWAR-based string serialization
100
+
101
+ ## 2025-11-28 - 1.1.24
102
+
103
+ - feat: Implement a moving average window to determine buffer size (essentially, allow the buffer size to shrink) [#163](https://github.com/JairusSW/json-as/pull/163)
104
+
105
+ ## 2025-11-06 - 1.1.23
106
+
107
+ - fix: Map keys should follow proper typing and quote rules [#161](https://github.com/JairusSW/json-as/issues/161)
108
+
109
+ ## 2025-09-01 - 1.1.22
110
+
111
+ - fix: Type aliases should work across files [#154](https://github.com/JairusSW/json-as/issues/154)
112
+
113
+ ## 2025-08-14 - 1.1.21
114
+
115
+ - fix: JSON.parse on classes with enums [#155](https://github.com/JairusSW/json-as/issues/155)
116
+ - fix: Resolve memory OOB issue within `serializeFloat` function [#153](https://github.com/JairusSW/json-as/issues/153)
117
+
118
+ ## 2025-07-14 - 1.1.20
119
+
120
+ - feat: enable SIMD string serialization
121
+
122
+ ## 2025-06-30 - 1.1.19
123
+
124
+ - fix: wrong path used in `readFileSync` when importing from a library
125
+
126
+ ## 2025-06-30 - 1.1.18
127
+
128
+ - fix: [#150](https://github.com/JairusSW/json-as/issues/150)
129
+
130
+ ## 2025-06-17 - 1.1.17
131
+
132
+ - fix: add support for classes within namespaces [#147](https://github.com/JairusSW/json-as/pull/147)
133
+
134
+ ## 2025-06-12 - 1.1.16
135
+
136
+ - tests: properly support nulls (in testing lib)
137
+ - fix: initialize generic properties correctly
138
+ - fix: make generated imports compatible with windows
139
+ - feat: add support for fields marked with `readonly`
140
+
141
+ ## 2025-06-09 - 1.1.15
142
+
143
+ - feat: add `.as<T>()` method to `JSON.Value`
144
+ - chore: remove all references to `__SERIALIZE_CUSTOM`
145
+ - feat: add support for `StaticArray` serialization
146
+ - feat: support `JSON.Raw` in array types
147
+ - tests: add tests for `JSON.Raw[]`
148
+
149
+ ## 2025-05-29 - 1.1.14
150
+
151
+ - fix: hotfix schema resolver
152
+
153
+ ## 2025-05-29 - 1.1.13
154
+
155
+ - fix: small issues with schema linking
156
+ - tests: add tests for schema linking and discovery
157
+
158
+ ## 2025-05-29 - 1.1.12
159
+
160
+ - fix: add helpful warning on unknown or unaccessible types in fields
161
+ - feat: support deserialization of class generics
162
+ - fix: add support for numerical generics
163
+ - tests: add proper testing for generics
164
+ - feat: support type aliases with a custom type resolver/linker
165
+ - chore: add other linkers to tsconfig and clean up
166
+ - feat: add type alias resolving
167
+
168
+ ## 2025-05-28 - 1.1.11
169
+
170
+ - fix: class resolving should only search top level statements for class declarations
171
+ - fix: add helpful error if class is missing an @json decorator
172
+ - fix: properly calculate relative path when json-as is a library
173
+ - fix: add proper null check when resolving imported classes
174
+
175
+ ## 2025-05-28 - 1.1.10
176
+
177
+ - feat: add more debug levels (1 = print transform code, 2 = print keys/values at runtime)
178
+ - feat: add write out feature (`JSON_WRITE=path-to-file.ts`) which writes out generated code
179
+ - fix: complete full parity between port and original version for correct deserialization of all types
180
+ - feat: add proper schema resolution and dependency resolution
181
+ - feat: add proper type resolution to schema fields
182
+ - fix: properly calculate the relative path between imports to modules
183
+
184
+ ## 2025-05-27 - 1.1.9
185
+
186
+ - change: strict mode is disabled by default. Enable it with JSON_STRICT=true
187
+ - fix: should ignore properties of same length and type if no matching key exists
188
+ - fix: should ignore properties of different type if no matching key exists
189
+ - fix: should ignore complex properties if no matching key exists
190
+
191
+ ## 2025-05-27 - 1.1.8
192
+
193
+ - feat: add support for calling `JSON.stringify/JSON.parse` methods inside of custom serializers, but not yet deserializers
194
+
195
+ ## 2025-05-27 - 1.1.7
196
+
197
+ - fix: bad boolean logic to decide whether to add 2nd break statement
198
+
199
+ ## 2025-05-23 - 1.1.6
200
+
201
+ - fix: null and boolean fields would miscalculate offsets when deserializing
202
+
203
+ ## 2025-05-23 - 1.1.5
204
+
205
+ - fix: index.js didn't point to correct file, thus creating a compiler crash
206
+
207
+ ## 2025-05-23 - 1.1.4
208
+
209
+ - revert: grouping properties in favor of memory.compare
210
+
211
+ ## 2025-05-23 - 1.1.3
212
+
213
+ - feat: group properties of structs before code generation
214
+ - fix: break out of switch case after completion
215
+ - ci: make compatible with act for local testing
216
+
217
+ ## 2025-05-22 - 1.1.2
218
+
219
+ - fix: correct small typos in string value deserialization port
220
+
221
+ ## 2025-05-22 - 1.1.1
222
+
223
+ - fix: remove random logs
224
+
225
+ ## 2025-05-22 - 1.1.0
226
+
227
+ - fix: change _DESERIALIZE<T> to _JSON_T to avoid populating local scope
228
+
229
+ ## 2025-05-22 - 1.0.9
230
+
231
+ - fix: [#132](https://github.com/JairusSW/json-as/issues/132)
232
+ - feat: allow base classes to use their child classes if the signatures match
233
+ - perf: rewrite struct deserialization to be significantly faster
234
+ - fix: [#131](https://github.com/JairusSW/json-as/issues/131) Generic classes with custom deserializer crashing
235
+ - fix: [#66](https://github.com/JairusSW/json-as/issues/66) Throw error when additional keys are in JSON
236
+
237
+ ## 2025-05-21 - 1.0.8
238
+
239
+ - fix: inline warnings on layer-2 serialize and deserialize functions
240
+ - feat: fully support `JSON.Obj` and `JSON.Box` everywhere
241
+ - fix: temp disable SIMD
242
+ - feat: write fair benchmarks with `v8` using `jsvu`
243
+
244
+ ## 2025-05-14 - 1.0.7
245
+
246
+ - merge: pull request [#128](https://github.com/JairusSW/json-as/pull/128) from [loredanacirstea/nested-custom-serializer-fix](https://github.com/loredanacirstea/nested-custom-serializer-fix)
247
+
248
+ ## 2025-05-12 - 1.0.6
249
+
250
+ - fix: support zero-param serialization and make sure types are consistent
251
+ - fix: [#124](https://github.com/JairusSW/json-as/issues/124)
252
+
253
+ ## 2025-05-11 - 1.0.5
254
+
255
+ - feat: add sanity checks for badly formatted strings
256
+ - fix: [#120](https://github.com/JairusSW/json-as/issues/120) handle empty `JSON.Obj` serialization
257
+ - feat: add SIMD optimization if SIMD is enabled by user
258
+ - fix: handle structs with nullable array as property [#123](https://github.com/JairusSW/json-as/pull/123)
259
+ - fix: struct serialization from writing to incorrect parts of memory when parsing nested structs [#125](https://github.com/JairusSW/json-as/pull/125)
260
+ - chore: add two new contributors
261
+
262
+ ## 2025-04-07 - 1.0.4
263
+
264
+ - fix: paths must be resolved as POSIX in order to be valid TypeScript imports [#116](https://github.com/JairusSW/json-as/issues/116)
265
+
266
+ ## 2025-03-24 - 1.0.3
267
+
268
+ - fix: make transform windows-compatible [#119](https://github.com/JairusSW/json-as/issues/119?reload=1)
269
+
270
+ ## 2025-03-19 - 1.0.2
271
+
272
+ - fix: include check for nullable types for properties when deserialization is called internally [#118](https://github.com/JairusSW/json-as/pull/118)
273
+
274
+ ## 2025-03-10 - 1.0.1
275
+
276
+ - docs: add comprehensive performance metrics
277
+
278
+ ## 2025-03-09 - 1.0.0
279
+
280
+ - fix: relative paths pointing through node_modules would create a second Source
281
+ - feat: move behavior of `--lib` into transform itself
282
+ - fix: object with an object as a value containing a rhs bracket or brace would exit early [3b33e94](https://github.com/JairusSW/json-as/commit/3b33e9414dc04779d22d65272863372fcd7af4a6)
283
+
284
+ ## 2025-03-04 - 1.0.0-beta.17
285
+
286
+ - fix: forgot to build transform
287
+
288
+ ## 2025-03-04 - 1.0.0-beta.16
289
+
290
+ - fix: isPrimitive should only trigger on actual primitives
291
+
292
+ ## 2025-03-04 - 1.0.0-beta.15
293
+
294
+ - fix: deserialize custom should take in string
295
+
296
+ ## 2025-03-04 - 1.0.0-beta.14
297
+
298
+ - fix: reference to nonexistent variable during custom deserialization layer 2
299
+
300
+ ## 2025-03-04 - 1.0.0-beta.13
301
+
302
+ - fix: forgot to actually build the transform
303
+
304
+ ## 2025-03-04 - 1.0.0-beta.12
305
+
306
+ - fix: build transform
307
+
308
+ ## 2025-03-04 - 1.0.0-beta.11
309
+
310
+ - fix: wrongly assumed pointer types within arbitrary deserialization
311
+ - fix: wrong pointer type being passed during map deserialization
312
+
313
+ ## 2025-03-04 - 1.0.0-beta.10
314
+
315
+ - fix: transform not generating the right load operations for keys
316
+ - fix: whitespace not working in objects or struct deserialization
317
+ - fix: JSON.Raw not working when deserializing as Map<string, JSON.Raw>
318
+
319
+ ## 2025-03-03 - 1.0.0-beta.9
320
+
321
+ - rename: change libs folder to lib
322
+
323
+ ## 2025-03-03 - 1.0.0-beta.8
324
+
325
+ - docs: add instructions for using `--lib` in README
326
+
327
+ ## 2025-03-03 - 1.0.0-beta.7
328
+
329
+ - fix: add as-bs to `--lib` section
330
+ - chore: clean up transform
331
+ - refactor: transform should import `~lib/as-bs.ts` instead of relative path
332
+
333
+ ## 2025-03-01 - 1.0.0-beta.6
334
+
335
+ - fix: import from base directory index.ts
336
+
337
+ ## 2025-03-01 - 1.0.0-beta.5
338
+
339
+ - fix: revert pull request [#112](https://github.com/JairusSW/json-as/pull/112)
340
+
341
+ ## 2025-02-25 - 1.0.0-beta.4
342
+
343
+ - fix: warn on presence of invalid types contained in a schema [#112](https://github.com/JairusSW/json-as/pull/112)
344
+
345
+ ## 2025-02-25 - 1.0.0-beta.3
346
+
347
+ - feat: change `JSON.Raw` to actual class to facilitate proper support without transformations
348
+ - fix: remove old `JSON.Raw` logic from transform code
349
+
350
+ ## 2025-02-25 - 1.0.0-beta.2
351
+
352
+ - feat: add support for custom serializers and deserializers [#110](https://github.com/JairusSW/json-as/pull/110)
353
+
354
+ ## 2025-02-22 - 1.0.0-beta.1
355
+
356
+ - perf: add benchmarks for both AssemblyScript and JavaScript
357
+ - docs: publish preliminary benchmark results
358
+ - tests: ensure nested serialization works and add to tests
359
+ - feat: finish arbitrary type implementation
360
+ - feat: introduce `JSON.Obj` to handle objects effectively
361
+ - feat: reimplement arbitrary array deserialization
362
+ - fix: remove brace check on array deserialization
363
+ - feat: introduce native support for `JSON.Obj` transformations
364
+ - feat: implement arbitrary object serialization
365
+ - fix: deserialization of booleans panics on `false`
366
+ - fix: `bs.resize` should be type-safe
367
+ - impl: add `JSON.Obj` type as prototype to handle arbitrary object structures
368
+ - chore: rename static objects (schemas) to structs and name arbitrary objects as `obj`
369
+ - tests: add proper tests for arbitrary types
370
+ - fix: empty method generation using outdated function signature
371
+ - docs: update readme to be more concise
372
+
373
+ ## 2025-02-13 - 1.0.0-alpha.4
374
+
375
+ - feat: reintroduce support for `Box<T>`-wrapped primitive types
376
+ - tests: add extensive tests to all supported types
377
+ - fix: 6-byte keys being recognized on deserialize
378
+ - perf: take advantage of aligned memory to use a single 64-bit load on 6-byte keys
379
+ - fix: `bs.proposeSize()` should increment `stackSize` by `size` instead of setting it
380
+ - fix: allow runtime to manage `bs.buffer`
381
+ - fix: memory leaks in `bs` module
382
+ - fix: add (possibly temporary) `JSON.Memory.shrink()` to shrink memory in `bs`
383
+ - perf: prefer growing memory by `nextPowerOf2(size + 64)` for less reallocations
384
+ - tests: add boolean tests to `Box<T>`
385
+ - fix: serialization of non-growable data types should grow `bs.stackSize`
386
+
387
+ ## 2025-01-31 - 1.0.0-alpha.3
388
+
389
+ - fix: write to proper offset when deserializing string with \u0000-type escapes
390
+ - fix: simplify and fix memory offset issues with bs module
391
+ - fix: properly predict minimum size of to-be-serialized schemas
392
+ - fix: replace as-test with temporary framework to mitigate json-as versioning issues
393
+ - fix: fix multiple memory leaks during serialization
394
+ - feat: align memory allocations for better performance
395
+ - feat: achieve a space complexity of O(n) for serialization operations, unless dealing with \u0000-type escapes
396
+
397
+ ## 2025-01-20 - 1.0.0-alpha.2
398
+
399
+ - fix: disable SIMD in generated transform code by default
400
+ - fix: re-add as-bs dependency so that it will not break in non-local environments
401
+ - fix: remove AS201 'conversion from type usize to i32' warning
402
+ - fix: add as-bs to peer dependencies so only one version is installed
403
+ - fix: point as-bs imports to submodule
404
+ - fix: remove submodule in favor of static module
405
+ - fix: bs.ensureSize would not grow and thus cause memory faults
406
+ - fix: bs.ensureSize triggering unintentionally
407
+
408
+ ## 2025-01-20 - 1.0.0-alpha.1
409
+
410
+ - feat: finish implementation of arbitrary data serialization and deserialization using JSON.Value
411
+ - feat: reinstate usage of `JSON.Box<T>()` to support nullable primitive types
412
+ - feat: eliminate the need to import the `JSON` namespace when defining a schema
413
+ - feat: reduce memory usage so that it is viable for low-memory environments
414
+ - feat: write to a central buffer and reduce memory overhead
415
+ - feat: rewrite the transform to properly resolve schemas and link them together
416
+ - feat: pre-allocate and compute the minimum size of a schema to avoid memory out of range errors
417
+ >>>>>>> cf237fa (chore: release 1.3.0)