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

Double proxy registration. Fix regression #912 #915

Merged
merged 1 commit into from
Apr 1, 2018

Conversation

theKashey
Copy link
Collaborator

@theKashey theKashey commented Mar 30, 2018

#912 - Super nasty bug :(, @leandrorlemos - kudos for reporting.

Could break all the things in case of code splitting - something "old" could be "registered" by a new name (it is just a variable name), obtain a new proxy and unmount old instances.

Was fixed in v3. We broke it during migration, and had no tests around it.

@theKashey theKashey requested a review from gregberge March 30, 2018 04:32
const proxy = { get, update }
proxy = { get, update }

proxies.set(InitialComponent, proxy)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is actually a fix. Everything else is related to this change - now tests have "reset" proxies sometimes.

expect(spy).not.toHaveBeenCalled()
RHL.register(App, 'App3', 'test.js')
wrapper.setProps({ children: <App /> })
expect(spy).not.toHaveBeenCalled()
Copy link
Collaborator Author

@theKashey theKashey Mar 30, 2018

Choose a reason for hiding this comment

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

It will stop here. It is still the App, but that App will use ProxyComponent created for App3

@codecov-io
Copy link

Codecov Report

Merging #915 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #915      +/-   ##
=========================================
+ Coverage   87.42%   87.5%   +0.07%     
=========================================
  Files          30      30              
  Lines         636     640       +4     
  Branches      149     149              
=========================================
+ Hits          556     560       +4     
  Misses         64      64              
  Partials       16      16
Impacted Files Coverage Δ
src/proxy/createClassProxy.js 99.06% <100%> (+0.02%) ⬆️
src/reconciler/proxies.js 100% <100%> (ø) ⬆️

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 c420fee...f3a1a68. Read the comment docs.

@gregberge gregberge merged commit f8532df into master Apr 1, 2018
@gregberge gregberge deleted the fix-multiple-proxies branch April 1, 2018 16:50
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