fast-refresh-express
fast-refresh-express copied to clipboard
Example with express, react, styled components, typescript, SSR, and react fast refresh
fast-refresh-express
Example with:
- Express
- React v18
- styled-components
- TypeScript
-
SWC
- Using swc-loader for webpack
- with the help of @swc/plugin-styled-components
- and @swc/cli to build server for production
- and @swc/register to compile server-side TypeScript at runtime for dev
- with tests using @swc/jest
-
React Fast Refresh
- Using @pmmmwh/react-refresh-webpack-plugin
- and webpack-hot-middleware (thanks to @gatsbyjs/webpack-hot-middleware)
- Server side rendering
About React 18 streaming render
Currently, streaming render in React 18 + styled-components has some issues. Current rendering setup right not isn't ideal maybe, but it works!
Like to use loadable-components?
Checkout the loadable-components branch!
Like to use babel?
Checkout the babel branch!
How to run locally
Start: npm run dev
Runs at: http://localhost:3000
How to run in production
Build: npm run build
Start: npm start
How to test
npm test