Giter Club home page Giter Club logo

h's Introduction

@ilogico/h

Pet project for a Reactish API. It's not nearly production ready or feature complete and will probably never will. The purpose is to educate myself more than anything else.

What seems to work (it's not thoroughly tested yet :)

  • functional components (no Component, no PureComponent)
  • context API (only Context.Provider, no Context.Consumer)
  • hooks: useState, useMemo, useEffect, useLayoutEffect, useContext, useRef and useImperativeHandle

What's missing

  • better typings
  • keys (only the order and types of elements matter)
  • better handling of host (HTML) components (currently all props are assigned to the DOM element, requires onclick for event handlers, for eg.)
  • handling of SVG elements
  • decent support for custom elements

Fun facts

useEffect vs useLayoutEffect

  • to see the difference between the two, we need to use an alert in the effect and use Chromium
  • Firefox always repaint
  • if we use a break point, the browser both Chromium and Firefox repaing
  • Promise.resolve().then is not enough for Chromium to repaint, we must use requestAnimationFrame

useLayoutEffect vs setting state during render

  • React does not appear to commit the changes to the DOM when setting state during render
  • but my implementation does, it treats them the same way as if they were done during useLayouEffect

Doubts

  • should refs be setup during render (current implementation) or during the layout effects phase?

h's People

Contributors

ilogico avatar

Stargazers

Filipe Oliveira avatar João Cunha avatar

Watchers

James Cloos avatar Filipe Oliveira avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.