-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(js): upgrade babel and webpack toolchains (#4959)
- Loading branch information
Showing
17 changed files
with
2,156 additions
and
1,660 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,12 @@ | ||
import React from 'react' | ||
// @flow | ||
import * as React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import { AppContainer } from 'react-hot-loader' | ||
import App from './App' | ||
import { App } from './App' | ||
|
||
const render = Component => { | ||
ReactDOM.render( | ||
<AppContainer> | ||
<Component /> | ||
</AppContainer>, | ||
document.getElementById('root') | ||
) | ||
} | ||
|
||
render(App) | ||
const root = document.getElementById('root') | ||
|
||
// Hot Module Replacement API | ||
if (module.hot) { | ||
module.hot.accept('./App', () => { | ||
render(App) | ||
}) | ||
if (!root) { | ||
throw new Error('Unable to find #root') | ||
} | ||
|
||
ReactDOM.render(<App />, root) |
Oops, something went wrong.