-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: convert CRLF line endings to LF
- Loading branch information
zetlen
committed
Nov 6, 2018
1 parent
137218c
commit a403111
Showing
27 changed files
with
9,470 additions
and
9,470 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
import React from 'react'; | ||
import { Provider as ReduxProvider } from 'react-redux'; | ||
import createStore from '../store'; | ||
import MagentoRouter from '../Router'; | ||
|
||
/** | ||
* | ||
* @param {string} apiBase Absolute URL pointing to the GraphQL endpoint | ||
* @param {string} __tmp_webpack_public_path__ Temporary hack. Expects the `__webpack_public_path__` value | ||
* @returns {{ store: Store, Provider: () => JSX.Element }} | ||
*/ | ||
export default function bootstrap({ | ||
apiBase, | ||
renderRoutes, | ||
__tmp_webpack_public_path__ | ||
}) { | ||
// Remove deprecation warning after 2 version bumps | ||
if (process.env.NODE_ENV !== 'production' && this instanceof bootstrap) { | ||
throw new Error( | ||
'The API for Peregrine has changed. ' + | ||
'Please see the Release Notes on Github ' + | ||
'for instructions to update your application' | ||
); | ||
} | ||
|
||
const store = createStore(); | ||
const routerProps = { | ||
apiBase, | ||
renderRoutes, | ||
__tmp_webpack_public_path__: ensureDirURI(__tmp_webpack_public_path__) | ||
}; | ||
const Provider = () => ( | ||
<ReduxProvider store={store}> | ||
<MagentoRouter {...routerProps} /> | ||
</ReduxProvider> | ||
); | ||
|
||
return { store, Provider }; | ||
} | ||
|
||
/** | ||
* Given a URI, will always return the same URI with a trailing slash | ||
* @param {string} uri | ||
*/ | ||
function ensureDirURI(uri) { | ||
return uri.endsWith('/') ? uri : uri + '/'; | ||
} | ||
import React from 'react'; | ||
import { Provider as ReduxProvider } from 'react-redux'; | ||
import createStore from '../store'; | ||
import MagentoRouter from '../Router'; | ||
|
||
/** | ||
* | ||
* @param {string} apiBase Absolute URL pointing to the GraphQL endpoint | ||
* @param {string} __tmp_webpack_public_path__ Temporary hack. Expects the `__webpack_public_path__` value | ||
* @returns {{ store: Store, Provider: () => JSX.Element }} | ||
*/ | ||
export default function bootstrap({ | ||
apiBase, | ||
renderRoutes, | ||
__tmp_webpack_public_path__ | ||
}) { | ||
// Remove deprecation warning after 2 version bumps | ||
if (process.env.NODE_ENV !== 'production' && this instanceof bootstrap) { | ||
throw new Error( | ||
'The API for Peregrine has changed. ' + | ||
'Please see the Release Notes on Github ' + | ||
'for instructions to update your application' | ||
); | ||
} | ||
|
||
const store = createStore(); | ||
const routerProps = { | ||
apiBase, | ||
renderRoutes, | ||
__tmp_webpack_public_path__: ensureDirURI(__tmp_webpack_public_path__) | ||
}; | ||
const Provider = () => ( | ||
<ReduxProvider store={store}> | ||
<MagentoRouter {...routerProps} /> | ||
</ReduxProvider> | ||
); | ||
|
||
return { store, Provider }; | ||
} | ||
|
||
/** | ||
* Given a URI, will always return the same URI with a trailing slash | ||
* @param {string} uri | ||
*/ | ||
function ensureDirURI(uri) { | ||
return uri.endsWith('/') ? uri : uri + '/'; | ||
} |
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,51 +1,51 @@ | ||
import React, { Component } from 'react'; | ||
import { BrowserRouter, Route } from 'react-router-dom'; | ||
import { string, func, object } from 'prop-types'; | ||
import MagentoRouteHandler from './MagentoRouteHandler'; | ||
|
||
export default class MagentoRouter extends Component { | ||
static propTypes = { | ||
/* Can be BrowserRouter, MemoryRouter, HashRouter, etc */ | ||
using: func, | ||
routerProps: object, | ||
apiBase: string.isRequired, | ||
renderRoutes: func, | ||
__tmp_webpack_public_path__: string.isRequired | ||
}; | ||
|
||
static defaultProps = { | ||
using: BrowserRouter, | ||
routerProps: {}, | ||
renderRoutes: ({ magentoRoute }) => magentoRoute | ||
}; | ||
|
||
render() { | ||
const { | ||
using: Router, | ||
routerProps, | ||
apiBase, | ||
renderRoutes, | ||
__tmp_webpack_public_path__ | ||
} = this.props; | ||
|
||
return ( | ||
<Router {...routerProps}> | ||
{renderRoutes({ | ||
magentoRoute: ( | ||
<Route | ||
render={({ location }) => ( | ||
<MagentoRouteHandler | ||
location={location} | ||
apiBase={apiBase} | ||
__tmp_webpack_public_path__={ | ||
__tmp_webpack_public_path__ | ||
} | ||
/> | ||
)} | ||
/> | ||
) | ||
})} | ||
</Router> | ||
); | ||
} | ||
} | ||
import React, { Component } from 'react'; | ||
import { BrowserRouter, Route } from 'react-router-dom'; | ||
import { string, func, object } from 'prop-types'; | ||
import MagentoRouteHandler from './MagentoRouteHandler'; | ||
|
||
export default class MagentoRouter extends Component { | ||
static propTypes = { | ||
/* Can be BrowserRouter, MemoryRouter, HashRouter, etc */ | ||
using: func, | ||
routerProps: object, | ||
apiBase: string.isRequired, | ||
renderRoutes: func, | ||
__tmp_webpack_public_path__: string.isRequired | ||
}; | ||
|
||
static defaultProps = { | ||
using: BrowserRouter, | ||
routerProps: {}, | ||
renderRoutes: ({ magentoRoute }) => magentoRoute | ||
}; | ||
|
||
render() { | ||
const { | ||
using: Router, | ||
routerProps, | ||
apiBase, | ||
renderRoutes, | ||
__tmp_webpack_public_path__ | ||
} = this.props; | ||
|
||
return ( | ||
<Router {...routerProps}> | ||
{renderRoutes({ | ||
magentoRoute: ( | ||
<Route | ||
render={({ location }) => ( | ||
<MagentoRouteHandler | ||
location={location} | ||
apiBase={apiBase} | ||
__tmp_webpack_public_path__={ | ||
__tmp_webpack_public_path__ | ||
} | ||
/> | ||
)} | ||
/> | ||
) | ||
})} | ||
</Router> | ||
); | ||
} | ||
} |
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,10 +1,10 @@ | ||
import { compose } from 'redux'; | ||
|
||
const composeEnhancers = | ||
process.env.NODE_ENV !== 'production' && | ||
typeof window === 'object' && | ||
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ | ||
? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}) | ||
: compose; | ||
|
||
export default composeEnhancers; | ||
import { compose } from 'redux'; | ||
|
||
const composeEnhancers = | ||
process.env.NODE_ENV !== 'production' && | ||
typeof window === 'object' && | ||
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ | ||
? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}) | ||
: compose; | ||
|
||
export default composeEnhancers; |
Oops, something went wrong.