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: Webpack injector #1101

Merged
merged 12 commits into from
Nov 20, 2018
Merged

Feat: Webpack injector #1101

merged 12 commits into from
Nov 20, 2018

Conversation

theKashey
Copy link
Collaborator

@theKashey theKashey commented Nov 11, 2018

This PR is aimed to implement react RFC reactjs/rfcs#74

As long as there is no activity on the original RFC, and there is no way to introduce that comparison to the already published version I am going to....

Use webpack loader to inject necessary changes into the React-Dom

🙌 🙌 🙌 🙌 🙌 🙌

And it's actually working, letting us support any React Feature from the past or the future.

React.lazy

(build-in)It would import lazy automaticaly, providing auto-reloading of the changed chunks.

React.memo

(requires patch) Now it could deep-force-update even memo-ed components, working with fiber directly. (landing additional prop on memoizedProps to bypass shallow equal)

React.forwardRef

(requires patch) Now it could update components, working with fiber directly

Hooks

(requires patch) Could work with hooks with pureSFC enabled, or ignoreSFC activated

@codecov-io
Copy link

codecov-io commented Nov 11, 2018

Codecov Report

Merging #1101 into master will decrease coverage by 1.11%.
The diff coverage is 69.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1101      +/-   ##
==========================================
- Coverage   86.56%   85.44%   -1.12%     
==========================================
  Files          32       33       +1     
  Lines         945     1010      +65     
  Branches      231      254      +23     
==========================================
+ Hits          818      863      +45     
- Misses        106      117      +11     
- Partials       21       30       +9
Impacted Files Coverage Δ
src/configuration.js 100% <ø> (ø) ⬆️
src/reconciler/proxies.js 100% <100%> (ø) ⬆️
src/proxy/createClassProxy.js 97.45% <100%> (+0.1%) ⬆️
src/utils.dev.js 92.3% <100%> (+1.39%) ⬆️
src/internal/stack/hydrateFiberStack.js 93.33% <100%> (+0.47%) ⬆️
src/reconciler/index.js 100% <100%> (ø) ⬆️
src/utils.prod.js 100% <100%> (ø) ⬆️
src/reactHotLoader.js 60.55% <31.25%> (-18.03%) ⬇️
src/reconciler/hotReplacementRender.js 86.95% <53.84%> (+3.3%) ⬆️
src/AppContainer.dev.js 80.95% <66.66%> (-2.39%) ⬇️
... and 4 more

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 9024559...7c0f9a0. Read the comment docs.

@gregberge
Copy link
Collaborator

It is AWESOME, I like the idea to monkey patch React 👌

@theKashey theKashey merged commit 40c85a9 into master Nov 20, 2018
@Bnaya
Copy link
Contributor

Bnaya commented Nov 21, 2018

Dose both babel plugin and webpack loader are required for it to work?
Or just the loader?

@theKashey
Copy link
Collaborator Author

  • babel is required to update class-component methods
  • webpack is required to support memo, and ignoreSFC mode, which will enable hooks.

@theKashey
Copy link
Collaborator Author

Lets discuss all the problems in #1088

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.

4 participants