Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: edge deletion behavior cyclic import structure again #93

Merged
merged 2 commits into from
Nov 6, 2020

Conversation

wschurman
Copy link
Member

@wschurman wschurman commented Nov 6, 2020

Why

Apparently #89 wasn't sufficient for all cases. With the way entities are encouraged to be written, it seems that even with one side of this cycle being defined as a function isn't sufficient to squash all import cycles. I think this is a fairly unique case though as it is literally defining a cycle so I still don't think that having the whole companion or configuration be a function is necessary (don't foresee any other future features needing to specify other entities in configurations).

How

Make the other direction edge specification a function as well.

Test Plan

This one is harder to repro using a simple test case. To test this, I yarn link'ed the entity package into Expo code where we're seeing the behavior and ensured it fixed it.

@codecov
Copy link

codecov bot commented Nov 6, 2020

Codecov Report

Merging #93 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #93   +/-   ##
=======================================
  Coverage   94.70%   94.71%           
=======================================
  Files          62       62           
  Lines        1550     1551    +1     
  Branches      166      166           
=======================================
+ Hits         1468     1469    +1     
  Misses         80       80           
  Partials        2        2           
Flag Coverage Δ
integration 94.71% <100.00%> (+<0.01%) ⬆️
unittest 94.71% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/entity/src/EntityFields.ts 100.00% <ø> (ø)
.../src/__integration-tests__/entities/ChildEntity.ts 100.00% <100.00%> (ø)
...src/__integration-tests__/entities/ParentEntity.ts 100.00% <100.00%> (ø)
packages/entity/src/EntityConfiguration.ts 100.00% <100.00%> (ø)
packages/entity/src/EntityMutator.ts 98.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 ead9561...512a2ea. Read the comment docs.

Copy link
Member

@ide ide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little wary of leaving the name as is instead of renaming it to getAssociatedEntityClass since classes are functions in JS so it's easy to get the two mixed up but this looks fine otherwise for the cyclic entity case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants