npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

lleact

v0.0.1

Published

lleact is a toy implementation of React. It is a learning project to understand how React works.

Downloads

3

Readme

lleact

lleact is a toy implementation of React. It is a learning project to understand how React works.

Structure

Scheduler

The scheduler is responsible for scheduling work on the main thread. It uses the browser's micro task or macro task API to schedule work in chunks. Corresponds to react scheduler.

Reconciler

The reconciler implementation render phase and commit, that is responsible for:

  • create and diffing the virtual DOM tree with the previous one.
  • call lifecycle methods and hooks.
  • create and update the real Host Instance tree.
  • which is platform/Host independent.
  • which use Scheduler to schedule work in chunks.

Corresponds to react-reconciler.

Renderer

Renderers manage how a React tree turns into the underlying platform calls.

Html DOM Host Renderer, which implements the Host Config interface, that create and update real DOM tree. Corresponds to react-dom

lleact Core

By react.js docs:

core only includes the APIs necessary to define components.

  • [x] React.createElement()
  • [ ] React.Component
  • [ ] React.Children
  • [ ] etc

TODO: difference With React

a、In lleact, we are walking the whole tree during the render phase. React instead follows some hints and heuristics to skip entire sub-trees where nothing changed.

b、We are also walking the whole tree in the commit phase. React keeps a linked list with just the fibers that have effects and only visit those fibers.

c、~~Every time we build a new work in progress tree, we create new objects for each fiber. React recycles the fibers from the previous trees.~~

d、~~When lleact receives a new update during the render phase, it throws away the work in progress tree and starts again from the root. React tags each update with an expiration timestamp and uses it to decide which update has a higher priority.~~

And many more…

TODO: features

  • [x] use an object for the style prop
  • [x] flatten children arrays
  • [x] reconciliation by key
  • [x] Scheduler Priority base and isInputPending check

Restruct Monorepo

  • [ ] monorepo restruct

References

TODO

  • [ ] add test
  • [ ] publish
  • [ ] changeset
  • [ ] demo
  • [ ] monorepo 背景、解决的痛点、方案对比、优势、实现