Coder Social home page Coder Social logo

javierarmendariz / typescript-reactjs-flux-webpack Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 348 KB

A sample tutorial project that demonstrates the use of typescript, reactjs, Facebook flux and webpack. Heavily commented sources

CSS 4.00% HTML 3.89% TypeScript 78.03% JavaScript 14.08%

typescript-reactjs-flux-webpack's Introduction

typescript-reactjs-flux-webpack

A sample project that demonstrates the use of

  • Webpack as the building tool
  • Typescript as the main programming language
  • ReactJS in Typescript
  • Embedding JSX inside Typescript with the help of the webpack tx-jsx-loader
  • The basic use of Flux
  • Using LESS with webpack

Tutorial

For a progressive approach, the project should be cloned then checked out by version (see Installing below)

  • v1.0 demonstrates a simple Hello World in ReactJS and the use of webpack ( No React Components, no Flux classes)
  • v2.0 demonstrates a simple React Component in Typescript an the use of Props and State
  • v3.0 demonstrates a simple Flux app with the updated v2.0 React Component

Files are rather heavily commented. Some comments may have been removed between versions. Start by understanding the webpack config file, then move on to app.ts, then the Counter Component, then the Flux classes

jQuery is referenced but NOT used in the first 3 versions. A v4.0 may follow to show how to use jQuery at the React Compoenent level.

Installing

Clone this repo locally using git clone then run npm install in the root directory of the project

Checkout the version 1.0 using git checkout -b version1 v1.0

When you are done playing with v1.0, move to v2.0 using git checkout -b version2 v2.0.

etc...

Building and running

Simple To build simply run ./node_modules/.bin/webpack. A public/js/generated/bundle.js file will be generated Open public/index.html in a browser.

Hot Reload Alternatively, and very useful when developing, run node_modules/.bin/webpack-dev-server -d --colors --content-base public/ --hot --inlin

Then open your browser at http://localhost:8080/webpack-dev-server/

Any change made to a LESS file will be "hot reloaded" on the page. A change to a Typescript file will trigger a new transpilation and a full reloading of the page (hot reload is not yet available for Typescript)

License

MIT

typescript-reactjs-flux-webpack's People

Contributors

bgrieder avatar

Watchers

James Cloos avatar Javier Armendariz avatar

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.