All Projects → klaemo → React Es6

klaemo / React Es6

React's official tutorial with ES6 and Browserify

Programming Languages

javascript
184084 projects - #8 most used programming language
es2015
71 projects

Projects that are alternatives of or similar to React Es6

Learn Vim
Vim 实操教程(Learning Vim)Vim practical tutorial.
Stars: ✭ 1,166 (+1414.29%)
Mutual labels:  tutorial
Deep learning for biologists with keras
tutorials made for biologists to learn deep learning
Stars: ✭ 74 (-3.9%)
Mutual labels:  tutorial
Kanban Board
A sample application demonstrating a basic kanban board, seeded with vue-cli
Stars: ✭ 76 (-1.3%)
Mutual labels:  tutorial
Allstate capstone
Allstate Kaggle Competition ML Capstone Project
Stars: ✭ 72 (-6.49%)
Mutual labels:  tutorial
Radial Snake
A tutorial for creating a Tron-style game
Stars: ✭ 73 (-5.19%)
Mutual labels:  tutorial
Scenario Based Labs
Cosmos DB oriented labs for IoT and Retail scenarios
Stars: ✭ 75 (-2.6%)
Mutual labels:  tutorial
Awesome Cloud Native Tutorials
A curated list of tutorials and labs for learning cloud native concepts
Stars: ✭ 70 (-9.09%)
Mutual labels:  tutorial
Uc R.github.io
Main repository for R programming courses @ University of Cincinnati, courses and tutorials that focus on data wrangling, exploration, visualization, and analysis with R.
Stars: ✭ 76 (-1.3%)
Mutual labels:  tutorial
Movie
使用flutter打造一款像样的电影类App
Stars: ✭ 74 (-3.9%)
Mutual labels:  tutorial
Pycontw2013tutorial
Python Conference Taiwan 2013 Tutorial
Stars: ✭ 75 (-2.6%)
Mutual labels:  tutorial
Learn Javascript With Hedwix
Master the fundamentals of JavaScript and take your programming skills to the next level
Stars: ✭ 73 (-5.19%)
Mutual labels:  tutorial
Hackcv Translate
HackCV网站文章翻译
Stars: ✭ 73 (-5.19%)
Mutual labels:  tutorial
Gistlyn
Run Roslyn Gists
Stars: ✭ 75 (-2.6%)
Mutual labels:  tutorial
Vos backend
vangav open source - backend; a backend generator (generates more than 90% of the code needed for big scale backend services)
Stars: ✭ 71 (-7.79%)
Mutual labels:  tutorial
Expo Three Demo
🍎👩‍🏫 Collection of Demos for THREE.js in Expo!
Stars: ✭ 76 (-1.3%)
Mutual labels:  tutorial
Images example
A simple example program made for the 42 students going into the graphic branch. Its purpose is to help them understanding the way images are working in the MLX (the graphcal lib we use).
Stars: ✭ 69 (-10.39%)
Mutual labels:  tutorial
Nlp Tutorial
Natural Language Processing Tutorial for Deep Learning Researchers
Stars: ✭ 9,895 (+12750.65%)
Mutual labels:  tutorial
Ios Coremotion Example
Core Motion in iOS using Swift
Stars: ✭ 77 (+0%)
Mutual labels:  tutorial
Python Notes
Python Study Notes 📝
Stars: ✭ 76 (-1.3%)
Mutual labels:  tutorial
Go Collection
🌷 awesome awesome go, study golang from basic to proficient
Stars: ✭ 1,193 (+1449.35%)
Mutual labels:  tutorial

React + Browserify + Babel = Future

I wanted to get familiar with React while also continuing to use browserify. Also, ES6 seems cool. So, I took the official React tutorial and wrote it as CommonJS modules and added some ES6 sugar where appropriate.

Usage

Clone this repository and run:

npm install
npm start

This will install all the necessary dependencies, start the server and watch your code for changes so it'll get transpiled (Babel) and bundled (browserify) on the fly.

npm run build will build a minified "production" version.

Libraries

Here and there I opted to use different libraries than in the original tutorial. Notably

  • marked instead of showdown because the latter isn't compatible with browserify.
  • whatwg-fetch (the proposed replacement for XHR) instead of jquery.

Babel

As of Babel 6.0 we need to explicitly install all the presets we want to use. For this tutorial that's going to be babel-preset-react for the React related transforms and babel-preset-es2015 for the ES6/ES2015 syntax.

The presets are enabled in .babelrc.

Result

I particularly like how fetch and ES6 arrow functions transformed this:

$.ajax({
  url: this.props.url,
  dataType: 'json',
  success: function(data) {
    this.setState({data: data});
  }.bind(this),
  error: function(xhr, status, err) {
    console.error(this.props.url, status, err.toString());
  }.bind(this)
});

...into this:

fetch(this.props.url)
  .then(response => response.json())
  .then(data => this.setState({ data: data }))
  .catch(err => console.error(this.props.url, err.toString()))

After the update to react 0.14 I decided to use the class syntax as well as stateless components and switch to ES6 style exports/imports.

Contributing

Just open an issue or pull request or whateveer :)

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].