Giter Site home page Giter Site logo

nezha's Introduction

Nezha

最近刚好在上映《哪吒之魔童降世》,随便取了个名字

实现一个迷你的类React库,用作记录学习React源码时的一些理解

相关知识整理

最后使用该项目通过SSR重构了自己的博客Shymean在线访问地址

Step

# 开发模式
lerna link
npm run dev

# ssr demo演示
npm run dev:ssr
npm run build:ssr

# 打包
npm run build

Feature

  • 虚拟DOM
    • Fiber Reconciler简单实现
    • diff、key
    • SSR
  • 组件
    • 类组件
    • 函数组件
    • 类组件生命周期
    • 路由组件
    • hooks
    • refs
    • Context
  • 状态管理
    • Nax
    • 中间件

TODO

  • router处理hash变化(如id跳转锚点)导致的路由更新
  • 多次setState进行合并,避免同一个组件触发多次更新,大体思路为使用alternate临时保存更新后的newState,并在commit时将其更新到state上
  • hydrateDOM逻辑合并到diffRoot中,尽可能复用现有DOM节点
  • 添加使用文档

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.