entity
entity copied to clipboard
feat: transaction-scoped dataloaders
Why
An interesting idea from @ide: within a transaction, subsequent reads should be able to be cached locally as long as the local cache is kept consistent (not in the cache adapter though).
How
Keep a separate dataloader per-transaction that is invalidated synchronously.
Test Plan
Not tested yet.
Codecov Report
Merging #98 (6222f0f) into master (e3b2b23) will increase coverage by
0.03%
. The diff coverage is97.50%
.
@@ Coverage Diff @@
## master #98 +/- ##
==========================================
+ Coverage 94.75% 94.79% +0.03%
==========================================
Files 62 62
Lines 1564 1595 +31
Branches 171 191 +20
==========================================
+ Hits 1482 1512 +30
- Misses 80 81 +1
Partials 2 2
Flag | Coverage Δ | |
---|---|---|
integration | 94.79% <97.50%> (+0.03%) |
:arrow_up: |
unittest | 94.79% <97.50%> (+0.03%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
packages/entity/src/internal/EntityDataManager.ts | 98.73% <96.77%> (-1.27%) |
:arrow_down: |
packages/entity/src/EntityLoader.ts | 88.00% <100.00%> (+0.32%) |
:arrow_up: |
packages/entity/src/EntityMutator.ts | 98.03% <100.00%> (+0.03%) |
:arrow_up: |
packages/entity/src/EntityQueryContext.ts | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update e3b2b23...6222f0f. Read the comment docs.
Abandoning for now. While this would be a small perf increase, ~98% of loads in the EAS use case are non-transactional so it would be minimal.