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

Add preact as react alias. #94

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lasseborly
Copy link
Contributor

@lasseborly lasseborly commented Apr 4, 2020

https://preactjs.com/guide/v10/differences-to-react

This reduces the bundle.js size from 267kB -> 157kB. ~42% decrease.

On the surface we are still just writing react but the smaller size makes Preact desirable. As of this PR we are opting for using Preact for development as well to minimize compatibility issues when it comes to production but it is more than possible to only make use of Preact in production.

The main downside is the incoherencies we will encounter along the way.
But it's a big chunk to cut off and might be worth the hassle.

This reduces the bundle.js size from 267kB -> 157kB due to the smaller DOM implementation.
@lasseborly
Copy link
Contributor Author

Does fail one test which is a good indicator of what is to come.

This is not necessary when using react and not preact. Hard to explain. Maybe the initializing speed factor of one or the other.
@codecov
Copy link

codecov bot commented Apr 5, 2020

Codecov Report

Merging #94 into master will decrease coverage by 0.30%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
- Coverage   81.72%   81.41%   -0.31%     
==========================================
  Files          47       47              
  Lines         651      651              
  Branches      155      155              
==========================================
- Hits          532      530       -2     
- Misses        108      110       +2     
  Partials       11       11              
Impacted Files Coverage Δ
src/components/cover/cover.jsx 83.33% <0.00%> (-6.67%) ⬇️

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 b9ee0d5...f26e320. Read the comment docs.

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.

1 participant