Browse Source

check the React version is available

Conflicts:
	package.json
pull/566/head
afc163 9 years ago
parent
commit
39f8613379
  1. 4
      CHANGELOG.md
  2. 10
      index.js
  3. 9
      package.json

4
CHANGELOG.md

@ -4,6 +4,10 @@
---
## 0.9.3 `2015-11-03`
* 增加对 React 版本的检测机制,0.9.x 序列只能使用 react@0.13.x 。
## 0.9.2 `2015-10-26`
* Tooltip 的 title 为空时不展示浮层。[9b53117](9b5311791e73270c7c16a602ac74dd59719a5f76)

10
index.js

@ -1,3 +1,5 @@
import React from 'react';
require('./style/index.less');
// matchMedia polyfill for
@ -49,6 +51,14 @@ const antd = {
// deprecate antd.confirm
antd.confirm = require('util-deprecate')(antd.confirm, 'antd.confirm() is deprecated, use antd.Modal.confirm() instead');
if (process.env.NODE_ENV !== 'production') {
const warning = require('warning');
const semver = require('semver');
const reactVersionInDeps = require('./package.json').devDependencies.react;
warning(semver.satisfies(React.version, reactVersionInDeps),
`antd@${antd.version} need to satisfies react@${reactVersionInDeps}.`);
}
module.exports = antd;
antd.version = require('./package.json').version;

9
package.json

@ -1,7 +1,7 @@
{
"name": "antd",
"version": "0.9.2",
"stableVersion": "0.9.2",
"version": "0.9.3",
"stableVersion": "0.9.3",
"title": "Ant Design",
"description": "一个 UI 设计语言",
"homepage": "http://ant.design/",
@ -63,7 +63,9 @@
"react-slick": "~0.8.0",
"reqwest-without-xhr2": "~2.0.2",
"util-deprecate": "~1.0.1",
"velocity-animate": "~1.2.2"
"velocity-animate": "~1.2.2",
"warning": "~2.1.0",
"semver": "~5.0.3"
},
"devDependencies": {
"autoprefixer-loader": "^3.1.0",
@ -89,7 +91,6 @@
"precommit-hook": "^1.0.7",
"react": "~0.13.0",
"react-router": "1.0.0-rc1",
"semver": "~5.0.3",
"webpack": "^1.10.1",
"webpack-dev-middleware": "^1.2.0"
},

Loading…
Cancel
Save