« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/cacheable-object.js
AgeCommit message (Collapse)Author
17 hoursdata, infra: better CacheableObject prototype inheritence(quasar) nebula
Basically, properties (as written in source code) are only registered once EVER, instead of "also" on subclasses, which was previously the case - we were literally copying over the descriptors and then re-evaluating as though they were new. That's the goal, but to make it happen, we had to redo how default property values are initialized. Things no longer self- prepare by making a "storage" for all their cached values with null, or defaults, filled in - instead they create a new object which inherits those defaults from their prototype. This object respectively has the prototype of the superclass' prototype's defaults, and so on. A nice effect is that validating defaults against update.validate specs now happens during prototype finalization, instead of every time any instance is instantiated. We also had to do the same kind of inheritence shenanigans with the full propertyDescriptors specs themselves. The real-world performance boost for this is probably more or less zero RIGHT NOW, because Thing subclassing is used crazy sparingly (and there's still work to make it really nice). But if [[Prototype]] chains don't really take memory, then possibly this cleans up a lot of extremely similar objects where every new Thing property multiplies memory usage across all instances of that thing, regardless how few actually set a value. Maybe! Who knows what V8 really optimizes, but maybe!
2025-10-15cacheable-object: ugh, embarrassing...(quasar) nebula
2025-05-27eslint: make use of optional catch binding more often(quasar) nebula
2025-04-10data: CacheableObject, Thing: restore seal(this) behavior(quasar) nebula
2025-02-22cacheable-object: don't hit superclass finalized status(quasar) nebula
Also report errors finalizing properly
2025-01-13cacheable-object: mark cache valid / finalization after success(quasar) nebula
2025-01-13cacheable-object: drop old stuff(quasar) nebula
2025-01-13cacheable-object: remove 900,000 functions(quasar) nebula
2025-01-13cacheable-object: tread carefully in {*}PropertyValueError(quasar) nebula
2024-06-18cacheable-object: clone, copyUpdateValuesOnto(quasar) nebula
2024-05-31data: CacheableObject: check default update value more gracefully(quasar) nebula
Fixes a test failure introduced in cebd7f4a, and more generally, crashes to do with flags: {update: true} but no update: {...} configuration.
2024-05-19data: CacheableObject: allow falsy default update values(quasar) nebula
2024-05-01composite: 'thisProperty' self-reflection(quasar) nebula
2024-05-01cacheable-object: define properties on symbol, allow symbol props(quasar) nebula
This commit really does two separate things: * Move the definition for `propertyDescriptors` from that string key into `Symbol.for('CacheableObject.propertyDescriptors')` * Allow and support descriptors for key-based properties, by iterating over Reflect.ownKeys() instead of Object.entries()
2024-01-30data: tidy things folder & imports, nicer fields yaml spec(quasar) nebula
2022-11-28divide things.js into modular files (hilariously)(quasar) nebula
2022-11-26finish up cosmetic style changes(quasar) nebula
2022-06-29optional data pre-cache(quasar) nebula
2022-06-26real pragma, and some eslint fixes(quasar) nebula
2022-06-26add @format pragma to JS files(quasar) nebula
2022-06-26initial prettier/eslint commit(quasar) nebula
2022-03-05non-jpg full res art links, artist avatars(quasar) nebula
2022-02-12bam (Thing subclasses: several steps, one file)(quasar) nebula