Skip to content

Releases: YMFE/qreact

[email protected]

23 Jan 05:45
23e039f
Compare
Choose a tag to compare
  • 全面支持 React v16 新特性
  • 重构 findDOMNode ,遇到注释节点返回 null
  • 支持 React 组件返回任何数据类型,如数组,字符串,数字,布尔,但对于 undefined, null, boolean 不会生成真实 DOM
  • 支持 componentDidCatch 钩子与整个错误边界的逻辑
  • 支持 createPortal
  • 分离出 Vndoe 模块,并且附带其节点关系属性(return, sibling, child),
    • return 相当于之前的 hostParent,
    • sibling 相当于之前的 nextSibling,
    • child 相当于之前的 firstChild
  • 模仿 React v16,使用 stateNode 属性代替旧有的 hostNodeinstance
  • React.ChildrenflattenChildren 底层依赖的方法由 flattenChildren 改为 operateChildren,让其更具通用性, flattenChildren 更名为 fiberizeChildren,产出一个带链表结构的数组。
  • 新的架构:元素虚拟 DOM 与组件虚拟 DOM 都有自己的更新对象,简化匹配算法
  • 简化 Refs 模块
  • 修复更新虚拟 DOM 时,namespaceURI 丢失的 BUG
  • componentDidUpdate 现在只有两个参数,lastPropslastState
  • 优化 fiberizeChildren 的性能
  • 修复受控组件在 textarea, radio 的 BUG,将受控事件放到用户 � 事件后集中执行
  • 添加焦点系统的支持(全局 focus, blur 事件提前监听,移除添加节点的 Refs.nodeOperate 开头)
  • 解决多次引入 React 时,事件系统的 option.async 有问题的 BUG
  • 简化 createPortal 的实现
  • 支持 React v16.2 的 Fragment 语法糖
  • cloneElement 需要处理 disposed 元素
  • cloneElement 对于 props 的虚拟 DOM 进行复制
  • 设置属性的时机提前
  • 修复了一个移动端 scroll 事件的问题

[email protected]

23 Jan 05:39
45fc379
Compare
Choose a tag to compare
  • 修复了一个移动端 scroll 事件的问题

[email protected]

12 Jan 10:19
8d77b32
Compare
Choose a tag to compare
  • 修复了一个移动端 click 事件不触发的问题

[email protected]

08 Dec 04:36
v1.1.6
Compare
Choose a tag to compare
  • 修复了一个在 diffChildren 过程中没有 updater 的问题。
  • 修复了一个 SVG 属性赋值的问题,这个问题曾导致值为数字 0 的属性被错误的赋值为空字符串。
  • 修复了一个在 componentDidMountcomponentDidUpdate 中调用 setState() 时重复渲染的问题。
  • Server Side Render 中增加 componentWillMount 生命周期钩子。
  • 移除 Server Side Render 中的 data-react-checksumdata-reactroot 属性。
  • Server Side Render 支持 renderToNodeStream()renderToStaticNodeStream()
  • 改善事件回调错误捕捉,现在错误信息会提供 QReact 报错的位置。
  • 修复一个 diffProps() 函数的错误,这个错误曾经导致 props 没有更新。
  • 修复一个 QReact 在 SSR 中的错误,QReact 中使用 XMLHTTPRequest 对象来判断浏览器版本,而在 node.js 中没有这个对象导致出错。
  • 修改了 ReactDOMServer.js 的打包脚本,将 babelHelpers 包含在打包文件中,以便支持低版本 node.js。
  • 在根目录增加了 server.js,以便支持 react-dom/server 的引用。

[email protected]

21 Nov 03:37
Compare
Choose a tag to compare
  • 修复组件返回 Immutable.js 实例时无法正确渲染的问题
  • 修复 SVG 命名空间丢失的问题
  • 增加组件事件回调函数中的错误捕捉

[email protected]

21 Nov 03:34
Compare
Choose a tag to compare
  • 增加一个专门给 IE 使用的 ReduxIE,使用 qreact/lib/ReduxIE 引入
  • 修改 property 方法,仅部分属性通过赋值空字符串来删除
  • 其他一些性能优化

[email protected]

19 Oct 04:01
Compare
Choose a tag to compare
  • 抽象出一个 Updater 类,用于封装组件实例上的所有私有数据
  • 抽象出一个 instantiateComponente 用于同时实例化有状态与无状态组件,从此再没有 mountStateless, updateStateless 方法
  • 修正 checkbox 点一下会触发两次 onChange 的 BUG
  • 添加 ReceiveComponent 检测机制,如果 context, props 一样,那么就不会执行 receive, render, update 等钩子
  • 修改检测空对象的逻辑
  • 简化任务调度系统的逻辑
  • 添加 userRef 来优化 ref 在 cloneElement 中的创建及 detachRef 的比较,修正 flushUpdatersupdater 对象的泄露问题(需要 clearArray 一下)
  • 优化 diffChildren 的逻辑,防止出现 parentNode 等于 null 的情况(比如为文本节点取 firstChild
  • 简化 ControlledComponentdispose 模块

[email protected]

21 Sep 09:08
Compare
Choose a tag to compare
  • 修正 onChange 事件
  • 重构 diffProps 模块的实现
  • 支持组件的isMounted方法
  • 添加beforeRender, beforePatch, afterPatch钩子
  • 添加lib/ReactInputSelection.js

[email protected]

21 Sep 02:37
Compare
Choose a tag to compare
  • 修正 onChange 事件
  • 重构 diffProps 模块的实现
  • 支持组件的 isMounted 方法
  • 重构虚拟 DOM 树的实现,与官方 React 保持一致,即 props.children 现在是多种形态,延迟到 diff 时才创建用于比较的 vchildren
  • 修正 ref 机制,如果为字符串时,通过 createStringRef 方法将当前 ref,owner 传入,返回一个 curry 方法,在 cloneElementcreateStringRef 创建的方法会再被整合到新 ref 方法的内部,确保旧的 owner 再次被更新
  • 修正 getNs 方法的实现(原先是使用 hash 表进行穷举,但 svg 文档也有 a, script ,style 元素,导致无法区分)
  • 用户在 componentDidUpdate 使用 setState 是不当操作,导致进入死循环,改用定时器减缓调用频率,防止页面卡死(官方 React 也存在类似的机制)

[email protected]

21 Sep 02:38
Compare
Choose a tag to compare
  • 简化 createClass
  • 修正 flattenHooks BUG:如果 hooks 中只有一个函数,就不用再包一层
  • createElement 里不对 children 进行处理,延迟到 diff 时才创建用于比较的 vchildren
  • 修正 disposeElement BUG:如果存在 dangerouslySetInnerHTML 的情况,需要清空元素内部,不走遍历子虚拟 DOM 的分支
  • 修正 diffProps, SVG 元素是区分大小写 如 viewBox preserveAspectRation
  • 组件更新时,要检测 context 是否改变
  • 增加事件对象的 persist 方法
  • 修正 unstable_renderSubtreeIntoContainer 的回调 this 指向问题
  • 修正 unmountComponentAtNode BUG:#text 改为 #comment
  • 修正 cloneElement BUG
  • ref 改为在 createElement 里进行处理