Skip to content

Commit

Permalink
feat: support for React 16
Browse files Browse the repository at this point in the history
  • Loading branch information
foxhound87 committed Oct 13, 2017
1 parent be4959e commit 3a6f3ab
Show file tree
Hide file tree
Showing 6 changed files with 543 additions and 179 deletions.
15 changes: 6 additions & 9 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@
"basscss-colors": "2.2.0",
"classnames": "2.2.5",
"font-awesome": "4.7.0",
"mobx": "^3.0.2",
"mobx-react": "^4.1.0",
"mobx-react-devtools": "4.2.11",
"react": "15.4.2",
"react-dom": "15.4.2"
},
"peerDependencies": {
"react": "15.4.2",
"react-dom": "15.4.2"
"mobx": "^3.3.1",
"mobx-react": "^4.3.3",
"mobx-react-devtools": "^4.2.15",
"prop-types": "^15.6.0",
"react": "^16.0.0",
"react-dom": "^16.0.0"
},
"devDependencies": {
"babel-loader": "6.2.10",
Expand Down
66 changes: 38 additions & 28 deletions demo/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1789,9 +1789,9 @@ faye-websocket@~0.11.0:
dependencies:
websocket-driver ">=0.5.1"

fbjs@^0.8.1, fbjs@^0.8.4:
version "0.8.8"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.8.tgz#02f1b6e0ea0d46c24e0b51a2d24df069563a5ad6"
fbjs@^0.8.16:
version "0.8.16"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db"
dependencies:
core-js "^1.0.0"
isomorphic-fetch "^2.1.1"
Expand Down Expand Up @@ -2079,9 +2079,9 @@ hoek@2.x.x:
version "2.16.3"
resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed"

hoist-non-react-statics@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-1.2.0.tgz#aa448cf0986d55cc40773b17174b7dd066cb7cfb"
hoist-non-react-statics@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.3.1.tgz#343db84c6018c650778898240135a1420ee22ce0"

home-or-tmp@^2.0.0:
version "2.0.0"
Expand Down Expand Up @@ -2546,7 +2546,7 @@ longest@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"

loose-envify@^1.0.0, loose-envify@^1.1.0:
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
dependencies:
Expand Down Expand Up @@ -2652,19 +2652,19 @@ minimist@^1.2.0:
dependencies:
minimist "0.0.8"

mobx-react-devtools@4.2.11:
version "4.2.11"
resolved "https://registry.yarnpkg.com/mobx-react-devtools/-/mobx-react-devtools-4.2.11.tgz#18d89a32b7d28b48228d12ccde73cf733aacc395"
mobx-react-devtools@^4.2.15:
version "4.2.15"
resolved "https://registry.yarnpkg.com/mobx-react-devtools/-/mobx-react-devtools-4.2.15.tgz#881c038fb83db4dffd1e72bbaf5374d26b2fdebb"

mobx-react@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/mobx-react/-/mobx-react-4.1.0.tgz#0b4927a8c4457dbb296c512693acdf9073d9afc7"
mobx-react@^4.3.3:
version "4.3.3"
resolved "https://registry.yarnpkg.com/mobx-react/-/mobx-react-4.3.3.tgz#4ad76c03d1e942b431e942f9ea18df0756771655"
dependencies:
hoist-non-react-statics "^1.2.0"
hoist-non-react-statics "^2.3.1"

mobx@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/mobx/-/mobx-3.0.2.tgz#ade8e83434f7a73868d2632603b6d17da530427c"
mobx@^3.3.1:
version "3.3.1"
resolved "https://registry.yarnpkg.com/mobx/-/mobx-3.3.1.tgz#c38fc1a287a0dda3f5d4b85efe1137fedd9dcdf0"

ms@0.7.1:
version "0.7.1"
Expand Down Expand Up @@ -2801,7 +2801,7 @@ oauth-sign@~0.8.1:
version "0.8.2"
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43"

object-assign@^4.0.1, object-assign@^4.1.0:
object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"

Expand Down Expand Up @@ -3303,6 +3303,14 @@ promise@^7.1.1:
dependencies:
asap "~2.0.3"

prop-types@^15.6.0:
version "15.6.0"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856"
dependencies:
fbjs "^0.8.16"
loose-envify "^1.3.1"
object-assign "^4.1.1"

proxy-addr@~1.1.2:
version "1.1.3"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-1.1.3.tgz#dc97502f5722e888467b3fa2297a7b1ff47df074"
Expand Down Expand Up @@ -3373,21 +3381,23 @@ rc@~1.1.6:
minimist "^1.2.0"
strip-json-comments "~1.0.4"

react-dom@15.4.2:
version "15.4.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.4.2.tgz#015363f05b0a1fd52ae9efdd3a0060d90695208f"
react-dom@^16.0.0:
version "16.0.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.0.0.tgz#9cc3079c3dcd70d4c6e01b84aab2a7e34c303f58"
dependencies:
fbjs "^0.8.1"
fbjs "^0.8.16"
loose-envify "^1.1.0"
object-assign "^4.1.0"
object-assign "^4.1.1"
prop-types "^15.6.0"

react@15.4.2:
version "15.4.2"
resolved "https://registry.yarnpkg.com/react/-/react-15.4.2.tgz#41f7991b26185392ba9bae96c8889e7e018397ef"
react@^16.0.0:
version "16.0.0"
resolved "https://registry.yarnpkg.com/react/-/react-16.0.0.tgz#ce7df8f1941b036f02b2cca9dbd0cb1f0e855e2d"
dependencies:
fbjs "^0.8.4"
fbjs "^0.8.16"
loose-envify "^1.1.0"
object-assign "^4.1.0"
object-assign "^4.1.1"
prop-types "^15.6.0"

read-cache@^1.0.0:
version "1.0.0"
Expand Down
18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@
}
},
"dependencies": {
"match-media-mock": "0.1.0",
"prop-types": "^15.5.8"
"match-media-mock": "0.1.0"
},
"peerDependencies": {
"mobx": "^2.5.0 || ^3.0.0",
"react": "^15.0.0"
"prop-types": "^15.6.0",
"react": "^15.0.0 || ^16.0.0"
},
"devDependencies": {
"babel-cli": "6.22.0",
Expand All @@ -74,21 +74,23 @@
"codecov": "1.0.1",
"commitizen": "2.9.5",
"cz-conventional-changelog": "1.2.0",
"enzyme": "^2.8.2",
"enzyme": "^3.1.0",
"enzyme-adapter-react-16": "^1.0.1",
"eslint": "3.13.1",
"eslint-config-airbnb": "14.0.0",
"eslint-plugin-import": "2.2.0",
"eslint-plugin-jsx-a11y": "3.0.2",
"eslint-plugin-react": "6.9.0",
"husky": "^0.12.0",
"jsdom": "^11.3.0",
"json-loader": "0.5.4",
"mobx": "3.0.2",
"mobx": "^3.3.1",
"mocha": "3.2.0",
"npm-run-all": "4.0.1",
"nyc": "10.1.2",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-test-renderer": "^15.5.4",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-test-renderer": "^16.0.0",
"semantic-release": "^6.3.2",
"webpack": "1.14.0"
}
Expand Down
5 changes: 5 additions & 0 deletions tests/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// setup file
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';

configure({ adapter: new Adapter() });
7 changes: 6 additions & 1 deletion tests/test.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import React from 'react';
import { expect } from 'chai';
import { JSDOM } from 'jsdom';
import { shallow } from 'enzyme';
import { isObservable } from 'mobx';

import { MatchMediaProvider } from '../src/index';
import breakpoints from './data/breakpoints';
import './config';

const jsdom = new JSDOM('<!doctype html><html><body></body></html>');
global.window = jsdom.window;


describe('<MatchMediaProvider />', () => {
// test
Expand Down
Loading

0 comments on commit 3a6f3ab

Please sign in to comment.