All Projects → insin → React Heatpack

insin / React Heatpack

Licence: mit
A 'heatpack' command for quick React development with webpack hot reloading

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Heatpack

Miniproxy
🚨⚠️ UNMAINTAINED! ⚠️🚨 A simple PHP web proxy.
Stars: ✭ 810 (+128.81%)
Mutual labels:  deprecated, unmaintained
Tgcameraviewcontroller
Custom camera with AVFoundation. Beautiful, light and easy to integrate with iOS projects.
Stars: ✭ 1,432 (+304.52%)
Mutual labels:  deprecated, unmaintained
React Axe
[DEPRECATED] Accessibility auditing for React.js applications
Stars: ✭ 1,201 (+239.27%)
Mutual labels:  deprecated, unmaintained
Vagrant Librarian Chef
*UNMAINTAINED* A Vagrant plugin to install Chef cookbooks using Librarian-Chef.
Stars: ✭ 80 (-77.4%)
Mutual labels:  deprecated, unmaintained
passion
An object-oriented LÖVE game engine
Stars: ✭ 35 (-90.11%)
Mutual labels:  deprecated, unmaintained
Axe Cli
[Deprecated] A command-line interface for the aXe accessibility testing engine
Stars: ✭ 419 (+18.36%)
Mutual labels:  deprecated, unmaintained
Framework7 With Angularjs Demo App
⛔️ Unmaintained and deprecated!
Stars: ✭ 81 (-77.12%)
Mutual labels:  deprecated, unmaintained
Msx
JSX for Mithril.js 0.x
Stars: ✭ 370 (+4.52%)
Mutual labels:  deprecated, unmaintained
Deprecated Mapbox Ios Sdk
REPLACED – use https://www.mapbox.com/ios-sdk instead
Stars: ✭ 325 (-8.19%)
Mutual labels:  deprecated, unmaintained
django-snow
ServiceNow Ticket Management App for Django based projects
Stars: ✭ 16 (-95.48%)
Mutual labels:  deprecated, unmaintained
Cudlr
⛔️ [DEPRECATED] Console for Unity Debugging and Logging Remotely
Stars: ✭ 167 (-52.82%)
Mutual labels:  deprecated, unmaintained
jade-babel
Jade plugin for Babel
Stars: ✭ 39 (-88.98%)
Mutual labels:  deprecated, unmaintained
cleverbot
Deprecated/unmaintained. See https://www.cleverbot.com/api/
Stars: ✭ 23 (-93.5%)
Mutual labels:  deprecated, unmaintained
addon-sdk-content-scripts
DEPRECATED | Use WebExtensions instead | Add-ons demonstrating how to use content scripts in the Add-on SDK.
Stars: ✭ 23 (-93.5%)
Mutual labels:  deprecated, unmaintained
Weka
Now redundant weka mirror. Visit https://github.com/Waikato/weka-trunk for the real deal
Stars: ✭ 304 (-14.12%)
Mutual labels:  deprecated
Wpaint
jQuery Paint Plugin
Stars: ✭ 332 (-6.21%)
Mutual labels:  deprecated
Simpleauthentication
⛔️ [DEPRECATED] A really simple way for developers to add "Social Authentication" to their ASP.NET web application
Stars: ✭ 299 (-15.54%)
Mutual labels:  deprecated
Redditkit
An Objective-C wrapper for the reddit API
Stars: ✭ 299 (-15.54%)
Mutual labels:  unmaintained
Sphero.js
🚫 DEPRECATED: The Sphero JavaScript SDK to control Sphero robots.
Stars: ✭ 346 (-2.26%)
Mutual labels:  deprecated
H5ive Deprecated
**DEPRECATED** A collection of thin facade APIs wrapped around HTML5 JavaScript features.
Stars: ✭ 332 (-6.21%)
Mutual labels:  deprecated

DEPRECATED

If you want to quickly prototype React apps without setting up a project, try nwb's react command instead.

If you want something to tweak and iterate on React components, try Carte Blanche, Cosmos or React Storybook


react-heatpack

heatpack npm package

A heatpack command for quick React development with webpack hot reloading.

Usage

Install the heatpack command globally:

npm install -g react-heatpack

Call heatpack with the path to a module which either:

  • runs ReactDOM.render(...),
  • exports a single React component,
  • or exports a React element (e.g. module.exports = <div></div>)

For example:

$ cat > index.js
import React from 'react'

export default React.createClass({
  render() {
    return <div>Hello worlds!</div>
  }
})

$ heatpack index.js
react-heatpack listening at localhost:3000
webpack built d32ba06f966491387326 in 2075ms

Open http://localhost:3000/ and your app will be served and will be hot reloaded with any changes you make.

"Hello worlds!"? Let's fix that typo:

hot reloading example

Syntax errors or errors in render() methods will be displayed on the screen.

Use cases

  • Quick development and experimentation without the inertia of having to create config files and configure development dependencies up-front.

  • Creating Gists which can be cloned, npm installed and npm started when you want to share code, instead of having to create and host a static build, e.g. React Form Play

Configured loaders

Webpack loaders are configured for the following:

JavaScript

JavaScript modules can have .js or .jsx extensions and will be transformed with Babel (version 5), so you can use:

You can also require .json files as normal.

CSS

Require CSS files from your JavaScript as if they were any other module, e.g.:

require('./Widget.css')

Styles will be automatically applied to the page and hot reloaded when you make a change.

Vendor prefixes will be automatically applied to your CSS, as necessary.

Images and font files referenced from your CSS will also be handled for you.

See the css-loader documentation for more information on what webpack allows you to do when you start using require() for CSS.

Images

Require image files from your JavaScript as if they were any other module, e.g.:

<img src={require('./logo.png')}/>

Small images will be inlined as data: URIs and larger images will be served up by webpack.

Gotcha avoidance

Root element

Since you should never render to document.body, the page served up by heatpack includes a <div id="app"></div> element for your app to render into.

Tips & tricks

Single-file hot reloading with multiple components

If you define and render a bunch of React components in the same module, they can still be hot reloaded.

This can be handy for quickly hacking together something which needs multiple components without having to create separate modules for them:

var React = require('react')
var ReactDOM = require('react-dom')

var App = React.createClass({
  render() {
    return <div><Menu/><Content/></div>
  }
})
var Menu = React.createClass({
  render() {
    return <nav><ul><li>Item</li></ul></nav>
  }
})
var Content = React.createClass({
  render() {
    return <section><h1>Content</h1></section>
  }
})

ReactDOM.render(<App/>, document.querySelector('#app'))

Heatpack in a Tweet

cat << ^D > index.js
import React from 'react'
export default () => <div>#reactjs</div>
^D
npm install -g react-heatpack
heatpack index.js

Beyond heatpack

Check out rwb: the React workbench, which serves and creates production builds for React apps without having to set up your own build tools.

Alternatively if you want set up your own webpack config for a production build, these resources should be useful:

  • petehunt/webpack-howto is a great place to start for the most common "How do I configure X?" questions about webpack.

  • cesarandreu/web-app describes itself as a "reasonable starting point for building a web app" - as such, it probably doesn't have everything you'll end up needing, but it's a working out-of-the-box example of building for dev, test and production, with meticulously-commented webpack config which links out to relevant documentation and other resources.

  • SurviveJS - Webpack and React - while this entire book is a useful reference for working with React and webpack, the Deploying Applications chapter is of particular interest for putting together a production build.

MIT Licensed

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].