Skip to content

feat(core): model assembled property#23

Draft
paul-thebaud wants to merge 33 commits intomainfrom
feat/core/assembled-prop
Draft

feat(core): model assembled property#23
paul-thebaud wants to merge 33 commits intomainfrom
feat/core/assembled-prop

Conversation

@paul-thebaud
Copy link
Contributor

Add an assembled property which use the instance properties to create a new property.
It works with a getter or a setter (or both), and can be memoized using a proxy.
It does not support strict typing for now.

Rework root types, all factories functions (dependencies, properties, etc.),
drop extensions support and document API with appropriate
experimental or internal tags.

BREAKING CHANGE: Root dependencies types have been renamed (such as `Cache` or `RegistryI`).
Builder pattern calls and extensions are removed, you must stop using
them and change your depending types (`Action`, 'ContextEnhancer`, etc.)
to remove extensions.
Dependencies factories signature have been changed, you must use the
new functions.
Add middlewares to action execution.

BREAKING CHANGE: actions hooks now contains action instance instead of the context value.
Previously, instance state after a successful write action would be managed
by both action's hooks and deserializer. With this fix, state will be synced by
hooks only if not already done outside of the hooks (using snapshot comparison).
BREAKING CHANGE: `$model` property have been removed from snapshot,
use `$instance.$model` instead.
BREAKING CHANGE: `requestTransformers`, `responseTransformers` and `errorTransformers`
have been removed from HTTP adapter config and request config.
You should now be using `middlewares`.
BREAKING CHANGE: custom transformer object must now use `makeCustomTransformer`
instead of using an object implementing the `ObjectTransformer` type.
BREAKING CHANGE: `manager` option of `makeRefsCache` has been replaced by
`makeRef`. `makeWeakRefManager` has been replaced by `makeWeakRefFactory`.
BREAKING CHANGE: signature of `Serializer` is fully changed to receive
snapshots instead of instances.
BREAKING CHANGE: `config` chained modifier of relations factories is removed.
You must use the new call signature to provide config objects.
@paul-thebaud paul-thebaud added type:feat New feature status:external Depends on an external fix priority:low May be addressed at any time scope:core @foscia/core labels Feb 8, 2025
@paul-thebaud paul-thebaud self-assigned this Feb 8, 2025
@paul-thebaud paul-thebaud mentioned this pull request Feb 8, 2025
30 tasks
@codecov
Copy link

codecov bot commented Feb 8, 2025

Codecov Report

Attention: Patch coverage is 86.95652% with 3 lines in your changes missing coverage. Please review.

Project coverage is 91.80%. Comparing base (e41220f) to head (daa6a24).

Files with missing lines Patch % Lines
...ackages/core/src/model/props/builders/assembled.ts 86.95% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
- Coverage   91.86%   91.80%   -0.07%     
==========================================
  Files         230      231       +1     
  Lines        1648     1671      +23     
  Branches      510      516       +6     
==========================================
+ Hits         1514     1534      +20     
- Misses        120      121       +1     
- Partials       14       16       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@paul-thebaud
Copy link
Contributor Author

@paul-thebaud
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:low May be addressed at any time scope:core @foscia/core status:external Depends on an external fix type:feat New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant