Skip to content

feat(core): model assembled property#23

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

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

Conversation

@paul-thebaud
Copy link
Copy Markdown
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
Copy Markdown

codecov Bot commented Feb 8, 2025

Codecov Report

❌ Patch coverage is 91.31783% with 56 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.80%. Comparing base (726f5e3) to head (daa6a24).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...model/relations/utilities/attachRelationInverse.ts 52.38% 9 Missing and 1 partial ⚠️
...kages/core/src/model/revivers/makeModelsReviver.ts 88.37% 5 Missing ⚠️
...e/src/model/props/builders/makeValuePropFactory.ts 88.23% 4 Missing ⚠️
...ckages/core/src/model/snapshots/restoreSnapshot.ts 69.23% 3 Missing and 1 partial ⚠️
packages/http/src/makeHttpAdapter.ts 88.23% 2 Missing and 2 partials ⚠️
packages/core/src/actions/makeActionFactory.ts 94.54% 3 Missing ⚠️
...ackages/core/src/model/props/builders/assembled.ts 86.95% 1 Missing and 2 partials ⚠️
...kages/core/src/model/revivers/makeModelsReducer.ts 90.62% 3 Missing ⚠️
packages/core/src/model/props/builders/relation.ts 80.00% 2 Missing ⚠️
...s/core/src/model/relations/makeQueryModelLoader.ts 91.66% 1 Missing and 1 partial ⚠️
... and 14 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
+ Coverage   91.69%   91.80%   +0.10%     
==========================================
  Files         218      231      +13     
  Lines        1578     1671      +93     
  Branches      444      516      +72     
==========================================
+ Hits         1447     1534      +87     
- Misses        117      121       +4     
- Partials       14       16       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@paul-thebaud
Copy link
Copy Markdown
Contributor Author

@paul-thebaud
Copy link
Copy Markdown
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