npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

universal-typescript-react

v1.0.3

Published

React + TypeScript + Webpack 4 + Karma + Enzyme + HMR

Downloads

13

Readme

Universal TypeScript + React

Your React + TypeScript Swiss Army knife

Build Status npm version Dependencies

Universal and up to date configuration with TypeScript and React and all modern frontend essentials, including dynamic imports, server-side rendering with prehydration and full hot module reload. Not forgetting about styles and all you need to develop webapps. Typesafely! 🙃

Heavily inspiried/influenced by: https://github.com/gaearon/react-hot-boilerplate/ https://github.com/piotrwitek/react-redux-typescript-guide

Quick checklist:

  • [x] Node 8
  • [x] Yarn 1.5
  • [x] Webpack 4
  • [x] TypeScript 2 (+ ts-loader)
  • [x] TypeScript import alias
  • [x] React 16+
  • [x] Sourcemaps (prod + dev + tests)
  • [x] HMR (with local state keeping)
  • [x] fork-ts-checker (async compile)
  • [x] tslint
  • [x] Promise polyfill
  • [x] Tests (Karma + Jasmine)
  • [x] Enzyme (for React)
  • [x] Splitted dev/prod configs
  • [x] Vendor bundle/chunks
  • [x] Styles support (LESS/SASS/PostCSS)
  • [x] One CSS file per bundle (ExtractTextPlugin)
  • [x] React Router
  • [x] Redux
  • [x] Redux Thunk
  • [x] Redux Dev Tools
  • [x] Universal rendering
  • [x] Redux state prehydration
  • [x] Server support for router paths
  • [x] Webpack Environment plugin
  • [x] Dynamic imports (Loadable) 🎆
  • [x] Styleguidist
  • [x] i18next

Prerequisites

Yarn >= 1.0 Node >= 8.0

yarn global add typescript tslint

App development

Install dependencies, test if all glues together and run the development server

yarn install
yarn test
yarn start
open http://localhost:3000

Test watch mode

yarn test:watch

Components development

This project integrates styleguidist for components development

yarn styleguidist
open http://localhost:6060

Production

A simple production setup: headless tests, prod build and run server. Build puts artifacts into the dist directory and server should run from there

yarn test:phantom
yarn build
yarn server

SSR

An example of the server-side rendering with the state prehydration.

yarn ssr-server

Todos:

  • [x] Check preload dynamic imports with Loadable on the server side and in tests
  • [ ] Hot reload of styles in the styleguidist (to avoid manual refresh css)
  • [ ] Consider hot reload of styles in the HMR mode
  • [ ] Loadable prefetch