Just released #JavaScript #Database (#JSDB)¹ version 3.0.0
Breaking change²: data is now evaluated in virtual machine contexts.
If you were persisting custom objects³ and referencing classes from global scope (`globalThis`) to have your objects keep their types when read, you must now explicitly register your list of custom classes using the new `classes` property of the `options` object when calling JSDB.open().
¹ https://codeberg.org/small-tech/jsdb#javascript-database-jsdb
² https://codeberg.org/small-tech/jsdb/src/branch/main/CHANGELOG.md#3-0-0-2023-04-28
³ https://codeberg.org/small-tech/jsdb#custom-data-types
This is quite a major change internally but since #JSDB has 100% code coverage, I’m *pretty certain* I didn’t break anything else.
Then again, JSDB had 100% code coverage before this too and the issue this update fixes was around for several years. (Likely because no one, including me, was really persisting custom objects… something I’m now starting to use while building #Domain¹.)
Just goes to stress that 100% code coverage in no way means “bug free.” ;)
PS. I’ll update Kitten¹ with the latest JSDB today.
Right, I just updated Kitten so it includes JSDB version 3.0.0 and it now has built-in support for database app modules.
A database app module is an app module¹ for your database where you can provide a schema for it using JavaScript class hierarchies and register those classes with the database so your custom objects maintain their types when they are written and read in.
You can see it in use in Domain here: https://codeberg.org/domain/app/src/branch/main/app_modules/database/database.js#L198