-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(shared): resolve circular dependencies #1150
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(shared): resolve circular dependencies #1150
Conversation
Do you have a git repo that reproduces the error in #1078, so I can clone it and test this fix? |
Hey @aleclarson 👋 Prepared a demo ;-) https://github.com/khmm12/react-spring-circular-dependencies-issue Reproducible on production bundle. |
6e11e33
to
d35fb1c
Compare
Did rebase the branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to PR the exact same change. Rubber stamp lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 @khmm12 Can we get another quick rebase for this PR for @aleclarson to merge it?
`shared/helpers` wants entire `shared/globals` inside `isAnimatedString`, `shared/globals` wants `noop` from `shared/helper` to assign exported variable `willAdvance`. If `shared/helpers` is executed before `shared/globals`, `willAdvance` is initialized by given value. Otherwise `willAdvance` is initialized after `noop` inside `shared/helpers` and has no defined value. The safest way is keep `shared/helpers` pure and move `isAnimatedString` to own module.
d35fb1c
to
bcf5e2f
Compare
@louisgv Ready ;-) |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry its taken so long, but thank you for this fix.
shared/helpers
wants entireshared/globals
insideisAnimatedString
,shared/globals
wantsnoop
fromshared/helper
to assign exported variablewillAdvance
.If
shared/helpers
is executed beforeshared/globals
,willAdvance
is initialized by given value. OtherwisewillAdvance
is initialized afternoop
insideshared/helpers
and has no defined value.The safest way is keep
shared/helpers
pure and moveisAnimatedString
to own module.It fixes #1078