-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build(js): upgrade babel and webpack toolchains #4959
Changes from 3 commits
1cf6246
b81a6d1
9a9246a
e7fa264
95ae8c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
"peerDependencies": { | ||
"classnames": "^2.2.5", | ||
"lodash": "^4.17.4", | ||
"react": "^16.8.6", | ||
"react": "16.8.6", | ||
"react-router-dom": "^5.0.1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question about semantic versioning here |
||
}, | ||
"dependencies": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// flow-typed signature: 8a7e73fee92a885e2d4c8f94329ddbe2 | ||
// flow-typed version: c6154227d1/react-hot-loader_v4.6.x/flow_>=v0.104.x | ||
|
||
// @flow | ||
declare module "react-hot-loader" { | ||
declare type Module = { id: string, ... }; | ||
|
||
declare type ErrorReporterProps = {| | ||
error: Error, | ||
errorInfo: { componentStack: string, ... } | ||
|} | ||
|
||
declare export type ContainerProps = {| | ||
children: React$Element<any>, | ||
errorBoundary?: boolean, | ||
errorReporter?: React$ComponentType<ErrorReporterProps>, | ||
|} | ||
|
||
declare export class AppContainer extends React$Component<ContainerProps> {} | ||
|
||
declare export function hot(module: Module): <T: React$ComponentType<any>>( | ||
Component: T, | ||
props?: $Diff<ContainerProps, { children: React$Element<any>, ... }> | ||
) => T | ||
|
||
declare export function cold<T: React$ComponentType<any>>(component: T): T | ||
|
||
declare export function areComponentsEqual<T>( | ||
typeA: React$ComponentType<T>, | ||
typeB: React$ComponentType<T> | ||
): boolean | ||
|
||
declare type Config = {| | ||
logLevel: 'debug' | 'log' | 'warn' | 'error', | ||
pureSFC: boolean, | ||
pureRender: boolean, | ||
allowSFC: boolean, | ||
disableHotRenderer: boolean, | ||
disableHotRendererWhenInjected: boolean, | ||
ignoreSFC: boolean, | ||
ignoreComponents: boolean, | ||
errorReporter: React$ComponentType<ErrorReporterProps>, | ||
ErrorOverlay: React$ComponentType<{ errors: Array<ErrorReporterProps>, ... }>, | ||
onComponentRegister: (type: any, uniqueLocalName: string, fileName: string) => any, | ||
onComponentCreate: (type: any, displayName: string) => any, | ||
|} | ||
|
||
declare export function setConfig(config: $Shape<Config>): void | ||
} | ||
|
||
declare module "react-hot-loader/root" { | ||
import type { ContainerProps } from 'react-hot-loader'; | ||
|
||
declare export function hot<T: React$ComponentType<any>>( | ||
Component: T, | ||
props?: $Diff<ContainerProps, { children: React$Element<any>, ... }> | ||
): T; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
}, | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"@hot-loader/react-dom": "16.8.6", | ||
"@opentrons/components": "3.16.0", | ||
"ajv": "^6.2.1", | ||
"classnames": "^2.2.5", | ||
|
@@ -26,13 +27,10 @@ | |
"lodash": "^4.17.4", | ||
"mixpanel-browser": "^2.29.1", | ||
"query-string": "^6.2.0", | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.6", | ||
"react-hot-loader": "^4.8.0", | ||
"react": "16.8.6", | ||
"react-dom": "16.8.6", | ||
"react-hot-loader": "^4.12.19", | ||
"react-router-dom": "^5.0.1", | ||
"yup": "^0.27.0" | ||
}, | ||
"devDependencies": { | ||
"react-snap": "^1.23.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All devDependencies go in monorepo package.json, where this entry already exists |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,25 +24,22 @@ | |
"node": ">=12" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.6.0", | ||
"@babel/plugin-proposal-class-properties": "^7.5.5", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.5.5", | ||
"@babel/plugin-proposal-optional-chaining": "^7.6.0", | ||
"@babel/plugin-syntax-dynamic-import": "^7.2.0", | ||
"@babel/plugin-transform-modules-commonjs": "^7.6.0", | ||
"@babel/preset-env": "^7.6.0", | ||
"@babel/preset-flow": "^7.0.0", | ||
"@babel/preset-react": "^7.0.0", | ||
"@babel/core": "^7.8.4", | ||
"@babel/plugin-proposal-class-properties": "^7.8.3", | ||
"@babel/plugin-transform-modules-commonjs": "^7.8.3", | ||
"@babel/preset-env": "^7.8.4", | ||
"@babel/preset-flow": "^7.8.3", | ||
"@babel/preset-react": "^7.8.3", | ||
"ajv": "^6.10.2", | ||
"aws-sdk": "^2.493.0", | ||
"babel-eslint": "^10.0.3", | ||
"babel-jest": "^24.9.0", | ||
"babel-eslint": "^11.0.0-beta.2", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Beta release required for flow inexact object syntax; keep an eye on this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's annoying — let's def keep an eye out |
||
"babel-jest": "^25.1.0", | ||
mcous marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"babel-loader": "^8.0.6", | ||
"babel-plugin-dynamic-import-node": "^2.3.0", | ||
"babel-plugin-unassert": "^3.0.1", | ||
"codecov": "^3.1.0", | ||
"concurrently": "^4.1.2", | ||
"core-js": "^3.2.1", | ||
"core-js": "^3.6.4", | ||
"css-loader": "^3.2.0", | ||
"cypress": "^3.8.1", | ||
"cypress-file-upload": "3.1.2", | ||
|
@@ -54,11 +51,11 @@ | |
"enzyme": "^3.10.0", | ||
"enzyme-adapter-react-16": "^1.14.0", | ||
"enzyme-to-json": "^3.3.5", | ||
"eslint": "^6.0.1", | ||
"eslint": "^6.8.0", | ||
"eslint-config-prettier": "^6.3.0", | ||
"eslint-config-standard": "^12.0.0", | ||
"eslint-plugin-flowtype": "^3.11.1", | ||
"eslint-plugin-cypress": "^2.8.1", | ||
"eslint-plugin-flowtype": "^3.11.1", | ||
"eslint-plugin-import": "^2.18.0", | ||
"eslint-plugin-json": "^1.4.0", | ||
"eslint-plugin-node": "^9.1.0", | ||
|
@@ -69,7 +66,7 @@ | |
"eslint-plugin-standard": "^4.0.0", | ||
"express": "^4.16.4", | ||
"favicons-webpack-plugin": "^1.0.2", | ||
"file-loader": "^4.2.0", | ||
"file-loader": "^5.0.2", | ||
"flow-bin": "^0.110.1", | ||
"flow-typed": "^2.6.2", | ||
"fs-extra": "^6.0.1", | ||
|
@@ -79,12 +76,12 @@ | |
"handlebars-loader": "^1.7.1", | ||
"html-webpack-plugin": "^3.2.0", | ||
"identity-obj-proxy": "^3.0.0", | ||
"jest": "^24.8.0", | ||
"jest": "^25.1.0", | ||
"lerna": "^3.16.4", | ||
"lost": "^8.3.1", | ||
"madge": "^3.6.0", | ||
"mime": "^2.4.4", | ||
"mini-css-extract-plugin": "^0.8.0", | ||
"mini-css-extract-plugin": "^0.9.0", | ||
"onchange": "^6.1.0", | ||
"optimize-css-assets-webpack-plugin": "^5.0.3", | ||
"portfinder": "^1.0.13", | ||
|
@@ -95,8 +92,8 @@ | |
"postcss-loader": "^3.0.0", | ||
"postcss-preset-env": "^6.7.0", | ||
"prettier": "1.18.2", | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.6", | ||
"react": "16.8.6", | ||
"react-dom": "16.8.6", | ||
"react-snap": "^1.23.0", | ||
"react-styleguidist": "^8.0.1", | ||
"react-test-renderer": "^16.8.6", | ||
|
@@ -105,16 +102,16 @@ | |
"rehype-urls": "^1.0.0", | ||
"script-ext-html-webpack-plugin": "^2.1.4", | ||
"shx": "^0.2.2", | ||
"style-loader": "^1.0.0", | ||
"style-loader": "^1.1.3", | ||
"stylelint": "^11.0.0", | ||
"stylelint-config-standard": "^19.0.0", | ||
"terser-webpack-plugin": "^2.1.0", | ||
"terser-webpack-plugin": "^2.3.5", | ||
"url-loader": "^2.1.0", | ||
"wait-on": "^3.3.0", | ||
"webpack": "^4.40.2", | ||
"webpack-bundle-analyzer": "^3.5.0", | ||
"webpack-cli": "^3.3.9", | ||
"webpack-dev-server": "^3.8.1", | ||
"webpack": "^4.41.6", | ||
"webpack-bundle-analyzer": "^3.6.0", | ||
"webpack-cli": "^3.3.11", | ||
"webpack-dev-server": "^3.10.3", | ||
"webpack-merge": "^4.2.2", | ||
"webpack-node-externals": "^1.7.2", | ||
"worker-loader": "^2.0.0", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
// @flow | ||
import React from 'react' | ||
import * as React from 'react' | ||
import { hot } from 'react-hot-loader/root' | ||
import URLDeck from './URLDeck' | ||
import './globals.css' | ||
|
||
export default function App() { | ||
export function AppComponent() { | ||
return <URLDeck /> | ||
} | ||
|
||
export const App = hot(AppComponent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious — why is it that we were previously using semantic versioning for react and not we're not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Judgement call and a safety thing:
react-dom
with@hot-loader/react-dom
@hot-loader/react-dom
needs to matchreact-dom
Longer term, I think we should probably lock all of our production dependencies explicitely (I'm generally good keeping dev deps on semver). That being said, I'd rather not mess with all our app deps in this PR