Skip to content

stepanh/stehil

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

This is the source of stehil.com

This may be useful if you are building a React app and want to make it easy for Google Bot & friends to index your site - so you need SSR and good SEO. Otherwise use react-create-app.

The Stack

This stack is used here just for kicks, it's not needed for a static blog. Just a playground to try things out.

What this can do

  • SSR
  • code-splitting (async-loaded routes)

Why Razzle & after.js instead of next.js?

  • Next gives you less freedom in what your URLs can look like by default.
  • Next is a big library.
  • Razzle's hot reloading is nicer than what you get with next.
  • Disclaimer: I haven't tried Next v6/v7 properly, it should be lot better than the v4 I've used.

Why TypeScript

Yes, it's a bit of a pain to get it working right initially. Later on, it can be a head scratcher to get types working well, especially if you are going for maximum strictness™. But it's so worth it, especially if you are working in a team, or are a bit forgetful. Node.js with TypeScript is safer for me than Java ever was. Win!

Why SCSS

  • CSS-in-JS solutions look nice. But they all increase bundle size and steal a bit of runtime performance.
  • Yes, you're not getting guaranteed encapsulation with SCSS - but it's trivial to fix conflicting styles.

Troubleshooting

  1. Getting a weird Typescript error? It might just be an issue with Yarn or NPM. Try
rm -rf ./node_modules && rm yarn.lock && yarn
  1. fsevents issue when running tests? Try expo/expo#854 (comment)

TODOs

  • Example of lazy (code-split) route
  • Example of internal API
  • Revisit Main.tsx routing
  • Build and deploy with now.sh V1
  • Build with now.sh V2
  • Deploy with now.sh V2
  • Deploy to to Google AppEngine Standard Environment node.js

About

Source of my personal site. Built with React 'n hooks, SSR, Razzle, after.js and TypeScript. Deployed on Now.

Resources

Stars

Watchers

Forks

Packages

No packages published