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

feat: React16.6 compatibility #1084

Merged
merged 8 commits into from
Nov 10, 2018
Merged

feat: React16.6 compatibility #1084

merged 8 commits into from
Nov 10, 2018

Conversation

theKashey
Copy link
Collaborator

@theKashey theKashey commented Oct 25, 2018

fixing

  • React.memo is invisible to RHL
  • React.memo does not support "indeterminate components" (RHL uses them for every SFC)
  • React.lazy could be autoimported on variable re-registration.
  • React.forwardProps (including styled-components)

@@ -16,7 +16,15 @@ import logger from './logger'

import { preactAdapter } from './adapters/preact'

function resolveType(type) {
const forceSimpleSFC = { proxy: { allowSFC: false } }
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

React.memo could "eat" only simple class or functional component.
The current approach, with "indeterminate" components is breaking the stuff.

registerComponent(type)
}
if (isMemoType({ type })) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Probably the same magic is needed for Context

@codecov-io
Copy link

codecov-io commented Nov 8, 2018

Codecov Report

Merging #1084 into master will decrease coverage by 0.73%.
The diff coverage is 77.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1084      +/-   ##
==========================================
- Coverage   87.09%   86.35%   -0.74%     
==========================================
  Files          32       32              
  Lines         891      938      +47     
  Branches      213      229      +16     
==========================================
+ Hits          776      810      +34     
- Misses         95      107      +12     
- Partials       20       21       +1
Impacted Files Coverage Δ
src/internal/reactUtils.js 94.28% <100%> (+1.97%) ⬆️
src/proxy/createClassProxy.js 97.35% <100%> (+0.01%) ⬆️
src/reconciler/proxies.js 100% <100%> (ø) ⬆️
src/reactHotLoader.js 76.11% <57.69%> (-12.26%) ⬇️
src/reconciler/hotReplacementRender.js 83.33% <77.58%> (-0.09%) ⬇️
src/internal/stack/hydrateFiberStack.js 92.85% <0%> (-7.15%) ⬇️

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 57eaf30...f0b91e3. Read the comment docs.

@theKashey theKashey merged commit 7cd334d into master Nov 10, 2018
@theKashey theKashey deleted the react-16-6 branch November 10, 2018 10:46
String(type).indexOf('useEffect') > 0) &&
cold(type),
})
```

Choose a reason for hiding this comment

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

This code snippet and the one above are identical. Is this expected or that was supposed to be something else?

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 something unfinished. Idea was to provide yet-another-api, to specify special flags, component should be created with.
The current approach to "fix" hooks with setConfig({pureSFC: true}) is breaking Relay-modern.

I also could not put this logic inside, as long I could not cast every component to a string - emotion throws an Error and should be fixed first.

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