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

Update related issues #977

Merged
merged 6 commits into from
May 16, 2018
Merged

Update related issues #977

merged 6 commits into from
May 16, 2018

Conversation

theKashey
Copy link
Collaborator

This PR solves

The main change - SFC are Components yet again - hot-reconciliation is far from a perfect and we have to have smart "self-updatable" components.

PS: This is minor release.

@theKashey theKashey requested a review from gregberge May 15, 2018 10:01
@@ -214,8 +216,13 @@ const mergeInject = (a, b, instance) => {

const transformFlowNode = flow =>
flow.reduce((acc, node) => {
if (isFragmentNode(node) && node.props && node.props.children) {
return [...acc, ...filterNullArray(asArray(node.props.children))]
if (node && isFragmentNode(node)) {
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 a case Fragment inside a div.

@@ -279,6 +286,15 @@ const hotReplacementRender = (instance, stack) => {

// text node
if (typeof child !== 'object' || !stackChild || !stackChild.instance) {
if (stackChild && stackChild.children && stackChild.children.length) {
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 a important moment, we dont log.

@@ -296,11 +312,20 @@ const hotReplacementRender = (instance, stack) => {
return
}

if (typeof child.type !== 'function') {
// React context consumer
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am unsure about this. The value, stored in the type is not "right".
Might be it is better to dive into children on hydrated instance.

child.type[REACT_CONTEXT_CURRENT_VALUE],
),
})
} catch (e) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Might fail. Lets secure it.

@codecov-io
Copy link

codecov-io commented May 15, 2018

Codecov Report

Merging #977 into master will decrease coverage by 0.48%.
The diff coverage is 81.08%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #977      +/-   ##
==========================================
- Coverage   89.21%   88.73%   -0.49%     
==========================================
  Files          30       30              
  Lines         742      772      +30     
  Branches      170      184      +14     
==========================================
+ Hits          662      685      +23     
- Misses         66       72       +6     
- Partials       14       15       +1
Impacted Files Coverage Δ
src/configuration.js 100% <ø> (ø) ⬆️
src/proxy/createClassProxy.js 99.26% <100%> (ø) ⬆️
src/internal/reactUtils.js 90.9% <100%> (+6.29%) ⬆️
src/reconciler/hotReplacementRender.js 87.15% <69.56%> (-2.79%) ⬇️

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 0584e27...56fdd05. Read the comment docs.

@theKashey
Copy link
Collaborator Author

Gonna fix #979 and then merge this one (as long it introduces it)

@theKashey theKashey merged commit 769eb72 into master May 16, 2018
@gregberge gregberge deleted the update-related-issues branch May 17, 2018 09: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.

2 participants