Thank you for submitting this pull request! We appreciate you spending the time to work on these changes.
What is the motivation?
We found that the size of the library was getting out of hand and wanted to improve on this. Additionally, with the introduction of JSR, we no longer see the need for this to be a Deno project.
What does this change do?
Drops the decimal.js library, as it's unpacked size is 250kb.
Introduces a custom CBOR library, optimised for size, speed and our needs.
Introduces a custom Duration library, optimised for size, speed and out needs.
Introduces a new Uuid wrapper to offer a nicer interface over the uuidv7 library.
No longer depends on zod, which was a big contributor to size.
No longer depends on semver, which was a big contributor to size. We now compare versions with localeCompare.
Adjusted the way that engines work. encodeCbor and decodeCbor are now passed along with the emitter in an EngineContext class, to the engine. This ensures that the engine library uses the same instances of classes that the cbor encoding and decoding depend on.
Now uses BiomeJS for faster and further optimised formatting.
Now publishes to the JSR registry
Fixes certain issues with geometries
Fixes an issue which caused the Pinger to be applied to engines outside of ws and wss.
Optimises the jsonify method to use custom logic over JSON.stringify() and JSON.parse(), keeping non-surrealql class values intact, and resulting in 100% to 150% faster.
Added more tests.
We now test across SurrealDB 1.4.2, 1.5.2 and 2.0.0-alpha.3.
PreparedQuery instances now partially encode queries and bindings before they are sent over.
What is your testing strategy?
Updated all tests to Bun, and added various new tests. In the future we'd like to expand tests to test on both source and the compiled library, and across Bun, Deno and Node.
Thank you for submitting this pull request! We appreciate you spending the time to work on these changes.
What is the motivation?
We found that the size of the library was getting out of hand and wanted to improve on this. Additionally, with the introduction of JSR, we no longer see the need for this to be a Deno project.
What does this change do?
decimal.js
library, as it's unpacked size is 250kb.Uuid
wrapper to offer a nicer interface over theuuidv7
library.zod
, which was a big contributor to size.semver
, which was a big contributor to size. We now compare versions withlocaleCompare
.encodeCbor
anddecodeCbor
are now passed along with the emitter in anEngineContext
class, to the engine. This ensures that the engine library uses the same instances of classes that the cbor encoding and decoding depend on.ws
andwss
.jsonify
method to use custom logic overJSON.stringify()
andJSON.parse()
, keeping non-surrealql class values intact, and resulting in 100% to 150% faster.What is your testing strategy?
Updated all tests to Bun, and added various new tests. In the future we'd like to expand tests to test on both source and the compiled library, and across Bun, Deno and Node.
Is this related to any issues?
Fixes #284 Supersedes #272
Have you read the Contributing Guidelines?