Skip to main content

Changelog

0.12.1 (2024-07-03)

Features

  • core: normalize IDs to string inside default cache implementation (4de6033)

0.12.0 (2024-07-03)

➜ Migration from 0.11.x to 0.12.x

Features

  • core: replace models setups with hooks (b136fe1)

BREAKING CHANGES

  • core: setup tasks objects and typings have been removed and replaced by onBoot and onInit hook registrer functions.

0.11.4 (2024-07-01)

Bug Fixes

  • core: composition this typing (e4ac5fd)

0.11.3 (2024-06-29)

Bug Fixes

  • jsonapi: convert models path to kebab case as default (72cee5c)
  • serialization: use correct option to serialize relation (6590c20)

Features

  • core: add run variadic call to actions (00667ba)
  • core: add logs to cachedOr (7b5c5b5)
  • http: add models path transformer options (0939d80)

0.11.2 (2024-06-25)

Bug Fixes

  • cli: correct default values on confirm prompt (90d5854)

0.11.1 (2024-06-25)

Bug Fixes

  • cli: use file parentPath instead of path when available (6c707b0)

0.11.0 (2024-06-24)

➜ Migration from 0.9.x to 0.11.x

Bug Fixes

  • package exports definition in package.json (b026e47)

Features

  • add sourcemap to build (cd630a3)
  • better extensions and treeshaking (75528ed)
  • core: support action extensions in relation loaders callbacks (56c50a8)

BREAKING CHANGES

  • enhancer/runner.extension should now be called as function (e.g. .extension()). makeEnhancersExtension and makeRunnersExtension have been removed in favor of appendExtension function.

0.9.3 (2024-06-21)

Bug Fixes

  • cli: correctly extract current foscia version (803b12f)
  • rest: deserialize relation even when only ID is present (5007cd6)

Features

  • cli: migrate to enquirer to support web containers (89cc9f4)
  • cli: support disabling colors (7ea530e)
  • core: add filled utility to check if instance contains any values (1fb5e0f)
  • core: add guess path ID configuration to models (e23c620)
  • core: support create through parent's relation (979d719)
  • rest: add pull record values configuration in jsonapi deserializer (89be9cd)
  • rest: add pull record values configuration in rest deserializer (5002e54)
  • rest: deprecate unused includeQueryParameter option in adapter (8b42702)

0.9.2 (2024-06-17)

Bug Fixes

  • cli: typo in relations loader prompt (b43a75d)
  • only deploy on release if not dry release (2f306ad)

0.9.1 (2024-06-16)

Features

  • add github action provenance to npm releases (09098aa)

0.9.0 (2024-06-16)

➜ Migration from 0.8.x to 0.9.x

Features

  • cli: new cli based on commander.js (6ea916a)
  • core: remove 0.7.0 deprecated types and functions (5e16e9a)

BREAKING CHANGES

  • core: following deprecated types and functions have been removed: ModelHookCallback, makeForRelationLoader, runHook, forModel, forInstance, forRelation, forId and find.
  • cli: multiple CLI commands name and behaviors have changed.

0.8.7 (2024-06-12)

Features

  • cli: prioritize skip properties in prompt (b0b2fe6)
  • core: generate unique IDs with Math.random for portability (79ab06d)

0.8.6 (2024-06-12)

Features

  • core: add reducing and reviving model instances (b1d783e)

0.8.5 (2024-06-09)

Bug Fixes

  • cli: correctly show path in alias configuration (7eec31d)
  • core: mark relation loaded when using a loader (208c9c0)

Features

  • cli: guess alias based on root path in init command (0e5a9b0)

0.8.4 (2024-06-07)

Bug Fixes

  • cli: support empty path on init command (e2be71f)

0.8.3 (2024-06-07)

Bug Fixes

  • core: correctly fetch polymorphic relations with model query loader (2b011b9), closes #21
  • core: throw an error if a model is created with an empty type (9cc82c5)

Features

  • core: guess model can guess multiple models for polymorphism (f753e8d)
  • core: support hooks returning a value (baa0230)

0.8.2 (2024-06-07)

Bug Fixes

  • core: allow prepare callback on refresh loader to return something (0382204)
  • core: correctly exclude nested relation on query relation loader (64a2515)
  • rest: only deserialize objects for relations (1819cb0)

Features

  • core: add instances or relations exclusion to relation loaders (ded8b38)
  • core: add model query relation loader factory (85d18db), closes #19
  • core: group nested relations fetching for query relation loader (98ffcbe)
  • core: optional options on relation loader factories (89c9c23)

0.8.1 (2024-04-15)

Features

  • cli: improve logs for commands and errors (30d68f6)

0.8.0 (2024-04-11)

➜ Migration from 0.7.x to 0.8.x

Bug Fixes

  • rest: rest adapter factory will apply appendParams option (62cd3ae)

Features

  • core: add relation writing enhancers (a440f71), closes #17
  • http: add buildURL to customizing URL building on adapter (d343905)
  • jsonapi: add relation endpoints support to adapter (746924c)
  • upgrade to node 20 and upgrade dependencies (a3aa84c), closes #13

BREAKING CHANGES

  • Node >= 18 is required for @foscia/cli

0.7.2 (2024-02-20)

Bug Fixes

  • http: configureRequest will now correctly merge options (63e7300), closes #20
  • http: correctly run context transformers on http adapter (8e0a335)

Features

  • http: add support for other http request init in http adapter (8df48d2), closes #20

0.7.1 (2024-02-15)

Bug Fixes

  • serialization: deserializer with aliased keys (f88d9d6)

Features

  • cli: make init path optional as an argument (47eccdd)
  • serialization: add new options to makeSerializerWith (18fb6fb)

0.7.0 (2024-02-06)

➜ Migration from 0.6.x to 0.7.x

Features

  • core: add model and instance composables usage check functions (66a60fe)
  • core: add model setup method and correct class inheritance (4ffd4b9)
  • core: add tools to extract typings for composable (f1e1153)
  • core: add models setup and improve composables (82cde5a), closes #2
  • serialization: serializer serializeRelation use given value (4db9b80), closes #17

BREAKING CHANGES

  • core: Model configure method first argument is now required.
  • serialization: SerializerI.serializeRelation signature has changed: if you are implementing your own serializer, you should add and use this value parameter as the value to serialize instead of retrieving it from the instance.
  • core: composable are now dedicated objects and should not be object-spread in your definition anymore. Instead of doing { ...publishable } you must use { publishable }.

0.7.0-beta.2 (2024-02-05)

Features

  • core: add model and instance composables usage check functions (66a60fe)
  • core: add model setup method and correct class inheritance (4ffd4b9)
  • core: add tools to extract typings for composable (f1e1153)

BREAKING CHANGES

  • core: Model configure method first argument is now required.

0.7.0-beta.1 (2024-02-05)

Features

  • core: add models setup and improve composables (82cde5a), closes #2
  • serialization: serializer serializeRelation use given value (4db9b80), closes #17

BREAKING CHANGES

  • serialization: SerializerI.serializeRelation signature has changed: if you are implementing your own serializer, you should add and use this value parameter as the value to serialize instead of retrieving it from the instance.
  • core: composable are now dedicated objects and should not be object-spread in your definition anymore. Instead of doing { ...publishable } you must use { publishable }.

0.7.0-beta.0 (2024-02-05)

0.6.3 (2024-01-31)

Bug Fixes

  • core: relation loading won't trigger readonly error anymore (ce7bb7e)
  • jsonapi: handle recursive records when not inside included (a7cf22e)

Features

  • core: add makeQueryRelationLoader (2cade74)
  • core: add query generic context enhancer (eb18ab4)

DEPRECATED

  • core: makeForRelationLoader, use makeQueryRelationLoader instead (2cade74)
  • core: forModel, forInstance, forId, forRelation and find, use query instead (eb18ab4)

0.6.2 (2024-01-30)

Bug Fixes

  • serialization: correctly mark deserialized relations as loaded (6348115)

Features

  • cli: sort properties inside rendered definition (b05a183)

0.6.1 (2024-01-30)

Bug Fixes

  • core: async withoutHooks error rejection (16e57a9)
  • core: ignore undefined values inside snapshots (9059f43)
  • core: run execute instead of adapter read when no action provided (79148c3)
  • core: withoutHooks will correctly restore hooks (780aeeb)
  • serialization: context relation not correctly infered (06200a6)
  • write model values using setter instead of $values object (3b80ed4)

Features

  • core: add ability to disable readonly protection on models (63dd154)
  • core: add forceFill function to write all properties on model (82ffde0)
  • core: add properties hooks (e8738c3)
  • core: add relationData enhancer to serialize relation's value (9721856)
  • core: add runHooks, deprecate runHook (56b50ff)
  • core: add sync callback support for withoutHooks (22df8d6)

DEPRECATED

  • core: runHook, use runHooks instead (56b50ff)
  • core: ModelHookCallback, use ModelInstanceHookCallback instead (e8738c3)

0.6.0 (2024-01-28)

Foscia v0.6.0 is out! This is a big step to stability, with totally reworked action dependencies (adapters, etc.). Migration should be straight forward if you are not using complex configuration options or extending dependencies.

Features

  • revised typing for models and actions preventing wrong errors and allowing generic usage.
  • rewritten serialization in a brand new @foscia/serialization package which now handle a generic (not object/dictionary specific) serialization.
  • rewritten dependencies as factory functions only instead of classes. This make the internal API more private but still customizable using public configuration objects. Each dependency will be more maintainable and still provide customization for end users.

BREAKING CHANGES

  • If you are using default blueprints functions without any advanced configuration, this major version's changes should not impact your implementations.
  • If you are configuring serialization dependencies, you should check out code for the new configuration capabilities of new serialization tools. Feature level of serialization is the same but configuration is not backward compatible.
  • If you are extending a dependency (adapter, etc.), you should change your extended class to an existing factory function and use configuration to customize the behavior.
  • If you are using generics typings on actions (inside enhancers/runners) or consumers typings, you should check those usages to ensure they match latest typings.

0.6.0-beta.7 (2024-01-28)

Features

  • core: rewrite cache (21b4a03)
  • core: rewrite registry (128be2e)
  • rewrite cache, registry and adapters (c7034d9)
  • rewrite serialization (aadf023)

0.6.0-beta.2 (2024-01-25)

Bug Fixes

  • core: improve model and instance inference (6fa2c17)
  • core: use static type on action hooks property (d448569)

Features

  • core: expose additional typing to public api (6b3b78c)

0.6.0-beta.1 (2024-01-25)

Features

  • core: extract configure/extend method into a dedicated type (3c4c9d3)

BREAKING CHANGES

  • core: Model static methods extend and configure have been moved inside a new extended type. If you wish to use this method on typed variable/parameter, use ExtendableModel instead.

0.6.0-beta.0 (2024-01-21)

Bug Fixes

  • core: model extends use parsed definition instead of raw (62bf3ff)

Features

  • add http prefix to HTTP package errors names (48bda77)
  • add error flags to replace isNotFound adapter method (fda8026)
  • cli: add toDateTime transformer to available transformers (2aed1db)
  • core: change extends methods to extend (2945940)
  • core: change toDate name, add real toDate transformer (b6e4875)
  • core: make extends/configure models return a derivative (38076d6), closes #12
  • rework adapter response and deserializer input data (1852934)
  • rework dependencies configuration (a3c478f)

BREAKING CHANGES

  • You should now rely on isNotFoundError core exported function to check if an error match a "Not Found" error. If you have overwritten the isNotFound adapter method to catch specific errors, you should implement NotFoundErrorI core interface instead on catched errors.
  • http: You should replace import and use of HTTP errors using this new prefix (e.g. change NotFoundError to HttpNotFoundError).
  • Adapter should now return a wrapper object implementing AdapterResponseI. RestDeserializer and JsonApiDeserializer have been updated to take an AdapterResponseI read data instead of an HTTP response object.
  • core: toDate transformer is renamed to toDateTime. toDate is now a new transformer converting to ISO date string (without time).
  • core: Use of models and actions extends calls should be rewritten to the new extend name.

0.5.3 (2023-11-22)

Bug Fixes

  • http: query parameters serialization and http hooks (7bfcb61)

0.5.2 (2023-11-22)

Bug Fixes

  • core: support any serialized type for transformers on id and attr (6153ef9)

0.5.1 (2023-11-22)

Bug Fixes

  • core: reduce typing strictness for hasOne and hasMany (49e2fce)

0.5.0 (2023-11-10)

Bug Fixes

  • core: type cannot be used as a model definition key anymore (945ad0e)
  • core: check for IDs keys in definition even for non prop descriptor (51fa358)

Features

  • cli: add modifiers in make:model and make:composable (af127d2), closes #5
  • core: context dependencies are resolvable using functions (24c4bb0), closes #8
  • core: totally supports polymorphic relations (dec11a7), closes #9

BREAKING CHANGES

  • core: Signature for guessContextModel has changed to support guessing model with a type preference (for polymorphism). hasMany generic type now represent correctly the model's property type (this means that when passing generics, you must pass an array of the type instead of just the type: hasMany<Comment[]>() instead of hasMany<Comment>()). Pending relation method path has been removed because it is implementation specific. You must now path a config object to config method with a path property to define a relation's path.
  • core: consumeAdapter, consumeCache, consumeDeserializer, consumeRegistry and consumeSerializer now return an Awaitable dependency instead of a sync value.

0.4.0 (2023-11-07)

Bug Fixes

  • core: define a dedicated param for models on makeRegistry (26adcfd)
  • core: remove unused model/relation path consumer types (8dcccab)
  • test: add [@internal](https://github.com/internal) to internal classes (72306b0)

Features

  • cli: use new action factory definitions (174aabc)
  • core: add makeActionFactory function (c9e9665)
  • core: add makeCache and makeRegistry (86dea7a)
  • core: do not provide refs cache manager by default (d365726)
  • http: do not provide params serializer by default to http adapter (bd2b681)
  • http: remove makeHttpClient, add makeHttpAdapter (97a042d)
  • jsonapi: remove makeJsonApi, add JSON:API factories functions (6cdc551)
  • rest: add mandatory data reader to rest deserializer (b88833a)
  • rest: remove makeJsonRest, add JSON REST factories functions (87d76fa)
  • test: add new exported members (cabdf1a)

BREAKING CHANGES

  • rest: dataReader is now required to create a RestDeserializer instance. You must provide it inside RestDeserializer config object, or use the makeJsonRestDeserializer factory function (which will use response.json() to read adapter response data).
  • http: paramsSerializer is not provided anymore by default to HttpAdapter. This means you must provide a serializeParams function yourself to the HttpAdapter constructor config or use makeHttpAdapter blueprint factory function.
  • core: weakRefManager is not provided anymore by default to RefsCache. This means you must provide a ref manager yourself to the RefsCache constructor config or use makeCache blueprint factory function.
  • rest: makeJsonRest is not exported anymore from @foscia/rest. You should use makeCache, makeRegistry, makeJsonRestAdapter, makeJsonRestDeserializer and makeJsonRestSerializer combined with makeActionFactory instead.
  • jsonapi: makeJsonApi is not exported anymore from @foscia/jsonapi. You should use makeCache, makeRegistry, makeJsonApiAdapter, makeJsonApiDeserializer and makeJsonApiSerializer combined with makeActionFactory instead.
  • http: makeHttpClient is not exported anymore from @foscia/http. You should use makeHttpAdapter combined with makeActionFactory instead.
  • core: ConsumeModelPath and ConsumeRelationPath are not exported anymore from @foscia/core.

0.3.0 (2023-11-04)

Bug Fixes

  • unify release number on all packages (7d86e39)

0.2.0 (2023-11-04)

Bug Fixes

  • core: remove debug log when map registry cannot resolve model (743fdb4)

Features

  • core: add a path modifier to pending relation definition (edb8fed)
  • object: improve model resolving in object deserializer (79b959b)
  • rest: use a dedicated extended adapter for rest implementation (95cef4e)

0.1.1 (2023-11-03)

Initial release.