GithubHelp home page GithubHelp logo

chernysh / react-sweet-spot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chacestew/react-sweet-spot

0.0 2.0 0.0 201 KB

Skeleton for a modern React frontend application and server with great developer utility.

License: MIT License

JavaScript 100.00%

react-sweet-spot's Introduction

React Sweet Spot

Skeleton for a modern (PWA to-do) React frontend applicaton and server with great developer utility. Hopefully up to date.

Features

Setup

npm i then npm start for dev or npm run build && npm run serve for prod

Linting: Install the eslint plugin for your editor and enable autoFixOnSave (settings aready included for VS Code).

Reasoning

Why @loadable over React.Lazy for code splitting?

React Suspense doesn't support server rendering yet. @loadable gives us a few tools to do so: @loadable/server, @loadable/babel-plugin and @loadable/webpack-plugin. It was chosen for its clean API, good documentation and because it has the React team's recommendation.

Why CSS-in-JS?

It is the natural sidekick to code splitting as CSS co-exists with JS. The patterns it provides to declare reusable styles help to keep a codebase small and intentional. styled-components has great documentation, frequent updates and a big community. I haven't noticed runtime perf problems yet.

What is webpack-hot-server-middleware?

webpack-hot-server-middleware can watch for source changes and make hot updates to the server renderer. This is helpful to keep SSR working in development to approximate production, without having to restart the node process continually. To make it work with code splitting, the server bundle is created as a single chunk via webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 }).

To do

  • service worker cache
  • manifest.json
  • html meta

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.