Skip to content

Commit

Permalink
fix(*): add React,React-DOM 16 to dependencies
Browse files Browse the repository at this point in the history
To prevent duplicates in consumer bundles

Change-Id: I5aceb0f151654efebd8d8b86e30e28cac11d37e2
Reviewed-on: https://gerrit.instructure.com/158300
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
QA-Review: Jennifer Stern <jstern@instructure.com>
  • Loading branch information
junyper committed Jul 24, 2018
1 parent 5681198 commit d49430f
Show file tree
Hide file tree
Showing 34 changed files with 42 additions and 42 deletions.
4 changes: 2 additions & 2 deletions packages/__docs__/package.json
Expand Up @@ -61,7 +61,7 @@
"@instructure/ui-utils": "^5.20.1",
"lorem-ipsum": "^1.0.5",
"moment": "^2.22.2",
"react": "^15.6.2",
"react-dom": "^15.6.2"
"react": "^0.14.9 || ^15 || ^16",
"react-dom": "^0.14.9 || ^15 || ^16"

This comment has been minimized.

Copy link
@micabe

micabe Jul 25, 2018

Hello @junyper ,

Good practices want you to include the popular libs such as react, react-dom, moment in peerDependencies rather than in dependencies and let the end user do the lib upgrade manually... see: facebook/prop-types#44

This comment has been minimized.

Copy link
@ryankshaw

ryankshaw Jul 25, 2018

Contributor

I think that may have been good advice and objectively better back before yarn or before npm started using lockfiles but with lockfiles you can do anything that you could do with peerDeps, by controlling what your lockfile looks like. and the contract is explicit whereas with peerDeps I have seen yarn do some things you diddn't want it to.

you can still do the library upgrade manually by controlling how your yarn.lock or package-lock.json looks. that is the source of truth, as long as there is only one entry for react there, your app will use the same instance of react for everything.

This comment has been minimized.

Copy link
@ryankshaw

ryankshaw Jul 26, 2018

Contributor

just wanting to add to that ^: if you are relying on blindly accepting whatever yarn does every time you yarn install or yarn upgrade you are going to eventually get a ton of duplicate packages and your webpacked JS bundle size is going to bloat because of it. for example, it might be perfectly fine to use two copies of prop-types, or lodash or tinymce or any other library you might use, but you (and your users) don't actually want to do that. and if you yarn install something that needs "lodash": "^4.3.1" and you already had a yarn.lock entry for lodash@^4: 4.2.0 by default yarn will create a new yarn.lock entry for lodash@^4.3.1 and leave the 4.2.0 one as-is and now you'll be sending 2 to the browser. Until yarnpkg/yarn#579 is fixed, it's going to require intervention on your part to make sure that everything that can use the same version of lodash does.

so the fact that react or instructure-ui themeable don't work with more than one copy loaded on the same page doesn't really mean anything in this conversation, you still need to train yourself to actually look at changes to yarn.lock after an install or upgrade

}
}
6 changes: 3 additions & 3 deletions packages/__examples__/package.json
Expand Up @@ -18,7 +18,7 @@
"review:screenshots": "happo review"
},
"license": "MIT",
"devDependencies": {
"dependencies": {
"@instructure/ui-presets": "^5.20.1",
"@instructure/ui-themes": "^5.20.1",
"@storybook/addon-links": "^3.4.6",
Expand All @@ -27,8 +27,8 @@
"@storybook/react": "^3.4.6",
"happo": "^5.0.0",
"happo-target-firefox": "^5.0.2",
"react": "^15.6.2",
"react-dom": "^15.6.2",
"react": "^0.14.9 || ^15 || ^16",
"react-dom": "^0.14.9 || ^15 || ^16",
"story2sketch": "^1.1.0",
"storybook-addon-rtl": "^0.1.1"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/media-capture/package.json
Expand Up @@ -42,7 +42,7 @@
"classnames": "^2",
"luxon": "^0.3.1",
"prop-types": "^15",
"react": "^0.14.9 || ^15",
"react": "^0.14.9 || ^15 || ^16",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-a11y/package.json
Expand Up @@ -31,7 +31,7 @@
"@instructure/ui-utils": "^5",
"keycode": "^2",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-alerts/package.json
Expand Up @@ -37,8 +37,8 @@
"classnames": "^2",
"keycode": "^2",
"prop-types": "^15",
"react": "^0.14.9 || ^15",
"react-dom": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16",
"react-dom": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-billboard/package.json
Expand Up @@ -34,7 +34,7 @@
"@instructure/ui-utils": "^5",
"classnames": "^2",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-breadcrumb/package.json
Expand Up @@ -34,7 +34,7 @@
"@instructure/ui-utils": "^5",
"classnames": "^2",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-buttons/package.json
Expand Up @@ -35,7 +35,7 @@
"classnames": "^2",
"keycode": "^2",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-code-editor/package.json
Expand Up @@ -33,7 +33,7 @@
"classnames": "^2",
"codemirror": "^5.39.0",
"prop-types": "^15",
"react": "^0.14.9 || ^15",
"react": "^0.14.9 || ^15 || ^16",
"react-codemirror2": "^5.1.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-container/package.json
Expand Up @@ -31,7 +31,7 @@
"@instructure/ui-utils": "^5",
"classnames": "^2",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-core/package.json
Expand Up @@ -52,7 +52,7 @@
"classnames": "^2",
"keycode": "^2.1.8",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-docs-client/package.json
Expand Up @@ -44,8 +44,8 @@
"he": "^1.1.1",
"marked": "^0.4.0",
"prop-types": "^15",
"react": "^0.14.9 || ^15",
"react-dom": "^0.14.9 || ^15",
"react": "^0.14.9 || ^15 || ^16",
"react-dom": "^0.14.9 || ^15 || ^16",
"react-github-corner": "^2.1.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-elements/package.json
Expand Up @@ -36,7 +36,7 @@
"@instructure/ui-utils": "^5",
"classnames": "^2",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-focusable/package.json
Expand Up @@ -33,7 +33,7 @@
"@instructure/ui-utils": "^5",
"classnames": "^2",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-forms/package.json
Expand Up @@ -41,7 +41,7 @@
"classnames": "^2",
"keycode": "^2",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-i18n/package.json
Expand Up @@ -31,7 +31,7 @@
"decimal.js": "^10",
"moment-timezone": "^0.5",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-icons/package.json
Expand Up @@ -26,7 +26,7 @@
"dependencies": {
"@instructure/ui-svg-images": "^5",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-layout/package.json
Expand Up @@ -37,7 +37,7 @@
"@instructure/ui-utils": "^5",
"classnames": "^2",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-media-player/package.json
Expand Up @@ -38,7 +38,7 @@
"@instructure/ui-utils": "^5",
"classnames": "^2",
"prop-types": "^15",
"react": "^0.14.9 || ^15",
"react": "^0.14.9 || ^15 || ^16",
"screenfull": "^3.3.2"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-menu/package.json
Expand Up @@ -37,7 +37,7 @@
"classnames": "^2",
"keycode": "^2",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-motion/package.json
Expand Up @@ -30,7 +30,7 @@
"@instructure/ui-themeable": "^5",
"@instructure/ui-utils": "^5",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-navigation/package.json
Expand Up @@ -35,7 +35,7 @@
"@instructure/ui-utils": "^5",
"classnames": "^2",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-overlays/package.json
Expand Up @@ -39,7 +39,7 @@
"classnames": "^2",
"no-scroll": "^2.1.0",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-pages/package.json
Expand Up @@ -34,7 +34,7 @@
"@instructure/ui-themeable": "^5",
"@instructure/ui-utils": "^5",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-pagination/package.json
Expand Up @@ -35,7 +35,7 @@
"@instructure/ui-themeable": "^5",
"@instructure/ui-utils": "^5",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-portal/package.json
Expand Up @@ -29,8 +29,8 @@
"@instructure/ui-i18n": "^5",
"@instructure/ui-utils": "^5",
"prop-types": "^15",
"react": "^0.14.9 || ^15",
"react-dom": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16",
"react-dom": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-svg-images/package.json
Expand Up @@ -31,7 +31,7 @@
"@instructure/ui-utils": "^5",
"classnames": "^2",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-tabs/package.json
Expand Up @@ -34,7 +34,7 @@
"classnames": "^2",
"keycode": "^2",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-themeable/package.json
Expand Up @@ -29,7 +29,7 @@
"@instructure/ui-utils": "^5",
"glamor": "^2.20.37",
"prop-types": "^15",
"react": "^0.14.9 || ^15",
"react": "^0.14.9 || ^15 || ^16",
"tinycolor2": "^1.4.1"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-toggle-details/package.json
Expand Up @@ -38,7 +38,7 @@
"@instructure/ui-utils": "^5",
"classnames": "^2",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-tree-browser/package.json
Expand Up @@ -33,7 +33,7 @@
"classnames": "^2",
"keycode": "^2",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-utils/package.json
Expand Up @@ -35,8 +35,8 @@
"object.omit": "^3",
"object.pick": "^1.2.0",
"prop-types": "^15",
"react": "^0.14.9 || ^15",
"react-dom": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16",
"react-dom": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion scripts/templates/package/package.json
Expand Up @@ -29,7 +29,7 @@
"dependencies": {
"@instructure/ui-themeable": "^5",
"prop-types": "^15",
"react": "^0.14.9 || ^15"
"react": "^0.14.9 || ^15 || ^16"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Expand Up @@ -11837,7 +11837,7 @@ react-dom@15.4.1:
loose-envify "^1.1.0"
object-assign "^4.1.0"

"react-dom@^0.14.9 || ^15", react-dom@^15.6.2:
"react-dom@^0.14.9 || ^15", "react-dom@^0.14.9 || ^15 || ^16":
version "15.6.2"
resolved "https://registry.npmjs.org/react-dom/-/react-dom-15.6.2.tgz#41cfadf693b757faf2708443a1d1fd5a02bef730"
dependencies:
Expand Down Expand Up @@ -11986,7 +11986,7 @@ react@15.4.1:
loose-envify "^1.1.0"
object-assign "^4.1.0"

"react@^0.14.9 || ^15", react@^15.6.2:
"react@^0.14.9 || ^15", "react@^0.14.9 || ^15 || ^16":
version "15.6.2"
resolved "https://registry.npmjs.org/react/-/react-15.6.2.tgz#dba0434ab439cfe82f108f0f511663908179aa72"
dependencies:
Expand Down

0 comments on commit d49430f

Please sign in to comment.