Skip to content

Commit

Permalink
Demo app: switch to default imports
Browse files Browse the repository at this point in the history
  • Loading branch information
chmnkh committed Feb 19, 2019
1 parent 2af177f commit 7395ceb
Show file tree
Hide file tree
Showing 50 changed files with 87 additions and 89 deletions.
4 changes: 1 addition & 3 deletions @types/react-jss/index.d.ts
@@ -1,5 +1,5 @@
declare module 'react-jss' {
import * as React from 'react';
import React from 'react';
import { create, GenerateClassName } from 'jss';

export { default as withTheme, Theme, WithTheme } from 'theming';
Expand All @@ -20,5 +20,3 @@ declare module 'react-jss' {
public toString(): string;
}
}


4 changes: 2 additions & 2 deletions @types/react-jss/lib/injectSheet.d.ts
@@ -1,7 +1,7 @@

declare module 'react-jss/lib/injectSheet' {
import * as React from 'react';
import * as CSS from 'csstype';
import React from 'react';
import CSS from 'csstype';
import { WithTheme, Theme } from 'theming';
import { ConsistentWith, Overwrite } from '_helpers';

Expand Down
6 changes: 3 additions & 3 deletions docs/ru/feature/lazy-feature.md
Expand Up @@ -46,7 +46,7 @@ export { loadEntry } from './loader';
С помощью HOC'а `featureConnect` можно упростить процесс получения данных фичи и подключения фичи к redux-стору. Использовать его можно только в модулях. На вход принимает мап-объект с лоадерами интересующих нас фич и react-компонент, ключи этого объекта должны совпадать с ключами пропсов оборачиваемого react-компонента. После успешной загрузки фич они будут автоматически подключены к redux-стору и объекты с данными фич будут прокинуты в оборачиваемый react-компонент. Также ему можно передать прелоадер, который будет отображаться во время загрузки фич.

```typescript
import * as React from 'react';
import React from 'react';
import { featureConnect } from 'core';

import { RouteComponentProps } from 'react-router-dom';
Expand Down Expand Up @@ -107,7 +107,7 @@ export { IContainerTypes };
Пример использования:

```typescript
import * as React from 'react';
import React from 'react';
import { IContainerTypes, containersProvider } from 'core';

interface IProps {
Expand All @@ -133,4 +133,4 @@ export default (
SomeFeatureComponent,
)
);
```
```
4 changes: 2 additions & 2 deletions docs/ru/styling.md
Expand Up @@ -46,7 +46,7 @@ export type StylesProps = WithStyles<typeof styles>;

Файл `MyComponent.tsx`:
```typescript
import * as React from 'react';
import React from 'react';
import { provideStyles, StylesProps } from './MyComponent.style';

interface IProps {
Expand Down Expand Up @@ -120,4 +120,4 @@ declare module 'theming/@externals' {
};
}
```
В дальнейшем эту тему можно импортировать из `react-jss`
В дальнейшем эту тему можно импортировать из `react-jss`
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import block from 'bem-cn';
import { bind } from 'decko';

Expand Down
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import block from 'bem-cn';
import { bind } from 'decko';
import { connect } from 'react-redux';
Expand Down
4 changes: 2 additions & 2 deletions jest.setup.ts
@@ -1,4 +1,4 @@
import * as Enzyme from 'enzyme';
import * as Adapter from 'enzyme-adapter-react-16';
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';

Enzyme.configure({ adapter: new (Adapter as any)() });
2 changes: 1 addition & 1 deletion server/index.ts
@@ -1,6 +1,6 @@
#!/usr/bin/env node

import * as express from 'express';
import express from 'express';
import clientConfig from '../webpack/isomorphic/client.config';
import serverConfig from '../webpack/isomorphic/server.config';
import { startDevelopmentMode, startProductionMode } from './starters';
Expand Down
8 changes: 4 additions & 4 deletions server/middleware.ts
@@ -1,7 +1,7 @@
import * as cookieParser from 'cookie-parser';
import * as compression from 'compression';
import * as express from 'express';
import * as path from 'path';
import cookieParser from 'cookie-parser';
import compression from 'compression';
import express from 'express';
import path from 'path';

export default function middleware(app: express.Express) {
app.use(compression());
Expand Down
8 changes: 4 additions & 4 deletions server/starters.ts
@@ -1,8 +1,8 @@
import * as webpack from 'webpack';
import webpack from 'webpack';
import { Express } from 'express';
import * as hotMiddleware from 'webpack-hot-middleware';
import * as SSRMiddleware from 'webpack-isomorphic-dev-middleware';
import * as $ from 'cheerio';
import hotMiddleware from 'webpack-hot-middleware';
import SSRMiddleware from 'webpack-isomorphic-dev-middleware';
import $ from 'cheerio';

import { IAssets } from '../src/shared/types/app';

Expand Down
6 changes: 3 additions & 3 deletions src/assets/Html.tsx
@@ -1,7 +1,7 @@
import * as React from 'react';
import * as serialize from 'serialize-javascript';
import React from 'react';
import serialize from 'serialize-javascript';
import Helmet from 'react-helmet';
import * as redux from 'redux';
import redux from 'redux';
import { renderToString } from 'react-dom/server';

import { IAssets } from 'shared/types/app';
Expand Down
6 changes: 3 additions & 3 deletions src/client.tsx
@@ -1,9 +1,9 @@
import 'reflect-metadata';
import 'babel-polyfill';
import { App } from 'core/App';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import * as bootstrapper from 'react-async-bootstrapper';
import React from 'react';
import ReactDOM from 'react-dom';
import bootstrapper from 'react-async-bootstrapper';
import configureApp from 'core/configureApp';

import { AppContainer } from 'react-hot-loader';
Expand Down
2 changes: 1 addition & 1 deletion src/core/App.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { Provider } from 'react-redux';
import { BrowserRouter, StaticRouter } from 'react-router-dom';
import 'normalize.css';
Expand Down
2 changes: 1 addition & 1 deletion src/core/ContainersProvider.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { bind } from 'decko';
import { Omit } from '_helpers';

Expand Down
2 changes: 1 addition & 1 deletion src/core/FeatureConnector.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { bind } from 'decko';
import * as R from 'ramda';
import { injectable } from 'inversify';
Expand Down
2 changes: 1 addition & 1 deletion src/core/routes.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { Route, RouteComponentProps, Redirect, Switch } from 'react-router-dom';

import { App } from 'modules/App';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/App/view/App.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';

class App extends React.Component {
public render() {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/shared/BaseLayout/BaseLayout.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { withRouter, RouteComponentProps } from 'react-router';

import { RowsLayout } from 'shared/view/elements';
Expand Down
6 changes: 3 additions & 3 deletions src/server.tsx
@@ -1,7 +1,7 @@
import 'reflect-metadata';
import * as express from 'express';
import * as React from 'react';
import * as bootstrapper from 'react-async-bootstrapper';
import express from 'express';
import React from 'react';
import bootstrapper from 'react-async-bootstrapper';
import { renderToString } from 'react-dom/server';

import { IAssets, IAppData } from 'shared/types/app';
Expand Down
4 changes: 2 additions & 2 deletions src/services/i18n/constants.ts
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as Polyglot from 'node-polyglot';
import React from 'react';
import Polyglot from 'node-polyglot';

import buildTranslationKeys from './helpers/buildTranslationKeys';

Expand Down
2 changes: 1 addition & 1 deletion src/services/i18n/namespace.ts
@@ -1,4 +1,4 @@
import * as Polyglot from 'node-polyglot';
import Polyglot from 'node-polyglot';

type CustomTranslateFunction = (phrase: IPhraseWithOptions) => string;
interface IPhraseWithOptions {
Expand Down
4 changes: 2 additions & 2 deletions src/services/i18n/view/I18nProvider/I18nProvider.tsx
@@ -1,6 +1,6 @@
import * as React from 'react';
import React from 'react';
import { bind } from 'decko';
import * as Polyglot from 'node-polyglot';
import Polyglot from 'node-polyglot';

import { withProps } from 'shared/helpers/react';

Expand Down
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { bind } from 'decko';

import { Lang, ITranslateProps } from '../../namespace';
Expand Down
2 changes: 1 addition & 1 deletion src/services/i18n/view/withI18n/withI18n.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { Omit } from '_helpers';

import { ITranslateProps } from '../../namespace';
Expand Down
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { connect } from 'react-redux';
import { withRouter, RouteComponentProps } from 'react-router';
import MuiThemeProvider from '@material-ui/core/styles/MuiThemeProvider';
Expand Down
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { connect } from 'react-redux';
import { bind } from 'decko';

Expand Down
2 changes: 1 addition & 1 deletion src/shared/helpers/react/getFieldWithComponent.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { Field, FieldRenderProps, FieldProps as RFFieldProps } from 'react-final-form';
import { Omit, MergeRight } from '_helpers';

Expand Down
2 changes: 1 addition & 1 deletion src/shared/helpers/react/withProps.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { Omit } from '_helpers';

function withProps<P extends Partial<WP>, WP extends {}>(
Expand Down
2 changes: 1 addition & 1 deletion src/shared/helpers/withComponent.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { Omit } from 'react-redux';
import { GetProps } from '_helpers';

Expand Down
2 changes: 1 addition & 1 deletion src/shared/view/components/Footer/Footer.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import AppBar from '@material-ui/core/AppBar';
import Toolbar from '@material-ui/core/Toolbar';
import Typography from '@material-ui/core/Typography';
Expand Down
2 changes: 1 addition & 1 deletion src/shared/view/components/Header/Header.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import AppBar from '@material-ui/core/AppBar';
import Toolbar from '@material-ui/core/Toolbar';

Expand Down
2 changes: 1 addition & 1 deletion src/shared/view/elements/CheckboxInput/CheckboxInput.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { CheckIdentity } from '_helpers';
import FormControl, { FormControlProps } from '@material-ui/core/FormControl';
import FormHelperText, { FormHelperTextProps } from '@material-ui/core/FormHelperText';
Expand Down
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import CircularProgress, { CircularProgressProps } from '@material-ui/core/CircularProgress';

import { StylesProps, provideStyles } from './CircleProgressBar.style';
Expand Down
2 changes: 1 addition & 1 deletion src/shared/view/elements/Input/MaskedInput.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import * as R from 'ramda';
import { GetProps } from '_helpers';
import ReactTextMask from 'react-text-mask';
Expand Down
2 changes: 1 addition & 1 deletion src/shared/view/elements/Input/NumberInput.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import * as R from 'ramda';
import { MergeRight } from '_helpers';
import NumberFormat, { NumberFormatProps, NumberFormatValues } from 'react-number-format';
Expand Down
2 changes: 1 addition & 1 deletion src/shared/view/elements/Input/TextInput.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { bind } from 'decko';
import { MarkAsPartial, SubSet } from '_helpers';

Expand Down
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { CheckIdentity } from '_helpers';
import FormControl, { FormControlProps } from '@material-ui/core/FormControl';
import FormLabel, { FormLabelProps } from '@material-ui/core/FormLabel';
Expand Down
2 changes: 1 addition & 1 deletion src/shared/view/elements/RowsLayout/RowsLayout.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { provideStyles, StylesProps } from './RowsLayout.style';
import Grid from '@material-ui/core/Grid/Grid';

Expand Down
2 changes: 1 addition & 1 deletion src/shared/view/elements/Tooltip/Tooltip.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import MuiTooltip, { TooltipProps } from '@material-ui/core/Tooltip';

import { StylesProps, provideStyles } from './Tooltip.styles';
Expand Down
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { FieldRenderProps } from 'react-final-form';
import { GetProps } from '_helpers';

Expand Down
2 changes: 1 addition & 1 deletion src/shared/view/form/MaskedInputField/MaskedInputField.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { FieldRenderProps } from 'react-final-form';
import { GetProps } from '_helpers';

Expand Down
2 changes: 1 addition & 1 deletion src/shared/view/form/NumberInputField/NumberInputField.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { FieldRenderProps } from 'react-final-form';
import { GetProps } from '_helpers';

Expand Down
3 changes: 1 addition & 2 deletions src/shared/view/form/SelectField/SelectField.tsx
@@ -1,5 +1,4 @@
import * as React from 'react';

import React from 'react';
import { FieldRenderProps } from 'react-final-form';
import { GetProps } from '_helpers';

Expand Down
2 changes: 1 addition & 1 deletion src/shared/view/form/TextInputField/TextInputField.tsx
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { FieldRenderProps } from 'react-final-form';
import { GetProps } from '_helpers';

Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Expand Up @@ -27,7 +27,8 @@
"strictFunctionTypes": false,
"strictBindCallApply": true,
"sourceMap": true,
"resolveJsonModule": true
"resolveJsonModule": true,
"esModuleInterop": true,
},
"include": [
"src/**/*",
Expand All @@ -38,4 +39,4 @@
"awesomeTypescriptLoaderOptions": {
"useBabel": false
}
}
}
28 changes: 14 additions & 14 deletions webpack/common.ts
@@ -1,19 +1,19 @@
import * as path from 'path';
import * as webpack from 'webpack';
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
import * as CleanWebpackPlugin from 'clean-webpack-plugin';
import * as MiniCssExtractPlugin from 'mini-css-extract-plugin';
import * as CircularDependencyPlugin from 'circular-dependency-plugin';
import path from 'path';
import webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import CleanWebpackPlugin from 'clean-webpack-plugin';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import CircularDependencyPlugin from 'circular-dependency-plugin';
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
import * as ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import * as threadLoaderLib from 'thread-loader';
import * as FaviconsWebpackPlugin from 'favicons-webpack-plugin';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import threadLoaderLib from 'thread-loader';
import FaviconsWebpackPlugin from 'favicons-webpack-plugin';

import * as postcssReporter from 'postcss-reporter';
import * as postcssSCSS from 'postcss-scss';
import * as autoprefixer from 'autoprefixer';
import * as stylelint from 'stylelint';
import * as doiuse from 'doiuse';
import postcssReporter from 'postcss-reporter';
import postcssSCSS from 'postcss-scss';
import autoprefixer from 'autoprefixer';
import stylelint from 'stylelint';
import doiuse from 'doiuse';

import getEnvParams from '../src/core/getEnvParams';

Expand Down
2 changes: 1 addition & 1 deletion webpack/dev.config.ts
@@ -1,4 +1,4 @@
import * as webpack from 'webpack';
import webpack from 'webpack';

import { getCommonRules, commonConfig, getStyleRules, BuildType, getCommonPlugins } from './common';

Expand Down

0 comments on commit 7395ceb

Please sign in to comment.