The short story about ultimate web app architecture
Dominik Lubański
14.02.2018
Web Components enthusiast
Author of some JS on GitHub
React, Angular, Ember, etc.
Codebase in JavaScript
iOS / Android SDK
Codebase in Swift, Java, etc.
React Native, Angular + NativeScript,
Codebase in JavaScript
Cordova + React, Angular, Ember, etc.
Codebase in JavaScript
React, Angular, Ember, etc.
Codebase in JavaScript
react, react-isomorphic-render
redux, reselect, redux-form
webpack, universal-webpack, babel, eslint
cordova, cordova-plugin-*
Native Android App
PWA (JS, HTML, CSS)
.my-button {
color: black;
}
.my-button:hover,
.my-button:active {
color: red;
}
@Action // impl. touch and mouse events
class Button extends React.PureComponent {
static propTypes = {
isHover: PropTypes.bool,
isActive: PropTypes.bool,
...
}
render() {
const { isHover, isActive, ...props } = this.props;
const classes = classNames({ isHover, isActive });
return (
<button className={classes} {...props}>
...
</button>
);
}
}
Hybrid App (JS, HTML, CSS)
PWA (JS, HTML, CSS)
Hybrid App (JS, HTML, CSS)
Native App
PWA (JS, HTML, CSS)
@Action
export default class Button extends PureComponent {
...
render() {
...
return (
<Ripple
className={classes}
{...props}
hasAction
>
<Box
className={style.content}
as="span"
flex="row"
alignItems="center"
justifyContent="center"
>
{isPending && ...}
{children}
</Box>
</Ripple>
);
}
}
./components/
./views/