Install, build and debug a react native app in WSL2 (Windows Subsystem for Linux) and Ubuntu.
This is based on the marvellous blog posting by Oliver Zampieri.
This howto is written to create a self signed SSL NginX proxy on MacOS to
- Expose proxy at local host port
5001
- Connect the port
5001
to port443
inside Docker - Proxy the port
443
to port5000
on the host computer
This means that:
Feel free to contact me at robert.balicki@gmail.com or tweet at me @statisticsftw
This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!
It assumes some knowledge of AWS.
import {Action, ActionCreator, Dispatch} from 'redux'; | |
import {ThunkAction} from 'redux-thunk'; | |
// Redux action | |
const reduxAction: ActionCreator<Action> = (text: string) => { | |
return { | |
type: SET_TEXT, | |
text | |
}; | |
}; |
I made a little styling lib called glam
(some features are in development)
let's start off with the simplest use case. we'll make an 'index.html' page,
and assume we've setup our js bundler to output bundle.js
import { Component } from 'preact'; | |
export default class PureComponent extends Component { | |
shouldComponentUpdate(props, state) { | |
return !(shallowEqual(props, this.props) && shallowEqual(state, this.state)); | |
} | |
} | |
function shallowEqual(a, b) { | |
for (let key in a) if (a[key]!==b[key]) return false; |
import authDoor from 'hoc/auth-door' | |
import Loadable from 'react-loadable'; | |
import Loading from './Loading' | |
const Dashboard = Loadable({ | |
loader: () => import('pages/Dashboard'), | |
LoadingComponent: Loading, | |
// optional options... | |
delay: 200, | |
serverSideRequirePath: path.join(__dirname, 'pages/Dashboard'), |
import * as React from 'react'; | |
declare class SomeReactComponent extends React.Component<SomeReactComponentProps, any> {} | |
interface SomeReactComponentProps { | |
className?: string; | |
toggle?: boolean; | |
name: string; | |
size?: 'lg' | '2x' | '3x' | '4x' | '5x'; | |
} |
I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.
I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.
Chrome 51 has some pretty wild behaviour related to console.log
in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.
(My opinionated view as an Express developer)
Check this post: http://matt-harrison.com/moving-from-express-to-hapi-js/ and how to use Hapi plugins: https://gist.github.com/hueniverse/f01faf422eb038d87d57 written by Hapi creator Eran Hammer.