Commit 3916a22a authored by Matija Obreza's avatar Matija Obreza
Browse files

SSR improvements

- webpack minimized CSS for production
- Must use `<Hidden implementation="css"` for SSR
parent cae3489a
......@@ -62,7 +62,7 @@ module.exports = {
screw_ie8: true,
warnings: false
},
comments: true
comments: false
}),
]
};
......@@ -19,10 +19,10 @@ module.exports = webpackMerge(commonConfig, {
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
// new webpack.LoaderOptionsPlugin({
// // minimize: true,
// // debug: false
// }),
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false
}),
// https://facebook.github.io/react/docs/optimizing-performance.html#use-the-production-build
new webpack.DefinePlugin({
......@@ -31,6 +31,7 @@ module.exports = webpackMerge(commonConfig, {
}
}),
//
new UglifyJsPlugin({
beautify: false,
mangle: {
......@@ -41,19 +42,18 @@ module.exports = webpackMerge(commonConfig, {
screw_ie8: true,
warnings: false
},
comments: true
comments: 'some',
}),
// Minify CSS
// new OptimizeCssAssetsPlugin({
// cssProcessor: require('cssnano'),
// cssProcessorOptions: {
// discardComments: {
// removeAll: true
// }
// },
// canPrint: true
// }),
new OptimizeCssAssetsPlugin({
cssProcessor: require('cssnano'),
cssProcessorOptions: {
discardComments: {
removeAll: true
}
},
canPrint: true
}),
]
});
......@@ -46,7 +46,7 @@ export class LoginService {
},
})
.then(({ data }) => {
console.log('checkTok', data);
// console.log('checkTok', data);
return data;
});
}
......
......@@ -56,7 +56,7 @@ class ExpandFiltersComponent extends React.Component<IExpandFiltersComponentProp
<Typography type="title" color="primary" className={ `pl-20 pt-10 pb-7 ${ classes.title }` }>
{ title }
</Typography>
<Hidden mdUp>
<Hidden implementation="css" mdUp>
<PlayArrow onClick={ this.handleFilterExpandClick }
className={ `${classes.expandArrow} ${ this.state.filterExpanded ? classes.arrowOpened : classes.arrowClosed }` }
/>
......
......@@ -24,7 +24,7 @@ class ContentHeader extends React.Component<IContentHeader , any> {
<Typography type="headline" color="accent">
{ title }
</Typography>
<Hidden mdDown>
<Hidden implementation="css" mdDown>
<Typography type="body2" color="accent">
{ subTitle }
</Typography>
......
......@@ -228,12 +228,12 @@ class PaginationComponent extends React.Component<IPaginationComponentProps, any
)
}
<div className={ isMobile ? classes.floatRight : classes.floatLeft }>
<Hidden mdUp>
<Hidden implementation="css" mdUp>
<span className={ classes.verticalAlign }>
<span className={ classes.bold }>{ pageObj ? pageObj.number + 1 : 0 }</span>/{ pageObj ? pageObj.totalPages : 0 }
</span>
</Hidden>
<Hidden only={ mobile }>
<Hidden implementation="css" only={ mobile }>
<Button
fab
color="inherit"
......@@ -253,7 +253,7 @@ class PaginationComponent extends React.Component<IPaginationComponentProps, any
>
<PlayArrow className={ classes.arrowRevert }/>
</Button>
<Hidden only={ mobile }>
<Hidden implementation="css" only={ mobile }>
<span className={ `${classes.checkedPage} ${classes.bold}` }>
{ pageObj ? pageObj.number + 1 : 0 }
</span>
......@@ -267,7 +267,7 @@ class PaginationComponent extends React.Component<IPaginationComponentProps, any
>
<PlayArrow/>
</Button>
<Hidden only={ mobile }>
<Hidden implementation="css" only={ mobile }>
<Button
fab
color="inherit"
......@@ -278,7 +278,7 @@ class PaginationComponent extends React.Component<IPaginationComponentProps, any
<FastForward/>
</Button>
</Hidden>
<Hidden only={ mobile }>
<Hidden implementation="css" only={ mobile }>
<span className={ classes.verticalAlign }>of { pageObj ? pageObj.totalPages : 0 } pages</span>
</Hidden>
</div>
......
......@@ -64,7 +64,7 @@ class BrowseMenu extends React.Component<IBrowseMenuProps, any> {
<div>
<Typography type="title" color="primary" className={ `pl-20 pt-10 pb-10 ${ classes.ulTitle }` }>BROWSE</Typography>
<Hidden mdUp>
<Hidden implementation="css" mdUp>
<PlayArrow onClick={ this.handleExpandClick }
className={ `${classes.expandArrow} ${ this.state.expanded ? classes.arrowOpened : classes.arrowClosed }` }
/>
......
......@@ -287,15 +287,15 @@ class DetailInfo extends React.Component<IDetailInfoProps, any> {
</Typography>
</Grid>
<Grid item xs={ 12 } md={ 12 } lg={ 9 } className={ `${classes.gray} ${classes.rightTextWrapper} ${classes.centerAlign}` }>
<Hidden mdDown>
<Hidden implementation="css" mdDown>
{ e.originalFilename }
</Hidden>
<Hidden mdDown>
<Hidden implementation="css" mdDown>
<a href={ `/proxy/api/v0/repository/download/${e.uuid}` }><Button raised component="span" className={ `${classes.buttonGreen} ${classes.button}` }>
Download
</Button></a>
</Hidden>
<Hidden mdUp>
<Hidden implementation="css" mdUp>
<a href={ `/proxy/api/v0/repository/download/${e.uuid}` }><Button raised component="span" className={ `${classes.buttonGreen} ${classes.button}` }>
Download dataset
</Button></a>
......
......@@ -42,7 +42,7 @@ const TopSection = ({classes}) => (
<Typography type="headline">
Phenotypic dataset publisher
</Typography>
<Hidden smDown>
<Hidden implementation="css" smDown>
<Typography type="body2" color="accent">
Publish your datasets
</Typography>
......@@ -54,7 +54,7 @@ const TopSection = ({classes}) => (
</Typography>
<div className={ classes.flexGrow }/>
<div className={ classes.guide }>
<Hidden smDown>
<Hidden implementation="css" smDown>
<div>
<span>
New in the data publication process?
......@@ -67,7 +67,7 @@ const TopSection = ({classes}) => (
</Button>
</div>
</Hidden>
<Hidden mdUp>
<Hidden implementation="css" mdUp>
<Button raised className={ classes.headerButton }>
CATALOG
</Button>
......
......@@ -201,7 +201,7 @@ class SearchMenu extends React.Component<ISearchMenuProps, any> {
} }
/>
<div className={ classes.flexGrow }/>
<Hidden mdUp>
<Hidden implementation="css" mdUp>
<IconButton
className={ classNames(classes.expand, {
[classes.expandOpen]: this.state.expanded,
......
......@@ -19,7 +19,7 @@ class Summary extends React.Component<ISummaryProps, any> {
const {paged} = this.props;
return (
<Hidden smDown>
<Hidden implementation="css" smDown>
<Grid item xs={ 12 } md={ 3 }>
<Paper className="mt-20 mr-20" square>
<div className="pl-20 pt-10 pb-10">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment