{"id":17449439,"url":"https://github.com/klaemo/react-es6","last_synced_at":"2026-02-20T23:39:23.999Z","repository":{"id":28562823,"uuid":"32080353","full_name":"klaemo/react-es6","owner":"klaemo","description":"React's official tutorial with ES6 and Browserify","archived":false,"fork":false,"pushed_at":"2016-04-27T21:10:46.000Z","size":858,"stargazers_count":78,"open_issues_count":0,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-13T05:48:16.766Z","etag":null,"topics":["es2015","react","tutorial"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/klaemo.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-12T14:08:26.000Z","updated_at":"2021-12-26T06:50:37.000Z","dependencies_parsed_at":"2022-08-02T12:18:43.944Z","dependency_job_id":null,"html_url":"https://github.com/klaemo/react-es6","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/klaemo/react-es6","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klaemo%2Freact-es6","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klaemo%2Freact-es6/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klaemo%2Freact-es6/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klaemo%2Freact-es6/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/klaemo","download_url":"https://codeload.github.com/klaemo/react-es6/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klaemo%2Freact-es6/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29667868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T23:24:07.480Z","status":"ssl_error","status_checked_at":"2026-02-20T23:24:06.202Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["es2015","react","tutorial"],"created_at":"2024-10-17T21:40:02.777Z","updated_at":"2026-02-20T23:39:23.978Z","avatar_url":"https://github.com/klaemo.png","language":"JavaScript","readme":"# React + Browserify + Babel = Future\n\nI wanted to get familiar with React while also continuing to use browserify. Also, ES6 seems cool. So, I took the [official React tutorial](https://facebook.github.io/react/docs/tutorial.html) and wrote it as CommonJS modules and added some ES6 sugar where appropriate.\n\n## Usage\n\nClone this repository and run:\n```\nnpm install\nnpm start\n```\n\nThis will install all the necessary dependencies, start the server and watch your code for changes\nso it'll get transpiled ([Babel](http://babeljs.io)) and bundled ([browserify](http://browserify.org)) on the fly.\n\n`npm run build` will build a minified \"production\" version.\n\n## Libraries\n\nHere and there I opted to use different libraries than in the original tutorial. Notably\n\n- `marked` instead of `showdown` because the latter isn't compatible with browserify.\n- `whatwg-fetch` (the [proposed](https://fetch.spec.whatwg.org/) replacement for XHR) instead of jquery.\n\n## Babel\n\nAs of Babel 6.0 we need to explicitly install all the presets we want to use. For this tutorial that's\ngoing to be `babel-preset-react` for the React related transforms and `babel-preset-es2015` for the ES6/ES2015\nsyntax.\n\nThe presets are enabled in `.babelrc`.\n\n## Result\n\nI particularly like how `fetch` and ES6 arrow functions transformed this:\n\n```javascript\n$.ajax({\n  url: this.props.url,\n  dataType: 'json',\n  success: function(data) {\n    this.setState({data: data});\n  }.bind(this),\n  error: function(xhr, status, err) {\n    console.error(this.props.url, status, err.toString());\n  }.bind(this)\n});\n```\n\n...into this:\n```javascript\nfetch(this.props.url)\n  .then(response =\u003e response.json())\n  .then(data =\u003e this.setState({ data: data }))\n  .catch(err =\u003e console.error(this.props.url, err.toString()))\n```\n\nAfter the update to `react 0.14` I decided to use the `class` syntax as well as stateless components\nand switch to ES6 style exports/imports.\n\n## Contributing\n\nJust open an issue or pull request or whateveer :)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklaemo%2Freact-es6","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fklaemo%2Freact-es6","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklaemo%2Freact-es6/lists"}