Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
3bcd560
opti: Spin模块 loading动态加载bug修复
Sep 27, 2017
a98c364
opti: 修改.gitignore
Sep 28, 2017
b6009fd
修复 clearRefsAndMounts BUG
RubyLouvre Sep 28, 2017
e7314a3
重命名内部方法
RubyLouvre Sep 28, 2017
859338d
Merge pull request #59 from nichelove/wangliang
RubyLouvre Sep 28, 2017
394a0dd
remove pr
RubyLouvre Sep 28, 2017
d076f44
更新同步到其他目录的脚本,去掉不用的变量
RubyLouvre Sep 28, 2017
3788fb6
分离出任务调度模块
RubyLouvre Sep 28, 2017
6f60193
支持module-pattern component
RubyLouvre Sep 28, 2017
373a855
调整组件放入更新列队的顺序
RubyLouvre Sep 28, 2017
018b965
修改变量名
RubyLouvre Sep 28, 2017
096b876
添加对相同引用对象的更新检测策略
RubyLouvre Sep 29, 2017
103adc0
提取出instantiateComponent模块与强化renderComponent方法
RubyLouvre Sep 29, 2017
95dce9a
修正 updateByContext BUG
RubyLouvre Sep 29, 2017
f502cd6
同步ref函数,放宽shouldComponentUpdate的限制
RubyLouvre Sep 30, 2017
51fb606
props, context是不可变的
RubyLouvre Sep 30, 2017
30f519c
更新 shallowCompare.js
RubyLouvre Sep 30, 2017
ab2c89d
add context test
roland-reed Sep 30, 2017
b5bf270
add createClass test
roland-reed Sep 30, 2017
0f5e7df
update
RubyLouvre Sep 30, 2017
47abba4
Merge pull request #61 from roland-reed/master
RubyLouvre Sep 30, 2017
be712d0
调整state放入instance 的时机
RubyLouvre Sep 30, 2017
52d05c5
更新测试
RubyLouvre Sep 30, 2017
6cc8d50
feat: 添加anu case
Sep 30, 2017
69ed442
调整刷新state的时机
RubyLouvre Sep 30, 2017
a9bd18c
修正 忽略更新时,组件的虚拟DOM的回滚机制
RubyLouvre Oct 1, 2017
cf8dfbe
1.1.2
RubyLouvre Oct 1, 2017
2c354d7
更新version
RubyLouvre Oct 1, 2017
1abebcd
更新版本
RubyLouvre Oct 1, 2017
e820480
使用一个updater对象封装所有内部变量
RubyLouvre Oct 1, 2017
d345240
转移注释
RubyLouvre Oct 1, 2017
98921b3
remove comment
RubyLouvre Oct 1, 2017
854bdc3
分割实例间的关联
RubyLouvre Oct 1, 2017
e175ef2
fix cloneElement BUG
RubyLouvre Oct 3, 2017
949522a
添加测试
RubyLouvre Oct 3, 2017
1008a18
简化列队机制
RubyLouvre Oct 3, 2017
8c445b2
React.Children.forEach不是会处理null, void 0
RubyLouvre Oct 5, 2017
2ac92b4
简化diffChildren方法
RubyLouvre Oct 6, 2017
d252828
简化updateElement方法
RubyLouvre Oct 6, 2017
9625705
抽象ref的操作
RubyLouvre Oct 6, 2017
4fbee53
添加ReceiveComponent检测机制,如果context,props一样,那么就不会执行receive, render, upda…
RubyLouvre Oct 7, 2017
3e044eb
合并,解决冲突
Oct 8, 2017
94e1b92
抽象出Refs模块
RubyLouvre Oct 8, 2017
090eec7
简化 drainQueue的逻辑
RubyLouvre Oct 8, 2017
d222515
去掉无用的注释
RubyLouvre Oct 8, 2017
e321dc7
修改更新日志,准备升级到1.1.3
RubyLouvre Oct 8, 2017
f5abff0
1.1.3
RubyLouvre Oct 8, 2017
9e41442
更新到1.1.3
RubyLouvre Oct 8, 2017
671db9f
Merge branch 'master' of https://github.com/RubyLouvre/anu into wangl…
Oct 9, 2017
7d21393
fix: mountElement updateElement
Oct 9, 2017
838d869
fix issue of _hostNode is null
roland-reed Oct 9, 2017
c4edbad
Merge pull request #65 from roland-reed/master
RubyLouvre Oct 9, 2017
130c4ff
添加React16的createPortal
RubyLouvre Oct 10, 2017
b22133e
Merge branch 'master' of https://github.com/RubyLouvre/anu
RubyLouvre Oct 10, 2017
57bfc14
添加React16的createPortal
RubyLouvre Oct 10, 2017
57a1dee
fix: diffChildren 修改
Oct 10, 2017
4b6e076
Merge branch 'master' of https://github.com/RubyLouvre/anu into wangl…
Oct 10, 2017
c1f56e8
编译dist文件
Oct 10, 2017
4659ec2
支持React16的ReactDOM.createPortal
RubyLouvre Oct 10, 2017
3a89a54
合并代码, 解决冲突
Oct 10, 2017
d658ce5
去掉updater.lastVnode
RubyLouvre Oct 10, 2017
0e19707
diff.js 格式化
Oct 10, 2017
b16e6ae
Merge branch 'master' of https://github.com/RubyLouvre/anu into wangl…
Oct 10, 2017
1cf6734
Merge pull request #67 from nichelove/wangliang
RubyLouvre Oct 10, 2017
d813b4c
opti: 优化diff.js的updateElemen方法
Oct 11, 2017
3a63a7e
Merge branch 'master' of https://github.com/RubyLouvre/anu into wangl…
Oct 11, 2017
c426556
fix: 修改diff.js的diffChildren方法
Oct 11, 2017
a72928a
优化代码
Oct 11, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
/node_modules/*
/md/*
/coverage/
package-lock.json
package-lock.json
node_modules/
108 changes: 108 additions & 0 deletions ReactChildReconciler-test.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
import React from "dist/React";
import getTestDocument from "./getTestDocument";
import ReactTestUtils from "lib/ReactTestUtils";

import ReactDOMServer from "dist/ReactDOMServer";
// https://github.com/facebook/react/blob/master/src/renderers/__tests__/ReactChildReconciler-test.js
var ReactDOM = window.ReactDOM || React;

describe("ReactChildReconciler", function() {
this.timeout(200000);


function normalizeCodeLocInfo(str) {
return str && str.replace(/\(at .+?:\d+\)/g, '(at **)');
}

function createIterable(array) {
return {
'@@iterator': function() {
var i = 0;
return {
next() {
const next = {
value: i < array.length ? array[i] : undefined,
done: i === array.length,
};
i++;
return next;
},
};
},
};
}

it('warns for duplicated array keys', () => {
spyOn(console, 'error');

class Component extends React.Component {
render() {
return <div>{[<div key="1" />, <div key="1" />]}</div>;
}
}

ReactTestUtils.renderIntoDocument(<Component />);
});

it('warns for duplicated array keys with component stack info', () => {
spyOn(console, 'error');

class Component extends React.Component {
render() {
return <div>{[<div key="1" />, <div key="1" />]}</div>;
}
}

class Parent extends React.Component {
render() {
return React.cloneElement(this.props.child);
}
}

class GrandParent extends React.Component {
render() {
return <Parent child={<Component />} />;
}
}

ReactTestUtils.renderIntoDocument(<GrandParent />);
});

it('warns for duplicated iterable keys', () => {
spyOn(console, 'error');

class Component extends React.Component {
render() {
return <div>{createIterable([<div key="1" />, <div key="1" />])}</div>;
}
}

ReactTestUtils.renderIntoDocument(<Component />);
});

it('warns for duplicated iterable keys with component stack info', () => {
spyOn(console, 'error');

class Component extends React.Component {
render() {
return <div>{createIterable([<div key="1" />, <div key="1" />])}</div>;
}
}

class Parent extends React.Component {
render() {
return React.cloneElement(this.props.child);
}
}

class GrandParent extends React.Component {
render() {
return <Parent child={<Component />} />;
}
}

ReactTestUtils.renderIntoDocument(<GrandParent />);
});


});
6 changes: 3 additions & 3 deletions build/shim.script.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ var text2 = str2
.replace(/\/\/freeze_start([\s\S]+?)freeze_end/, "");

fs.writeFileSync(dir2, text2, { encoding: "utf8" });
//fs.writeFileSync( path.join(__dirname, "../../draft/node_modules/anujs/dist/React.js"), text2, { encoding: "utf8" });
fs.writeFileSync( path.join(__dirname, "../../antd-test/node_modules/anujs/dist/React.js"), text2, { encoding: "utf8" });
//fs.writeFileSync( path.join(__dirname, "../../animate/node_modules/anujs/dist/React.js"), text2, { encoding: "utf8" });
//fs.writeFileSync( path.join(__dirname, "../../antd-test/node_modules/anujs/dist/React.js"), text2, { encoding: "utf8" });

//fs.writeFileSync( path.join(__dirname, "../../yo-demo/node_modules/anujs/dist/React.js"), text2, { encoding: "utf8" });
//fs.writeFileSync( path.join(__dirname, "../../yo-router/node_modules/anujs/dist/React.js"), text2, { encoding: "utf8" });
Expand All @@ -43,7 +43,7 @@ var text4 = str4
.replace(/\/\/freeze_start([\s\S]+?)freeze_end/, "");

fs.writeFileSync(dir4, text4, { encoding: "utf8" });
//fs.writeFileSync( path.join(__dirname, "../../antd-test/node_modules/anujs/dist/ReactSelection.js"), text2, { encoding: "utf8" });
// fs.writeFileSync( path.join(__dirname, "../../antd-test/node_modules/anujs/dist/ReactSelection.js"), text2, { encoding: "utf8" });

console.log("对ReactSelection瘦身完毕"); // eslint-disable-line

59 changes: 59 additions & 0 deletions build/sync.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
const fs = require("fs-extra");
const path = require("path");
const ora = require("ora");

const anuPath = path.join(__dirname, "../");
const qreactPath = path.join(__dirname, "../../qreact");
const dirs = ["build", "lib", "src", "ssr"];
const spinner = ora("开始同步").start();

function empty(dir) {
return new Promise((resolve, reject) => {
fs.emptyDir(path.join(qreactPath, dir), err => {
if (err) {
reject(err);
} else {
resolve();
}
});
});
}

function copy(dir) {
return new Promise((resolve, reject) => {
fs.copy(path.join(anuPath, dir), path.join(qreactPath, dir), err => {
if (err) {
reject(err);
} else {
resolve();
}
});
});
}

function emptyDirs(dirs) {
return Promise.all(dirs.map(dir => empty(dir)));
}

function copyDirs(dirs) {
return Promise.all(dirs.map(dir => copy(dir)));
}

function start() {
const emptyPromise = emptyDirs(dirs);
emptyPromise
.then(() => {
spinner.succeed("已清除 QReact 下目录");
return copyDirs(dirs);
})
.then(() => {
spinner.succeed("已复制 anujs 至 QReact");
})

.catch(e => {
console.error(e); // eslint-disable-line
spinner.fail("同步失败");
});
}

start();
Loading