Skip to content

Commit 513e259

Browse files
committed
fix: bug fix for IE8
1 parent 00c239a commit 513e259

25 files changed

+942
-1041
lines changed

Diff for: build/rollup.ie.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import replace from "rollup-plugin-re";
33
import filesize from "rollup-plugin-filesize";
44
import cleanup from "rollup-plugin-cleanup";
55
import strip from "rollup-plugin-strip";
6+
import license from "rollup-plugin-license";
67

7-
const license = require("rollup-plugin-license");
88
const json = require("../package.json");
99

1010
export default {
@@ -14,8 +14,6 @@ export default {
1414
dest: "./dist/ReactIE.js",
1515
plugins: [
1616
babel({
17-
// plugins: ['external-helpers'],
18-
// externalHelpers: true,
1917
babelrc: false,
2018
presets: [
2119
[
@@ -26,11 +24,8 @@ export default {
2624
]
2725
]
2826
}),
29-
3027
license({
31-
banner: `IE6+,有问题请加QQ 370262116 by 司徒正美 Copyright ${JSON.stringify(
32-
new Date()
33-
).replace(/T.*|"/g, "")}`
28+
banner: "Powered by YMFE (https://ymfe.org)"
3429
}),
3530
cleanup(),
3631
replace({

Diff for: build/rollup.js

+2-12
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import replace from "rollup-plugin-re";
33
import filesize from "rollup-plugin-filesize";
44
import cleanup from "rollup-plugin-cleanup";
55
import strip from "rollup-plugin-strip";
6+
import license from "rollup-plugin-license";
67

7-
const license = require("rollup-plugin-license");
88
const json = require("../package.json");
99

1010
export default {
@@ -14,8 +14,6 @@ export default {
1414
dest: "./dist/React.js",
1515
plugins: [
1616
babel({
17-
// plugins: ['external-helpers'],
18-
// externalHelpers: true,
1917
babelrc: false,
2018
presets: [
2119
[
@@ -26,22 +24,14 @@ export default {
2624
]
2725
]
2826
}),
29-
3027
license({
31-
banner: `by 司徒正美 Copyright ${JSON.stringify(new Date()).replace(
32-
/T.*|"/g,
33-
""
34-
)}
35-
IE9+
36-
`
28+
banner: "Powered by YMFE (https://ymfe.org)"
3729
}),
3830
cleanup(),
3931
replace({
40-
// ... do replace before commonjs
4132
patterns: [
4233
{
4334
test: "VERSION",
44-
// string or function to replaced with
4535
replace: json.version
4636
}
4737
]

Diff for: build/rollup.selection.js

+3-11
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@ import replace from "rollup-plugin-re";
33
import filesize from "rollup-plugin-filesize";
44
import cleanup from "rollup-plugin-cleanup";
55
import strip from "rollup-plugin-strip";
6+
import license from "rollup-plugin-license";
67

7-
const license = require("rollup-plugin-license");
88
const json = require("../package.json");
9+
910
export default {
1011
entry: "./build/ReactSelection.js",
1112
format: "umd",
1213
exports: "default",
1314
dest: "./dist/ReactSelection.js",
1415
plugins: [
1516
babel({
16-
// plugins: ['external-helpers'],
17-
// externalHelpers: true,
1817
babelrc: false,
1918
presets: [
2019
[
@@ -25,21 +24,14 @@ export default {
2524
]
2625
]
2726
}),
28-
2927
license({
30-
banner: `此版本带有selection by 司徒正美 Copyright ${JSON.stringify(
31-
new Date()
32-
).replace(/T.*|"/g, "")}
33-
IE9+
34-
`
28+
banner: "Powered by YMFE (https://ymfe.org)"
3529
}),
3630
cleanup(),
3731
replace({
38-
// ... do replace before commonjs
3932
patterns: [
4033
{
4134
test: "VERSION",
42-
// string or function to replaced with
4335
replace: json.version
4436
}
4537
]

Diff for: build/rollup.shim.js

+2-10
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import replace from "rollup-plugin-re";
33
import filesize from "rollup-plugin-filesize";
44
import cleanup from "rollup-plugin-cleanup";
55
import strip from "rollup-plugin-strip";
6+
import license from "rollup-plugin-license";
67

7-
const license = require("rollup-plugin-license");
88
const json = require("../package.json");
99

1010
export default {
@@ -14,8 +14,6 @@ export default {
1414
dest: "./dist/ReactShim.js",
1515
plugins: [
1616
babel({
17-
// plugins: ['external-helpers'],
18-
// externalHelpers: true,
1917
babelrc: false,
2018
presets: [
2119
[
@@ -28,14 +26,8 @@ export default {
2826
}),
2927
cleanup(),
3028
license({
31-
banner: `此版本要求浏览器没有createClass, createFactory, PropTypes, isValidElement,
32-
unmountComponentAtNode,unstable_renderSubtreeIntoContainer
33-
QQ 370262116 by 司徒正美 Copyright ${JSON.stringify(new Date()).replace(
34-
/T.*|"/g,
35-
""
36-
)}`
29+
banner: "Powered by YMFE (https://ymfe.org)"
3730
}),
38-
3931
replace({
4032
patterns: [
4133
{

Diff for: build/rollup.ssr.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import babel from "rollup-plugin-babel";
22
import cleanup from "rollup-plugin-cleanup";
3-
//import builtins from "rollup-plugin-node-builtins";
43
import strip from "rollup-plugin-strip";
54

65
export default {

Diff for: build/shim.script.js

-49
This file was deleted.

Diff for: build/sync.js

-59
This file was deleted.

Diff for: dist/React.js

+14-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
2-
* by 司徒正美 Copyright 2018-03-30
3-
* IE9+
2+
* Powered by YMFE (https://ymfe.org)
43
*/
54

65
(function(global, factory) {
@@ -682,7 +681,11 @@
682681
var elem = document.createElement(type);
683682
var inputType = props && props.type;
684683
if (inputType) {
685-
elem.type = inputType;
684+
try {
685+
elem = document.createElement(
686+
"<" + type + " type='" + inputType + "'/>"
687+
);
688+
} catch (error) {}
686689
}
687690
return elem;
688691
}
@@ -1313,16 +1316,16 @@
13131316
var _typeof =
13141317
typeof Symbol === "function" && typeof Symbol.iterator === "symbol"
13151318
? function(obj) {
1316-
return typeof obj;
1317-
}
1319+
return typeof obj;
1320+
}
13181321
: function(obj) {
1319-
return obj &&
1322+
return obj &&
13201323
typeof Symbol === "function" &&
13211324
obj.constructor === Symbol &&
13221325
obj !== Symbol.prototype
1323-
? "symbol"
1324-
: typeof obj;
1325-
};
1326+
? "symbol"
1327+
: typeof obj;
1328+
};
13261329
var NOBIND = {
13271330
render: 1,
13281331
shouldComponentUpdate: 1,
@@ -1396,7 +1399,7 @@
13961399
"spec",
13971400
"return function " +
13981401
className +
1399-
"(props, context) {\n ReactComponent.call(this, props, context);\n\n for (var methodName in this) {\n var method = this[methodName];\n if (typeof method === \"function\"&& !blacklist[methodName]) {\n this[methodName] = method.bind(this);\n }\n }\n\n if (spec.getInitialState) {\n var test = this.state = spec.getInitialState.call(this);\n if(!(test === null || ({}).toString.call(test) == \"[object Object]\")){\n throw \"getInitialState\u53EA\u80FD\u8FD4\u56DE\u7EAFJS\u5BF9\u8C61\u6216\u8005null\"\n }\n }\n };"
1402+
'(props, context) {\n ReactComponent.call(this, props, context);\n\n for (var methodName in this) {\n var method = this[methodName];\n if (typeof method === "function"&& !blacklist[methodName]) {\n this[methodName] = method.bind(this);\n }\n }\n\n if (spec.getInitialState) {\n var test = this.state = spec.getInitialState.call(this);\n if(!(test === null || ({}).toString.call(test) == "[object Object]")){\n throw "getInitialState\u53EA\u80FD\u8FD4\u56DE\u7EAFJS\u5BF9\u8C61\u6216\u8005null"\n }\n }\n };'
14001403
);
14011404
return curry(Component, NOBIND, spec);
14021405
}
@@ -3008,7 +3011,7 @@
30083011
React = win.React;
30093012
} else {
30103013
React = win.React = win.ReactDOM = {
3011-
version: "2.1.2",
3014+
version: "2.1.3",
30123015
render: render,
30133016
hydrate: render,
30143017
options: options,

Diff for: dist/React.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/React.min.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/ReactDOMServer.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -406,16 +406,16 @@
406406
var _typeof =
407407
typeof Symbol === "function" && typeof Symbol.iterator === "symbol"
408408
? function(obj) {
409-
return typeof obj;
410-
}
409+
return typeof obj;
410+
}
411411
: function(obj) {
412-
return obj &&
412+
return obj &&
413413
typeof Symbol === "function" &&
414414
obj.constructor === Symbol &&
415415
obj !== Symbol.prototype
416-
? "symbol"
417-
: typeof obj;
418-
};
416+
? "symbol"
417+
: typeof obj;
418+
};
419419
var skipAttributes = {
420420
ref: 1,
421421
key: 1,
@@ -448,7 +448,7 @@
448448
if (attrCached[value]) {
449449
return attrCached[value];
450450
}
451-
return (attrCached[value] = "\"" + encodeEntities(value) + "\"");
451+
return (attrCached[value] = '"' + encodeEntities(value) + '"');
452452
}
453453
function skipFalseAndFunction(a) {
454454
return a !== false && Object(a) !== a;
@@ -616,9 +616,9 @@
616616
switch ((_context.prev = _context.next)) {
617617
case 0:
618618
(_vnode2 = vnode),
619-
(tag = _vnode2.tag),
620-
(type = _vnode2.type),
621-
(props = _vnode2.props);
619+
(tag = _vnode2.tag),
620+
(type = _vnode2.type),
621+
(props = _vnode2.props);
622622
_context.t0 = type;
623623
_context.next =
624624
_context.t0 === "#text"

0 commit comments

Comments
 (0)