From 29e585535df63697f3b736677d3d8ac596e5ad90 Mon Sep 17 00:00:00 2001 From: Nat Alison Date: Wed, 6 Feb 2019 16:51:44 -0800 Subject: [PATCH 01/13] first run --- scripts/generateHeaderIDs.js | 64 ++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 scripts/generateHeaderIDs.js diff --git a/scripts/generateHeaderIDs.js b/scripts/generateHeaderIDs.js new file mode 100644 index 000000000..cdcd4a5e3 --- /dev/null +++ b/scripts/generateHeaderIDs.js @@ -0,0 +1,64 @@ +const fs = require('fs'); + +function walk(dir) { + let results = []; + const list = fs.readdirSync(dir); + list.forEach(function(file) { + file = dir + '/' + file; + const stat = fs.statSync(file); + if (stat && stat.isDirectory()) { + /* Recurse into a subdirectory */ + results = results.concat(walk(file)); + } else { + /* Is a file */ + results.push(file); + } + }); + return results; +} + +function generateID(text) { + return text + .toLowerCase() + .replace(/\s/g, '-') + .replace(/[^-a-z0-9]/g, ''); +} + +function addHeaderID(line) { + // check if we're a header at all + if (!line.startsWith('#')) return; + // check if it already has an id + if (/\{#[-A-Za-z0-9]+\}/.match(line)) return; + const headingText = line.slice(line.indexOf(' ')).trim(); + const headingLevel = line.slice(0, line.indexOf(' ')); + return `${headingLevel} ${headingText} ${generateID(headingText)}`; +} + +function addHeaderIDs(lines) { + let inCode = false; + const results = []; + lines.forEach(line => { + // Ignore code blocks + if (line.startsWith('```')) { + inCode = !inCode; + return; + } + if (inCode) { + results.push(line); + } + + results.push(addHeaderID(line)); + }); +} + +const [path] = process.argv.slice(2); + +const files = walk(path); +files.forEach(file => { + if (!file.endsWith('.md')) return; + + const file = fs.readFileSync(file, 'utf8'); + const lines = file.split('\n'); + const updatedLines = addHeaderIDs(lines); + fs.writeFileSync(file, updatedLines.join('\n')); +}); From 0a45ebfa5ff6fb858ac5f2c074c9187dd0ba9800 Mon Sep 17 00:00:00 2001 From: Nat Alison Date: Wed, 6 Feb 2019 16:56:54 -0800 Subject: [PATCH 02/13] update script --- scripts/generateHeaderIDs.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/generateHeaderIDs.js b/scripts/generateHeaderIDs.js index cdcd4a5e3..77153ecee 100644 --- a/scripts/generateHeaderIDs.js +++ b/scripts/generateHeaderIDs.js @@ -26,12 +26,12 @@ function generateID(text) { function addHeaderID(line) { // check if we're a header at all - if (!line.startsWith('#')) return; + if (!line.startsWith('#')) return line; // check if it already has an id - if (/\{#[-A-Za-z0-9]+\}/.match(line)) return; + if (/\{#[-A-Za-z0-9]+\}/.test(line)) return line; const headingText = line.slice(line.indexOf(' ')).trim(); const headingLevel = line.slice(0, line.indexOf(' ')); - return `${headingLevel} ${headingText} ${generateID(headingText)}`; + return `${headingLevel} ${headingText} {#${generateID(headingText)}}`; } function addHeaderIDs(lines) { @@ -41,14 +41,17 @@ function addHeaderIDs(lines) { // Ignore code blocks if (line.startsWith('```')) { inCode = !inCode; + results.push(line); return; } if (inCode) { results.push(line); + return; } results.push(addHeaderID(line)); }); + return results; } const [path] = process.argv.slice(2); @@ -57,8 +60,8 @@ const files = walk(path); files.forEach(file => { if (!file.endsWith('.md')) return; - const file = fs.readFileSync(file, 'utf8'); - const lines = file.split('\n'); + const content = fs.readFileSync(file, 'utf8'); + const lines = content.split('\n'); const updatedLines = addHeaderIDs(lines); fs.writeFileSync(file, updatedLines.join('\n')); }); From 6a50996b7f7ade012c4cf6869584f35e3f557d9b Mon Sep 17 00:00:00 2001 From: Nat Alison Date: Wed, 6 Feb 2019 17:18:56 -0800 Subject: [PATCH 03/13] only update script and stuff --- package.json | 3 ++- .../{generateHeaderIDs.js => generateHeadingIDs.js} | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) rename scripts/{generateHeaderIDs.js => generateHeadingIDs.js} (90%) diff --git a/package.json b/package.json index d050abaf5..0dd174fb9 100644 --- a/package.json +++ b/package.json @@ -72,12 +72,13 @@ }, "scripts": { "build": "gatsby build", - "check-all": "npm-run-all prettier --parallel lint flow", + "check-all": "npm-run-all prettier generate-ids --parallel lint flow", "ci-check": "npm-run-all prettier:diff --parallel lint flow", "dev": "gatsby develop -H 0.0.0.0", "flow": "flow", "format:source": "prettier --config .prettierrc --write \"{gatsby-*.js,{flow-typed,plugins,src}/**/*.js}\"", "format:examples": "prettier --config examples/.prettierrc --write \"examples/**/*.js\"", + "generate-ids": "node scripts/generateHeadingIDs.js content", "lint": "eslint .", "netlify": "yarn --version && rimraf node_modules && yarn install --frozen-lockfile --check-files && yarn build", "nit:source": "prettier --config .prettierrc --list-different \"{gatsby-*.js,{flow-typed,plugins,src}/**/*.js}\"", diff --git a/scripts/generateHeaderIDs.js b/scripts/generateHeadingIDs.js similarity index 90% rename from scripts/generateHeaderIDs.js rename to scripts/generateHeadingIDs.js index 77153ecee..63e804027 100644 --- a/scripts/generateHeaderIDs.js +++ b/scripts/generateHeadingIDs.js @@ -26,9 +26,13 @@ function generateID(text) { function addHeaderID(line) { // check if we're a header at all - if (!line.startsWith('#')) return line; + if (!line.startsWith('#')) { + return line; + } // check if it already has an id - if (/\{#[-A-Za-z0-9]+\}/.test(line)) return line; + if (/\{#[-A-Za-z0-9]+\}/.test(line)) { + return line; + } const headingText = line.slice(line.indexOf(' ')).trim(); const headingLevel = line.slice(0, line.indexOf(' ')); return `${headingLevel} ${headingText} {#${generateID(headingText)}}`; @@ -58,7 +62,9 @@ const [path] = process.argv.slice(2); const files = walk(path); files.forEach(file => { - if (!file.endsWith('.md')) return; + if (!file.endsWith('.md')) { + return; + } const content = fs.readFileSync(file, 'utf8'); const lines = content.split('\n'); From 5a37071ecd530541100d6804e97d3f6c7fb75638 Mon Sep 17 00:00:00 2001 From: Nat Alison Date: Wed, 6 Feb 2019 17:21:56 -0800 Subject: [PATCH 04/13] use githubslugger --- scripts/generateHeadingIDs.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/generateHeadingIDs.js b/scripts/generateHeadingIDs.js index 63e804027..eb3621340 100644 --- a/scripts/generateHeadingIDs.js +++ b/scripts/generateHeadingIDs.js @@ -1,4 +1,5 @@ const fs = require('fs'); +const GithubSlugger = require('github-slugger'); function walk(dir) { let results = []; @@ -24,7 +25,7 @@ function generateID(text) { .replace(/[^-a-z0-9]/g, ''); } -function addHeaderID(line) { +function addHeaderID(line, slugger) { // check if we're a header at all if (!line.startsWith('#')) { return line; @@ -35,10 +36,12 @@ function addHeaderID(line) { } const headingText = line.slice(line.indexOf(' ')).trim(); const headingLevel = line.slice(0, line.indexOf(' ')); - return `${headingLevel} ${headingText} {#${generateID(headingText)}}`; + return `${headingLevel} ${headingText} {#${slugger.slug(headingText)}}`; } function addHeaderIDs(lines) { + // Sluggers should be per file + const slugger = new GithubSlugger(); let inCode = false; const results = []; lines.forEach(line => { @@ -53,7 +56,7 @@ function addHeaderIDs(lines) { return; } - results.push(addHeaderID(line)); + results.push(addHeaderID(line, slugger)); }); return results; } From 3e49e971d04159f294291e15908cd35b2370e1db Mon Sep 17 00:00:00 2001 From: Nat Alison Date: Wed, 6 Feb 2019 17:22:04 -0800 Subject: [PATCH 05/13] add everything else again --- content/blog/2013-06-05-why-react.md | 8 +- content/blog/2013-06-12-community-roundup.md | 8 +- .../blog/2013-06-19-community-roundup-2.md | 12 +- content/blog/2013-06-21-react-v0-3-3.md | 6 +- .../blog/2013-06-27-community-roundup-3.md | 12 +- ...13-07-02-react-v0-4-autobind-by-default.md | 4 +- .../blog/2013-07-03-community-roundup-4.md | 8 +- ...v0-4-prop-validation-and-default-values.md | 4 +- content/blog/2013-07-17-react-v0-4-0.md | 6 +- .../blog/2013-07-23-community-roundup-5.md | 12 +- content/blog/2013-07-26-react-v0-4-1.md | 4 +- ...7-30-use-react-and-jsx-in-ruby-on-rails.md | 8 +- .../blog/2013-08-05-community-roundup-6.md | 10 +- ...se-react-and-jsx-in-python-applications.md | 6 +- .../blog/2013-08-26-community-roundup-7.md | 6 +- .../blog/2013-09-24-community-roundup-8.md | 12 +- content/blog/2013-10-16-react-v0.5.0.md | 10 +- content/blog/2013-10-29-react-v0-5-1.md | 6 +- content/blog/2013-10-3-community-roundup-9.md | 12 +- .../blog/2013-11-06-community-roundup-10.md | 16 +-- .../blog/2013-11-18-community-roundup-11.md | 18 +-- content/blog/2013-12-19-react-v0.8.0.md | 10 +- .../blog/2013-12-23-community-roundup-12.md | 18 +-- .../blog/2013-12-30-community-roundup-13.md | 16 +-- .../blog/2014-01-06-community-roundup-14.md | 16 +-- .../blog/2014-02-05-community-roundup-15.md | 22 +-- .../blog/2014-02-15-community-roundup-16.md | 20 +-- content/blog/2014-02-16-react-v0.9-rc1.md | 16 +-- content/blog/2014-02-20-react-v0.9.md | 18 +-- .../blog/2014-02-24-community-roundup-17.md | 40 +++--- .../blog/2014-03-14-community-roundup-18.md | 30 ++-- content/blog/2014-03-19-react-v0.10-rc1.md | 14 +- content/blog/2014-03-21-react-v0.10.md | 14 +- content/blog/2014-03-28-the-road-to-1.0.md | 16 +-- .../blog/2014-06-27-community-roundup-19.md | 18 +-- content/blog/2014-07-13-react-v0.11-rc1.md | 26 ++-- content/blog/2014-07-17-react-v0.11.md | 30 ++-- content/blog/2014-07-25-react-v0.11.1.md | 8 +- .../blog/2014-07-28-community-roundup-20.md | 20 +-- .../blog/2014-08-03-community-roundup-21.md | 20 +-- .../blog/2014-09-12-community-round-up-22.md | 18 +-- content/blog/2014-09-16-react-v0.11.2.md | 8 +- .../2014-10-14-introducing-react-elements.md | 20 +-- content/blog/2014-10-16-react-v0.12-rc1.md | 22 +-- .../blog/2014-10-17-community-roundup-23.md | 28 ++-- content/blog/2014-10-28-react-v0.12.md | 36 ++--- .../blog/2014-11-25-community-roundup-24.md | 22 +-- content/blog/2014-12-18-react-v0.12.2.md | 6 +- ...-19-react-js-conf-diversity-scholarship.md | 6 +- .../blog/2015-01-27-react-v0.13.0-beta-1.md | 12 +- .../2015-02-18-react-conf-roundup-2015.md | 4 +- ...015-02-20-introducing-relay-and-graphql.md | 12 +- content/blog/2015-02-24-react-v0.13-rc1.md | 24 ++-- .../2015-02-24-streamlining-react-elements.md | 40 +++--- content/blog/2015-03-03-react-v0.13-rc2.md | 2 +- .../blog/2015-03-04-community-roundup-25.md | 10 +- content/blog/2015-03-10-react-v0.13.md | 26 ++-- content/blog/2015-03-16-react-v0.13.1.md | 14 +- ...lding-the-facebook-news-feed-with-relay.md | 16 +-- .../blog/2015-03-30-community-roundup-26.md | 22 +-- content/blog/2015-04-17-react-native-v0.4.md | 4 +- content/blog/2015-04-18-react-v0.13.2.md | 14 +- .../blog/2015-05-01-graphql-introduction.md | 10 +- content/blog/2015-05-08-react-v0.13.3.md | 12 +- ...deprecating-jstransform-and-react-tools.md | 8 +- content/blog/2015-07-03-react-v0.14-beta-1.md | 4 +- .../2015-08-03-new-react-devtools-beta.md | 20 +-- .../2015-08-11-relay-technical-preview.md | 8 +- .../2015-09-02-new-react-developer-tools.md | 2 +- content/blog/2015-09-10-react-v0.14-rc1.md | 16 +-- .../blog/2015-09-14-community-roundup-27.md | 12 +- ...15-10-01-react-render-and-top-level-api.md | 4 +- content/blog/2015-10-07-react-v0.14.md | 18 +-- ...5-10-19-reactiflux-is-moving-to-discord.md | 28 ++-- content/blog/2015-10-28-react-v0.14.1.md | 10 +- content/blog/2015-11-02-react-v0.14.2.md | 4 +- content/blog/2015-11-18-react-v0.14.3.md | 10 +- ...eact-js-conf-2016-diversity-scholarship.md | 6 +- ...react-components-elements-and-instances.md | 18 +-- content/blog/2015-12-29-react-v0.14.4.md | 8 +- .../blog/2016-02-19-new-versioning-scheme.md | 10 +- content/blog/2016-03-07-react-v15-rc1.md | 16 +-- content/blog/2016-03-16-react-v15-rc2.md | 2 +- content/blog/2016-03-29-react-v0.14.8.md | 4 +- content/blog/2016-04-07-react-v15.md | 18 +-- content/blog/2016-04-08-react-v15.0.1.md | 6 +- .../2016-07-13-mixins-considered-harmful.md | 36 ++--- ...07-22-create-apps-with-no-configuration.md | 24 ++-- .../2016-08-05-relay-state-of-the-state.md | 14 +- .../blog/2016-09-28-our-first-50000-stars.md | 12 +- content/blog/2016-11-16-react-v15.4.0.md | 20 +-- content/blog/2017-04-07-react-v15.5.0.md | 26 ++-- ...017-05-18-whats-new-in-create-react-app.md | 16 +-- content/blog/2017-06-13-react-v15.6.0.md | 16 +-- .../2017-07-26-error-handling-in-react-16.md | 16 +-- .../2017-09-08-dom-attributes-in-react-16.md | 16 +-- content/blog/2017-09-25-react-v15.6.2.md | 10 +- content/blog/2017-09-26-react-v16.0.md | 32 ++--- ...17-11-28-react-v16.2.0-fragment-support.md | 48 +++---- ...12-07-introducing-the-react-rfc-process.md | 6 +- ...improving-the-repository-infrastructure.md | 56 ++++---- .../2018-03-01-sneak-peek-beyond-react-16.md | 2 +- .../2018-03-27-update-on-async-rendering.md | 30 ++-- content/blog/2018-03-29-react-v-16-3.md | 10 +- content/blog/2018-05-23-react-v-16-4.md | 24 ++-- ...07-you-probably-dont-need-derived-state.md | 24 ++-- content/blog/2018-08-01-react-v-16-4-2.md | 22 +-- ...18-09-10-introducing-the-react-profiler.md | 24 ++-- .../blog/2018-10-01-create-react-app-v2.md | 12 +- content/blog/2018-10-23-react-v-16-6.md | 22 +-- content/blog/2018-11-27-react-16-roadmap.md | 18 +-- content/blog/2018-12-19-react-v-16-7.md | 12 +- content/blog/2019-02-06-react-v16.8.0.md | 32 ++--- content/community/conferences.it-IT.md | 4 +- content/community/conferences.ko-KR.md | 4 +- content/community/conferences.md | 128 +++++++++--------- content/community/conferences.zh-CN.md | 8 +- content/community/courses.md | 4 +- content/community/meetups.md | 60 ++++---- content/community/podcasts.md | 4 +- content/community/support.md | 6 +- content/community/tools-jsx.md | 4 +- content/community/tools-starter-kits.md | 4 +- content/community/tools-ui-components.md | 4 +- content/community/videos.it-IT.md | 32 ++--- content/community/videos.ko-KR.md | 32 ++--- content/community/videos.md | 26 ++-- content/community/videos.zh-CN.md | 32 ++--- content/docs/accessibility.md | 66 ++++----- content/docs/add-react-to-a-website.md | 22 +-- content/docs/addons-animation.md | 32 ++--- content/docs/addons-create-fragment.md | 6 +- content/docs/addons-perf.md | 28 ++-- content/docs/addons-pure-render-mixin.md | 2 +- content/docs/addons-shallow-compare.md | 2 +- content/docs/addons-shallow-renderer.md | 8 +- content/docs/addons-test-utils.md | 38 +++--- .../docs/addons-two-way-binding-helpers.md | 10 +- content/docs/addons-update.md | 18 +-- content/docs/addons.md | 6 +- content/docs/cdn-links.md | 2 +- content/docs/code-splitting.md | 18 +-- content/docs/codebase-overview.md | 30 ++-- content/docs/components-and-props.md | 10 +- content/docs/composition-vs-inheritance.md | 6 +- content/docs/conditional-rendering.md | 8 +- content/docs/context.md | 26 ++-- content/docs/create-a-new-react-app.md | 14 +- content/docs/cross-origin-errors.md | 8 +- content/docs/design-principles.md | 26 ++-- content/docs/error-boundaries.md | 16 +-- content/docs/faq-ajax.md | 6 +- content/docs/faq-build.md | 6 +- content/docs/faq-functions.md | 34 ++--- content/docs/faq-internals.md | 6 +- content/docs/faq-state.md | 16 +-- content/docs/faq-structure.md | 10 +- content/docs/faq-styling.md | 10 +- content/docs/faq-versioning.md | 8 +- content/docs/forms.md | 16 +-- content/docs/forwarding-refs.md | 8 +- content/docs/fragments.md | 10 +- content/docs/getting-started.md | 38 +++--- content/docs/handling-events.md | 2 +- content/docs/hello-world.md | 6 +- content/docs/higher-order-components.md | 18 +-- content/docs/hooks-custom.md | 8 +- content/docs/hooks-effect.md | 26 ++-- content/docs/hooks-faq.md | 36 ++--- content/docs/hooks-intro.md | 18 +-- content/docs/hooks-overview.md | 16 +-- content/docs/hooks-reference.md | 44 +++--- content/docs/hooks-rules.md | 10 +- content/docs/hooks-state.md | 20 +-- content/docs/how-to-contribute.md | 42 +++--- content/docs/implementation-notes.md | 28 ++-- .../docs/integrating-with-other-libraries.md | 18 +-- content/docs/introducing-jsx.md | 14 +- content/docs/jsx-in-depth.md | 32 ++--- content/docs/legacy-context.md | 10 +- content/docs/lifting-state-up.md | 8 +- content/docs/lists-and-keys.md | 12 +- content/docs/optimizing-performance.md | 30 ++-- content/docs/portals.md | 4 +- content/docs/react-without-es6.md | 8 +- content/docs/reconciliation.md | 16 +-- content/docs/reference-dom-elements.md | 24 ++-- content/docs/reference-events.md | 40 +++--- content/docs/reference-glossary.md | 34 ++--- content/docs/reference-react-component.md | 72 +++++----- content/docs/reference-react-dom-server.md | 12 +- content/docs/reference-react-dom.md | 16 +-- content/docs/reference-react.md | 54 ++++---- content/docs/reference-test-renderer.md | 48 +++---- content/docs/refs-and-the-dom.md | 22 +-- content/docs/render-props.md | 8 +- content/docs/rendering-elements.md | 6 +- content/docs/state-and-lifecycle.md | 16 +-- content/docs/static-type-checking.md | 36 ++--- content/docs/strict-mode.md | 10 +- content/docs/thinking-in-react.md | 16 +-- content/docs/typechecking-with-proptypes.md | 6 +- content/docs/uncontrolled-components.md | 4 +- content/docs/web-components.md | 4 +- content/tutorial/tutorial.md | 62 ++++----- content/warnings/dont-call-proptypes.md | 8 +- content/warnings/invalid-hook-call-warning.md | 8 +- content/warnings/legacy-factories.md | 8 +- content/warnings/refs-must-have-owner.md | 6 +- 209 files changed, 1814 insertions(+), 1814 deletions(-) diff --git a/content/blog/2013-06-05-why-react.md b/content/blog/2013-06-05-why-react.md index 30d54b24c..6c23552a1 100644 --- a/content/blog/2013-06-05-why-react.md +++ b/content/blog/2013-06-05-why-react.md @@ -6,13 +6,13 @@ author: [petehunt] There are a lot of JavaScript MVC frameworks out there. Why did we build React and why would you want to use it? -## React isn't an MVC framework. +## React isn't an MVC framework. {#react-isnt-an-mvc-framework} React is a library for building composable user interfaces. It encourages the creation of reusable UI components which present data that changes over time. -## React doesn't use templates. +## React doesn't use templates. {#react-doesnt-use-templates} Traditionally, web application UIs are built using templates or HTML directives. These templates dictate the full set of abstractions that you are allowed to use @@ -33,7 +33,7 @@ to render views, which we see as an advantage over templates for a few reasons: We've also created [JSX](/docs/jsx-in-depth.html), an optional syntax extension, in case you prefer the readability of HTML to raw JavaScript. -## Reactive updates are dead simple. +## Reactive updates are dead simple. {#reactive-updates-are-dead-simple} React really shines when your data changes over time. @@ -63,7 +63,7 @@ Because this re-render is so fast (around 1ms for TodoMVC), the developer doesn't need to explicitly specify data bindings. We've found this approach makes it easier to build apps. -## HTML is just the beginning. +## HTML is just the beginning. {#html-is-just-the-beginning} Because React has its own lightweight representation of the document, we can do some pretty cool things with it: diff --git a/content/blog/2013-06-12-community-roundup.md b/content/blog/2013-06-12-community-roundup.md index c8d4af256..ff7103e8b 100644 --- a/content/blog/2013-06-12-community-roundup.md +++ b/content/blog/2013-06-12-community-roundup.md @@ -5,7 +5,7 @@ author: [vjeux] React was open sourced two weeks ago and it's time for a little round-up of what has been going on. -## Khan Academy Question Editor +## Khan Academy Question Editor {#khan-academy-question-editor} It looks like [Sophie Alpert](http://sophiebits.com/) is the first person outside of Facebook and Instagram to push React code to production. We are very grateful for her contributions in form of pull requests, bug reports and presence on IRC ([#reactjs on Freenode](irc://chat.freenode.net/reactjs)). Sophie wrote about her experience using React: @@ -16,7 +16,7 @@ It looks like [Sophie Alpert](http://sophiebits.com/) is the first person outsid > > [Read the full post...](http://sophiebits.com/2013/06/09/using-react-to-speed-up-khan-academy.html) -## Pimp my Backbone.View (by replacing it with React) +## Pimp my Backbone.View (by replacing it with React) {#pimp-my-backboneview-by-replacing-it-with-react} [Paul Seiffert](https://blog.mayflower.de/) wrote a blog post that explains how to integrate React into Backbone applications. @@ -28,7 +28,7 @@ It looks like [Sophie Alpert](http://sophiebits.com/) is the first person outsid > > [Read the full post...](https://blog.mayflower.de/3937-Backbone-React.html) -## Using facebook's React with require.js +## Using facebook's React with require.js {#using-facebooks-react-with-requirejs} [Mario Mueller](http://blog.xenji.com/) wrote a menu component in React and was able to easily integrate it with require.js, EventEmitter2 and bower. @@ -36,7 +36,7 @@ It looks like [Sophie Alpert](http://sophiebits.com/) is the first person outsid > > [Read the full post...](http://blog.xenji.com/2013/06/facebooks-react-require-js.html) -## Origins of React +## Origins of React {#origins-of-react} [Pete Hunt](http://www.petehunt.net/blog/) explained what differentiates React from other JavaScript libraries in [a previous blog post](/blog/2013/06/05/why-react.html). [Lee Byron](http://leebyron.com/) gives another perspective on Quora: diff --git a/content/blog/2013-06-19-community-roundup-2.md b/content/blog/2013-06-19-community-roundup-2.md index 3350d6821..3071db80b 100644 --- a/content/blog/2013-06-19-community-roundup-2.md +++ b/content/blog/2013-06-19-community-roundup-2.md @@ -5,7 +5,7 @@ author: [vjeux] Since the launch we have received a lot of feedback and are actively working on React 0.4. In the meantime, here are the highlights of this week. -## Some quick thoughts on React +## Some quick thoughts on React {#some-quick-thoughts-on-react} [Andrew Greig](http://www.andrewgreig.com/) made a blog post that gives a high level description of what React is. @@ -19,7 +19,7 @@ Since the launch we have received a lot of feedback and are actively working on > > [Read the full post...](http://www.andrewgreig.com/637/) -## React and Socket.IO Chat Application +## React and Socket.IO Chat Application {#react-and-socketio-chat-application} [Danial Khosravi](https://danialk.github.io/) made a real-time chat application that interacts with the back-end using Socket.IO. @@ -28,7 +28,7 @@ Since the launch we have received a lot of feedback and are actively working on > > [Read the full post...](https://danialk.github.io/blog/2013/06/16/reactjs-and-socket-dot-io-chat-application/) -## React and Other Frameworks +## React and Other Frameworks {#react-and-other-frameworks} [Pete Hunt](http://www.petehunt.net/blog/) wrote an answer on Quora comparing React and Angular directives. At the end, he explains how you can make an Angular directive that is in fact being rendered with React. @@ -40,7 +40,7 @@ Since the launch we have received a lot of feedback and are actively working on In the same vein, [Markov Twain](https://twitter.com/markov_twain/status/345702941845499906) re-implemented the examples on the front-page [with Ember](http://jsbin.com/azihiw/2/edit) and [Vlad Yazhbin](https://twitter.com/vla) re-implemented the tutorial [with Angular](http://jsfiddle.net/vla/Cdrse/). -## Web Components: React & x-tags +## Web Components: React & x-tags {#web-components-react--x-tags} Mozilla and Google are actively working on Web Components. [Vjeux](http://blog.vjeux.com/) wrote a proof of concept that shows how to implement them using React. @@ -49,7 +49,7 @@ Mozilla and Google are actively working on Web Components. [Vjeux](http://blog.v > > [Read the full post...](http://blog.vjeux.com/2013/javascript/custom-components-react-x-tags.html) -## React TodoMVC Example +## React TodoMVC Example {#react-todomvc-example} [TodoMVC.com](http://todomvc.com/) is a website that collects various implementations of the same basic Todo app. [Pete Hunt](http://www.petehunt.net/blog/) wrote an idiomatic React version. @@ -60,7 +60,7 @@ Mozilla and Google are actively working on Web Components. [Vjeux](http://blog.v > > [Read the source code...](https://github.com/tastejs/todomvc/tree/gh-pages/labs/architecture-examples/react) -## JSX is not HTML +## JSX is not HTML {#jsx-is-not-html} Many of you pointed out differences between JSX and HTML. In order to clear up some confusion, we have added some documentation that covers the four main differences: diff --git a/content/blog/2013-06-21-react-v0-3-3.md b/content/blog/2013-06-21-react-v0-3-3.md index f09bf8a6f..31f150de2 100644 --- a/content/blog/2013-06-21-react-v0-3-3.md +++ b/content/blog/2013-06-21-react-v0-3-3.md @@ -6,18 +6,18 @@ author: [zpao] We have a ton of great stuff coming in v0.4, but in the meantime we're releasing v0.3.3. This release addresses some small issues people were having and simplifies our tools to make them easier to use. -## react-tools +## react-tools {#react-tools} * Upgrade Commoner so `require` statements are no longer relativized when passing through the transformer. This was a feature needed when building React, but doesn't translate well for other consumers of `bin/jsx`. * Upgraded our dependencies on Commoner and Recast so they use a different directory for their cache. * Freeze our esprima dependency. -## React +## React {#react} * Allow reusing the same DOM node to render different components. e.g. `React.renderComponent(
, domNode); React.renderComponent(, domNode);` will work now. -## JSXTransformer +## JSXTransformer {#jsxtransformer} * Improved the in-browser transformer so that transformed scripts will execute in the expected scope. The allows components to be defined and used from separate files. diff --git a/content/blog/2013-06-27-community-roundup-3.md b/content/blog/2013-06-27-community-roundup-3.md index 2d297f20f..371da7ed6 100644 --- a/content/blog/2013-06-27-community-roundup-3.md +++ b/content/blog/2013-06-27-community-roundup-3.md @@ -5,7 +5,7 @@ author: [vjeux] The highlight of this week is that an interaction-heavy app has been ported to React. React components are solving issues they had with nested views. -## Moving From Backbone To React +## Moving From Backbone To React {#moving-from-backbone-to-react} [Clay Allsopp](https://twitter.com/clayallsopp) successfully ported [Propeller](http://usepropeller.com/blog/posts/from-backbone-to-react/), a fairly big, interaction-heavy JavaScript app, to React. @@ -17,7 +17,7 @@ The highlight of this week is that an interaction-heavy app has been ported to R > > [Read the full post...](http://usepropeller.com/blog/posts/from-backbone-to-react/) -## Grunt Task for JSX +## Grunt Task for JSX {#grunt-task-for-jsx} [Eric Clemmons](https://ericclemmons.github.io/) wrote a task for [Grunt](http://gruntjs.com/) that applies the JSX transformation to your JavaScript files. It also works with [Browserify](http://browserify.org/) if you want all your files to be concatenated and minified together. @@ -45,7 +45,7 @@ The highlight of this week is that an interaction-heavy app has been ported to R > > [Check out the project ...](https://github.com/ericclemmons/grunt-react) -## Backbone/Handlebars Nested Views +## Backbone/Handlebars Nested Views {#backbonehandlebars-nested-views} [Joel Burget](http://joelburget.com/) wrote a blog post talking about the way we would write React-like components in Backbone and Handlebars. @@ -57,13 +57,13 @@ The highlight of this week is that an interaction-heavy app has been ported to R > > [Read the full post...](http://joelburget.com/react/) -## JSRomandie Meetup +## JSRomandie Meetup {#jsromandie-meetup} [Renault John Lecoultre](https://twitter.com/renajohn/) from [BugBuster](http://www.bugbuster.com) did a React introduction talk at a JS meetup called [JS Romandie](https://twitter.com/jsromandie) last week. -## CoffeeScript integration +## CoffeeScript integration {#coffeescript-integration} [Vjeux](http://blog.vjeux.com/) used the fact that JSX is just a syntactic sugar on-top of regular JS to rewrite the React front-page examples in CoffeeScript. @@ -81,7 +81,7 @@ The highlight of this week is that an interaction-heavy app has been ported to R > > [Read the full post...](http://blog.vjeux.com/2013/javascript/react-coffeescript.html) -## Tutorial in Plain JavaScript +## Tutorial in Plain JavaScript {#tutorial-in-plain-javascript} We've seen a lot of people comparing React with various frameworks. [Ricardo Tomasi](http://ricardo.cc/) decided to re-implement the tutorial without any framework, just plain JavaScript. diff --git a/content/blog/2013-07-02-react-v0-4-autobind-by-default.md b/content/blog/2013-07-02-react-v0-4-autobind-by-default.md index c8e5155ff..9c98fd9b2 100644 --- a/content/blog/2013-07-02-react-v0-4-autobind-by-default.md +++ b/content/blog/2013-07-02-react-v0-4-autobind-by-default.md @@ -6,7 +6,7 @@ author: [zpao] React v0.4 is very close to completion. As we finish it off, we'd like to share with you some of the major changes we've made since v0.3. This is the first of several posts we'll be making over the next week. -## What is React.autoBind? +## What is React.autoBind? {#what-is-reactautobind} If you take a look at most of our current examples, you'll see us using `React.autoBind` for event handlers. This is used in place of `Function.prototype.bind`. Remember that in JS, [function calls are late-bound](https://bonsaiden.github.io/JavaScript-Garden/#function.this). That means that if you simply pass a function around, the `this` used inside won't necessarily be the `this` you expect. `Function.prototype.bind` creates a new, properly bound, function so that when called, `this` is exactly what you expect it to be. @@ -33,7 +33,7 @@ React.createClass({ ``` -## What's Changing in v0.4? +## What's Changing in v0.4? {#whats-changing-in-v04} After using `React.autoBind` for a few weeks, we realized that there were very few times that we didn't want that behavior. So we made it the default! Now all methods defined within `React.createClass` will already be bound to the correct instance. diff --git a/content/blog/2013-07-03-community-roundup-4.md b/content/blog/2013-07-03-community-roundup-4.md index 12c32a118..b7bd158c2 100644 --- a/content/blog/2013-07-03-community-roundup-4.md +++ b/content/blog/2013-07-03-community-roundup-4.md @@ -5,7 +5,7 @@ author: [vjeux] React reconciliation process appears to be very well suited to implement a text editor with a live preview as people at Khan Academy show us. -## Khan Academy +## Khan Academy {#khan-academy} [Ben Kamens](http://bjk5.com/) explains how [Sophie Alpert](http://sophiebits.com/) and [Joel Burget](http://joelburget.com/) are promoting React inside of [Khan Academy](https://www.khanacademy.org/). They now have three projects in the works using React. @@ -21,7 +21,7 @@ The best part is the demo of how React reconciliation process makes live editing [![](../images/blog/monkeys.gif)](http://bjk5.com/post/53742233351/getting-your-team-to-adopt-new-technology) -## React Snippets +## React Snippets {#react-snippets} Over the past several weeks, members of our team, [Pete Hunt](http://www.petehunt.net/) and [Paul O'Shannessy](http://zpao.com/), answered many questions that were asked in the [React group](https://groups.google.com/forum/#!forum/reactjs). They give a good overview of how to integrate React with other libraries and APIs through the use of [Mixins](/docs/reusable-components.html) and [Lifecycle Methods](/docs/working-with-the-browser.html). @@ -44,13 +44,13 @@ Over the past several weeks, members of our team, [Pete Hunt](http://www.petehun > > * [JSFiddle](http://jsfiddle.net/LQxy7/): Your React component simply render empty divs, and then in componentDidMount() you call React.renderComponent() on each of those divs to set up a new root React tree. Be sure to explicitly unmountAndReleaseReactRootNode() for each component in componentWillUnmount(). -## Introduction to React Screencast +## Introduction to React Screencast {#introduction-to-react-screencast} [Pete Hunt](http://www.petehunt.net/) recorded himself implementing a simple `` tag in React.
-## Snake in React +## Snake in React {#snake-in-react} [Tom Occhino](http://tomocchino.com/) implemented Snake in 150 lines with React. diff --git a/content/blog/2013-07-11-react-v0-4-prop-validation-and-default-values.md b/content/blog/2013-07-11-react-v0-4-prop-validation-and-default-values.md index e7b091693..8a5cc18c5 100644 --- a/content/blog/2013-07-11-react-v0-4-prop-validation-and-default-values.md +++ b/content/blog/2013-07-11-react-v0-4-prop-validation-and-default-values.md @@ -6,7 +6,7 @@ author: [zpao] Many of the questions we got following the public launch of React revolved around `props`, specifically that people wanted to do validation and to make sure their components had sensible defaults. -## Validation +## Validation {#validation} Oftentimes you want to validate your `props` before you use them. Perhaps you want to ensure they are a specific type. Or maybe you want to restrict your prop to specific values. Or maybe you want to make a specific prop required. This was always possible — you could have written validations in your `render` or `componentWillReceiveProps` functions, but that gets clunky fast. @@ -29,7 +29,7 @@ React.createClass({ ``` -## Default Values +## Default Values {#default-values} One common pattern we've seen with our React code is to do something like this: diff --git a/content/blog/2013-07-17-react-v0-4-0.md b/content/blog/2013-07-17-react-v0-4-0.md index 0c229a7cf..2a50e8b1e 100644 --- a/content/blog/2013-07-17-react-v0-4-0.md +++ b/content/blog/2013-07-17-react-v0-4-0.md @@ -13,7 +13,7 @@ React v0.4 has some big changes. We've also restructured the documentation to be When you're ready, [go download it](/docs/installation.html)! -### React +### React {#react} * Switch from using `id` attribute to `data-reactid` to track DOM nodes. This allows you to integrate with other JS and CSS libraries more easily. * Support for more DOM elements and attributes (e.g., ``) @@ -25,7 +25,7 @@ When you're ready, [go download it](/docs/installation.html)! * We've implemented an improved synthetic event system that conforms to the W3C spec. * Updates to your component are batched now, which may result in a significantly faster re-render of components. `this.setState` now takes an optional callback as its second parameter. If you were using `onClick={this.setState.bind(this, state)}` previously, you'll want to make sure you add a third parameter so that the event is not treated as the callback. -### JSX +### JSX {#jsx} * Support for comment nodes `
{/* this is a comment and won't be rendered */}
` * Children are now transformed directly into arguments instead of being wrapped in an array @@ -33,7 +33,7 @@ When you're ready, [go download it](/docs/installation.html)! Previously this would be transformed into `React.DOM.div(null, [Component1(null), Component2(null)])`. If you were using React without JSX previously, your code should still work. -### react-tools +### react-tools {#react-tools} * Fixed a number of bugs when transforming directories * No longer re-write `require()`s to be relative unless specified diff --git a/content/blog/2013-07-23-community-roundup-5.md b/content/blog/2013-07-23-community-roundup-5.md index 34d74869c..02e0d5355 100644 --- a/content/blog/2013-07-23-community-roundup-5.md +++ b/content/blog/2013-07-23-community-roundup-5.md @@ -5,7 +5,7 @@ author: [vjeux] We launched the [React Facebook Page](https://www.facebook.com/react) along with the React v0.4 launch. 700 people already liked it to get updated on the project :) -## Cross-browser onChange +## Cross-browser onChange {#cross-browser-onchange} [Sophie Alpert](http://sophiebits.com/) from [Khan Academy](https://www.khanacademy.org/) worked on a cross-browser implementation of `onChange` event that landed in v0.4. She wrote a blog post explaining the various browser quirks she had to deal with. @@ -16,7 +16,7 @@ We launched the [React Facebook Page](https://www.facebook.com/react) along with > [Read the full post...](http://sophiebits.com/2013/06/18/a-near-perfect-oninput-shim-for-ie-8-and-9.html) -## React Samples +## React Samples {#react-samples} Learning a new library is always easier when you have working examples you can play with. [jwh](https://github.com/jhw) put many of them on his [react-samples GitHub repo](https://github.com/jhw/react-samples). @@ -50,7 +50,7 @@ Learning a new library is always easier when you have working examples you can p > * Toggle [#1](https://rawgithub.com/jhw/react-samples/master/html/toggle.html) -## React Chosen Wrapper +## React Chosen Wrapper {#react-chosen-wrapper} [Cheng Lou](https://github.com/chenglou) wrote a wrapper for the [Chosen](https://harvesthq.github.io/chosen/) input library called [react-chosen](https://github.com/chenglou/react-chosen). It took just 25 lines to be able to use jQuery component as a React one. @@ -64,21 +64,21 @@ React.renderComponent( ``` -## JSX and ES6 Template Strings +## JSX and ES6 Template Strings {#jsx-and-es6-template-strings} [Domenic Denicola](http://domenicdenicola.com/) wrote a slide deck about the great applications of ES6 features and one slide shows how we could use Template Strings to compile JSX at run-time without the need for a pre-processing phase.
-## React Presentation +## React Presentation {#react-presentation} [Tom Occhino](http://tomocchino.com/) and [Jordan Walke](https://github.com/jordwalke), React developers, did a presentation of React at Facebook Seattle's office. Check out the first 25 minutes for the presentation and the remaining 45 for a Q&A. I highly recommend you watching this video.
-## Docs +## Docs {#docs} [Pete Hunt](http://www.petehunt.net/) rewrote the entirety of the docs for v0.4. The goal was to add more explanation about why we built React and what the best practices are. diff --git a/content/blog/2013-07-26-react-v0-4-1.md b/content/blog/2013-07-26-react-v0-4-1.md index 569c45a82..181bb09be 100644 --- a/content/blog/2013-07-26-react-v0-4-1.md +++ b/content/blog/2013-07-26-react-v0-4-1.md @@ -6,7 +6,7 @@ author: [zpao] React v0.4.1 is a small update, mostly containing correctness fixes. Some code has been restructured internally but those changes do not impact any of our public APIs. -## React +## React {#react} * `setState` callbacks are now executed in the scope of your component. * `click` events now work on Mobile Safari. @@ -16,7 +16,7 @@ React v0.4.1 is a small update, mostly containing correctness fixes. Some code h * Added checksums to detect and correct cases where server-side rendering markup mismatches what React expects client-side. -## JSXTransformer +## JSXTransformer {#jsxtransformer} * Improved environment detection so it can be run in a non-browser environment. diff --git a/content/blog/2013-07-30-use-react-and-jsx-in-ruby-on-rails.md b/content/blog/2013-07-30-use-react-and-jsx-in-ruby-on-rails.md index e436b671e..60529a4ce 100644 --- a/content/blog/2013-07-30-use-react-and-jsx-in-ruby-on-rails.md +++ b/content/blog/2013-07-30-use-react-and-jsx-in-ruby-on-rails.md @@ -12,7 +12,7 @@ This gem has 2 primary purposes: 2. To allow you to write JSX without an external build step to transform that into JS. -## Packaging react.js +## Packaging react.js {#packaging-reactjs} To make `react.js` available for use client-side, simply add `react` to your manifest, and declare the variant you'd like to use in your environment. When you use `:production`, the minified and optimized `react.min.js` will be used instead of the development version. For example: @@ -32,7 +32,7 @@ end ``` -## Writing JSX +## Writing JSX {#writing-jsx} When you name your file with `myfile.js.jsx`, `react-rails` will automatically try to transform that file. For the time being, we still require that you include the docblock at the beginning of the file. For example, this file will get transformed on request. @@ -42,12 +42,12 @@ React.renderComponent(, document.getElementById('example')) ``` -## Asset Pipeline +## Asset Pipeline {#asset-pipeline} `react-rails` takes advantage of the [asset pipeline](http://guides.rubyonrails.org/asset_pipeline.html) that was introduced in Rails 3.1. A very important part of that pipeline is the `assets:precompile` Rake task. `react-rails` will ensure that your JSX files will be transformed into regular JS before all of your assets are minified and packaged. -## Installation +## Installation {#installation} Installation follows the same process you're familiar with. You can install it globally with `gem install react-rails`, though we suggest you add the dependency to your `Gemfile` directly. diff --git a/content/blog/2013-08-05-community-roundup-6.md b/content/blog/2013-08-05-community-roundup-6.md index 987a0fa05..22db39d88 100644 --- a/content/blog/2013-08-05-community-roundup-6.md +++ b/content/blog/2013-08-05-community-roundup-6.md @@ -5,13 +5,13 @@ author: [vjeux] This is the first Community Round-up where none of the items are from Facebook/Instagram employees. It's great to see the adoption of React growing. -## React Game Tutorial +## React Game Tutorial {#react-game-tutorial} [Caleb Cassel](https://twitter.com/CalebCassel) wrote a [step-by-step tutorial](https://rawgithub.com/calebcassel/react-demo/master/part1.html) about making a small game. It covers JSX, State and Events, Embedded Components and Integration with Backbone.
-## Reactify +## Reactify {#reactify} [Andrey Popp](http://andreypopp.com/) created a [Browserify](http://browserify.org/) helper to compile JSX files. @@ -27,7 +27,7 @@ This is the first Community Round-up where none of the items are from Facebook/I -## React Integration with Este +## React Integration with Este {#react-integration-with-este} [Daniel Steigerwald](http://daniel.steigerwald.cz/) is now using React within [Este](https://github.com/steida/este), which is a development stack for web apps in CoffeeScript that are statically typed using the Closure Library. @@ -52,7 +52,7 @@ este.demos.react.todoApp = este.react.create (`/** @lends {React.ReactComponent. [Check it out on GitHub...](https://github.com/steida/este-library/blob/master/este/demos/thirdparty/react/start.coffee) -## React Stylus Boilerplate +## React Stylus Boilerplate {#react-stylus-boilerplate} [Zaim Bakar](https://zaim.github.io/) shared his boilerplate to get started with Stylus CSS processor. @@ -67,7 +67,7 @@ este.demos.react.todoApp = este.react.create (`/** @lends {React.ReactComponent. > [Check it out on GitHub...](https://github.com/zaim/react-stylus-boilerplate) -## WebFUI +## WebFUI {#webfui} [Conrad Barski](http://lisperati.com/), author of the popular book [Land of Lisp](http://landoflisp.com/), wants to use React for his ClojureScript library called [WebFUI](https://github.com/drcode/webfui). diff --git a/content/blog/2013-08-19-use-react-and-jsx-in-python-applications.md b/content/blog/2013-08-19-use-react-and-jsx-in-python-applications.md index 95375f38a..bbbc4da63 100644 --- a/content/blog/2013-08-19-use-react-and-jsx-in-python-applications.md +++ b/content/blog/2013-08-19-use-react-and-jsx-in-python-applications.md @@ -5,7 +5,7 @@ author: [kmeht] Today we're happy to announce the initial release of [PyReact](https://github.com/facebook/react-python), which makes it easier to use React and JSX in your Python applications. It's designed to provide an API to transform your JSX files into JavaScript, as well as provide access to the latest React source files. -## Usage +## Usage {#usage} Transform your JSX files via the provided `jsx` module: @@ -30,7 +30,7 @@ from react import source react_js = source.path_for('react.min.js') ``` -## Django +## Django {#django} PyReact includes a JSX compiler for [django-pipeline](https://github.com/cyberdelia/django-pipeline). Add it to your project's pipeline settings like this: @@ -40,7 +40,7 @@ PIPELINE_COMPILERS = ( ) ``` -## Installation +## Installation {#installation} PyReact is hosted on PyPI, and can be installed with `pip`: diff --git a/content/blog/2013-08-26-community-roundup-7.md b/content/blog/2013-08-26-community-roundup-7.md index fd5cb62e6..bc526b466 100644 --- a/content/blog/2013-08-26-community-roundup-7.md +++ b/content/blog/2013-08-26-community-roundup-7.md @@ -14,13 +14,13 @@ It's been three months since we open sourced React and it is going well. Some st * 2 early adopters: [Khan Academy](http://sophiebits.com/2013/06/09/using-react-to-speed-up-khan-academy.html) and [Propeller](http://usepropeller.com/blog/posts/from-backbone-to-react/) -## Wolfenstein Rendering Engine Ported to React +## Wolfenstein Rendering Engine Ported to React {#wolfenstein-rendering-engine-ported-to-react} [Pete Hunt](http://www.petehunt.net/) ported the render code of the web version of Wolfenstein 3D to React. Check out [the demo](http://www.petehunt.net/wolfenstein3D-react/wolf3d.html) and [render.js](https://github.com/petehunt/wolfenstein3D-react/blob/master/js/renderer.js#L183) file for the implementation.
-## React & Meteor +## React & Meteor {#react--meteor} [Ben Newman](https://twitter.com/benjamn) made a [13-lines wrapper](https://github.com/benjamn/meteor-react/blob/master/lib/mixin.js) to use React and Meteor together. [Meteor](http://www.meteor.com/) handles the real-time data synchronization between client and server. React provides the declarative way to write the interface and only updates the parts of the UI that changed. @@ -46,7 +46,7 @@ It's been three months since we open sourced React and it is going well. Some st > > [Read more ...](https://github.com/benjamn/meteor-react) -## React Page +## React Page {#react-page} [Jordan Walke](https://github.com/jordwalke) implemented a complete React project creator called [react-page](https://github.com/facebook/react-page/). It supports both server-side and client-side rendering, source transform and packaging JSX files using CommonJS modules, and instant reload. diff --git a/content/blog/2013-09-24-community-roundup-8.md b/content/blog/2013-09-24-community-roundup-8.md index e91b13e63..d94649e0f 100644 --- a/content/blog/2013-09-24-community-roundup-8.md +++ b/content/blog/2013-09-24-community-roundup-8.md @@ -9,7 +9,7 @@ First, we are organizing a [React Hackathon](http://reactjshack-a-thon.splashtha We've also reached a point where there are too many questions for us to handle directly. We're encouraging people to ask questions on [StackOverflow](http://stackoverflow.com/questions/tagged/reactjs) using the tag [[reactjs]](http://stackoverflow.com/questions/tagged/reactjs). Many members of the team and community have subscribed to the tag, so feel free to ask questions there. We think these will be more discoverable than Google Groups archives or IRC logs. -## JavaScript Jabber +## JavaScript Jabber {#javascript-jabber} [Pete Hunt](http://www.petehunt.net/) and [Jordan Walke](https://github.com/jordwalke) were interviewed on [JavaScript Jabber](http://javascriptjabber.com/073-jsj-react-with-pete-hunt-and-jordan-walke/) for an hour. They go over many aspects of React such as 60 FPS, Data binding, Performance, Diffing Algorithm, DOM Manipulation, Node.js support, server-side rendering, JSX, requestAnimationFrame and the community. This is a gold mine of information about React. @@ -24,13 +24,13 @@ We've also reached a point where there are too many questions for us to handle d > [Read the full conversation ...](http://javascriptjabber.com/073-jsj-react-with-pete-hunt-and-jordan-walke/) -## JSXTransformer Trick +## JSXTransformer Trick {#jsxtransformer-trick} While this is not going to work for all the attributes since they are camelCased in React, this is a pretty cool trick.
-## Remarkable React +## Remarkable React {#remarkable-react} [Stoyan Stefanov](http://www.phpied.com/) gave a talk at [BrazilJS](http://braziljs.com.br/) about React and wrote an article with the content of the presentation. He goes through the difficulties of writing _active apps_ using the DOM API and shows how React handles it. @@ -49,18 +49,18 @@ While this is not going to work for all the attributes since they are camelCased > [Read More ...](http://www.phpied.com/remarkable-react/) -## Markdown in React +## Markdown in React {#markdown-in-react} [Sophie Alpert](http://sophiebits.com/) converted [marked](https://github.com/chjj/marked), a Markdown JavaScript implementation, in React: [marked-react](https://github.com/sophiebits/marked-react). Even without using JSX, the HTML generation is now a lot cleaner. It is also safer as forgetting a call to `escape` will not introduce an XSS vulnerability.
-## Unite from BugBusters +## Unite from BugBusters {#unite-from-bugbusters} [Renault John Lecoultre](https://twitter.com/renajohn) wrote [Unite](https://www.bugbuster.com/), an interactive tool for analyzing code dynamically using React. It integrates with CodeMirror.
-## #reactjs IRC Logs +## #reactjs IRC Logs {#reactjs-irc-logs} [Vjeux](http://blog.vjeux.com/) re-implemented the display part of the IRC logger in React. Just 130 lines are needed for a performant infinite scroll with timestamps and color-coded author names. diff --git a/content/blog/2013-10-16-react-v0.5.0.md b/content/blog/2013-10-16-react-v0.5.0.md index 46836135f..88b7f4d7b 100644 --- a/content/blog/2013-10-16-react-v0.5.0.md +++ b/content/blog/2013-10-16-react-v0.5.0.md @@ -9,16 +9,16 @@ The biggest change you'll notice as a developer is that we no longer support `cl The other major change in v0.5 is that we've added an additional build - `react-with-addons` - which adds support for some extras that we've been working on including animations and two-way binding. [Read more about these addons in the docs](/docs/addons.html). -## Thanks to Our Community +## Thanks to Our Community {#thanks-to-our-community} We added *22 new people* to the list of authors since we launched React v0.4.1 nearly 3 months ago. With a total of 48 names in our `AUTHORS` file, that means we've nearly doubled the number of contributors in that time period. We've seen the number of people contributing to discussion on IRC, mailing lists, Stack Overflow, and GitHub continue rising. We've also had people tell us about talks they've given in their local community about React. It's been awesome to see the things that people are building with React, and we can't wait to see what you come up with next! -## Changelog +## Changelog {#changelog} -### React +### React {#react} * Memory usage improvements - reduced allocations in core which will help with GC pauses * Performance improvements - in addition to speeding things up, we made some tweaks to stay out of slow path code in V8 and Nitro. @@ -39,11 +39,11 @@ It's been awesome to see the things that people are building with React, and we * Better support for server-side rendering - [react-page](https://github.com/facebook/react-page) has helped improve the stability for server-side rendering. * Made it possible to use React in environments enforcing a strict [Content Security Policy](https://developer.mozilla.org/en-US/docs/Security/CSP/Introducing_Content_Security_Policy). This also makes it possible to use React to build Chrome extensions. -### React with Addons (New!) +### React with Addons (New!) {#react-with-addons-new} * Introduced a separate build with several "addons" which we think can help improve the React experience. We plan to deprecate this in the long-term, instead shipping each as standalone pieces. [Read more in the docs](/docs/addons.html). -### JSX +### JSX {#jsx} * No longer transform `class` to `className` as part of the transform! This is a breaking change - if you were using `class`, you *must* change this to `className` or your components will be visually broken. * Added warnings to the in-browser transformer to make it clear it is not intended for production use. diff --git a/content/blog/2013-10-29-react-v0-5-1.md b/content/blog/2013-10-29-react-v0-5-1.md index 08407d6af..e70b73088 100644 --- a/content/blog/2013-10-29-react-v0-5-1.md +++ b/content/blog/2013-10-29-react-v0-5-1.md @@ -5,16 +5,16 @@ author: [zpao] This release focuses on fixing some small bugs that have been uncovered over the past two weeks. I would like to thank everybody involved, specifically members of the community who fixed half of the issues found. Thanks to [Sophie Alpert][1], [Andrey Popp][2], and [Laurence Rowe][3] for their contributions! -## Changelog +## Changelog {#changelog} -### React +### React {#react} * Fixed bug with `` and selection events. * Fixed bug with selection and focus. * Made it possible to unmount components from the document root. * Fixed bug for `disabled` attribute handling on non-`` elements. -### React with Addons +### React with Addons {#react-with-addons} * Fixed bug with transition and animation event detection. diff --git a/content/blog/2013-10-3-community-roundup-9.md b/content/blog/2013-10-3-community-roundup-9.md index d69d46441..9eb3d2d1a 100644 --- a/content/blog/2013-10-3-community-roundup-9.md +++ b/content/blog/2013-10-3-community-roundup-9.md @@ -8,7 +8,7 @@ We organized a React hackathon last week-end in the Facebook Seattle office. 50 ![](../images/blog/react-hackathon.jpg) -## React Hackathon Winner +## React Hackathon Winner {#react-hackathon-winner} [Alex Swan](http://bold-it.com/) implemented [Qu.izti.me](http://qu.izti.me/), a multi-player quiz game. It is real-time via Web Socket and mobile friendly. @@ -19,7 +19,7 @@ We organized a React hackathon last week-end in the Facebook Seattle office. 50 > > [Read More...](http://bold-it.com/javascript/facebook-react-example/) -## JSConf EU Talk: Rethinking Best Practices +## JSConf EU Talk: Rethinking Best Practices {#jsconf-eu-talk-rethinking-best-practices} [Pete Hunt](http://www.petehunt.net/) presented React at JSConf EU. He covers three controversial design decisions of React: @@ -32,7 +32,7 @@ The video will be available soon on the [JSConf EU website](http://2013.jsconf.e
-## Pump - Clojure bindings for React +## Pump - Clojure bindings for React {#pump---clojure-bindings-for-react} [Alexander Solovyov](http://solovyov.net/) has been working on React bindings for ClojureScript. This is really exciting as it is using "native" ClojureScript data structures. @@ -52,7 +52,7 @@ The video will be available soon on the [JSConf EU website](http://2013.jsconf.e [Check it out on GitHub...](https://github.com/piranha/pump) -## JSXHint +## JSXHint {#jsxhint} [Todd Kennedy](http://blog.selfassembled.org/) working at [Condé Nast](http://www.condenast.com/) implemented a wrapper on-top of [JSHint](http://www.jshint.com/) that first converts JSX files to JS. @@ -65,7 +65,7 @@ The video will be available soon on the [JSConf EU website](http://2013.jsconf.e > [Check it out on GitHub...](https://github.com/CondeNast/JSXHint) -## Turbo React +## Turbo React {#turbo-react} [Ross Allen](https://twitter.com/ssorallen) working at [Mesosphere](http://mesosphere.io/) combined [Turbolinks](https://github.com/rails/turbolinks/), a library used by Ruby on Rails to speed up page transition, and React. @@ -79,7 +79,7 @@ The video will be available soon on the [JSConf EU website](http://2013.jsconf.e > [Check out the demo...](https://turbo-react.herokuapp.com/) -## Reactive Table +## Reactive Table {#reactive-table} [Stoyan Stefanov](http://www.phpied.com/) continues his series of blog posts about React. This one is an introduction tutorial on rendering a simple table with React. diff --git a/content/blog/2013-11-06-community-roundup-10.md b/content/blog/2013-11-06-community-roundup-10.md index 6aa3a9b6c..f85b77e6a 100644 --- a/content/blog/2013-11-06-community-roundup-10.md +++ b/content/blog/2013-11-06-community-roundup-10.md @@ -7,7 +7,7 @@ This is the 10th round-up already and React has come quite far since it was open The best part is that no drastic changes have been required to support all those use cases. Most of the efforts were targeted at polishing edge cases, performance improvements, and documentation. -## Khan Academy - Officially moving to React +## Khan Academy - Officially moving to React {#khan-academy---officially-moving-to-react} [Joel Burget](http://joelburget.com/) announced at Hack Reactor that new front-end code at Khan Academy should be written in React! @@ -22,14 +22,14 @@ The best part is that no drastic changes have been required to support all those > [Read the full article](http://joelburget.com/backbone-to-react/) -## React: Rethinking best practices +## React: Rethinking best practices {#react-rethinking-best-practices} [Pete Hunt](http://www.petehunt.net/)'s talk at JSConf EU 2013 is now available in video.
-## Server-side React with PHP +## Server-side React with PHP {#server-side-react-with-php} [Stoyan Stefanov](http://www.phpied.com/)'s series of articles on React has two new entries on how to execute React on the server to generate the initial page load. @@ -50,7 +50,7 @@ The best part is that no drastic changes have been required to support all those >
-## TodoMVC Benchmarks +## TodoMVC Benchmarks {#todomvc-benchmarks} Webkit has a [TodoMVC Benchmark](https://github.com/WebKit/webkit/tree/master/PerformanceTests/DoYouEvenBench) that compares different frameworks. They recently included React and here are the results (average of 10 runs in Chrome 30): @@ -89,13 +89,13 @@ By default, React "re-renders" all the components when anything changes. This is The fact that you can control when components are rendered is a very important characteristic of React as it gives you control over its performance. We are going to talk more about performance in the future, stay tuned. -## Guess the filter +## Guess the filter {#guess-the-filter} [Connor McSheffrey](http://conr.me) implemented a small game using React. The goal is to guess which filter has been used to create the Instagram photo.
-## React vs FruitMachine +## React vs FruitMachine {#react-vs-fruitmachine} [Andrew Betts](http://trib.tv/), director of the [Financial Times Labs](http://labs.ft.com/), posted an article comparing [FruitMachine](https://github.com/ftlabs/fruitmachine) and React. @@ -105,7 +105,7 @@ The fact that you can control when components are rendered is a very important c Even though we weren't inspired by FruitMachine (React has been used in production since before FruitMachine was open sourced), it's great to see similar technologies emerging and becoming popular. -## React Brunch +## React Brunch {#react-brunch} [Matthew McCray](http://elucidata.net/) implemented [react-brunch](https://npmjs.org/package/react-brunch), a JSX compilation step for [Brunch](http://brunch.io/). @@ -117,7 +117,7 @@ Even though we weren't inspired by FruitMachine (React has been used in producti > > [Read more...](https://npmjs.org/package/react-brunch) -## Random Tweet +## Random Tweet {#random-tweet} I'm going to start adding a tweet at the end of each round-up. We'll start with this one: diff --git a/content/blog/2013-11-18-community-roundup-11.md b/content/blog/2013-11-18-community-roundup-11.md index 938629998..7fe40e47a 100644 --- a/content/blog/2013-11-18-community-roundup-11.md +++ b/content/blog/2013-11-18-community-roundup-11.md @@ -5,14 +5,14 @@ author: [vjeux] This round-up is the proof that React has taken off from its Facebook's root: it features three in-depth presentations of React done by external people. This is awesome, keep them coming! -## Super VanJS 2013 Talk +## Super VanJS 2013 Talk {#super-vanjs-2013-talk} [Steve Luscher](https://github.com/steveluscher) working at [LeanPub](https://leanpub.com/) made a 30 min talk at [Super VanJS](https://twitter.com/vanjs). He does a remarkable job at explaining why React is so fast with very exciting demos using the HTML5 Audio API.
-## React Tips +## React Tips {#react-tips} [Connor McSheffrey](http://connormcsheffrey.com/) and [Cheng Lou](https://github.com/chenglou) added a new section to the documentation. It's a list of small tips that you will probably find useful while working on React. Since each article is very small and focused, we [encourage you to contribute](/tips/introduction.html)! @@ -30,7 +30,7 @@ This round-up is the proof that React has taken off from its Facebook's root: it - [False in JSX](/tips/false-in-jsx.html) -## Intro to the React Framework +## Intro to the React Framework {#intro-to-the-react-framework} [Pavan Podila](http://blog.pixelingene.com/) wrote an in-depth introduction to React on TutsPlus. This is definitively worth reading. @@ -40,7 +40,7 @@ This round-up is the proof that React has taken off from its Facebook's root: it > [Read the full article ...](http://dev.tutsplus.com/tutorials/intro-to-the-react-framework--net-35660) -## 140-characters textarea +## 140-characters textarea {#140-characters-textarea} [Brian Kim](https://github.com/brainkim) wrote a small textarea component that gradually turns red as you reach the 140-characters limit. Because he only changes the background color, React is smart enough not to mess with the text selection. @@ -48,13 +48,13 @@ This round-up is the proof that React has taken off from its Facebook's root: it -## Genesis Skeleton +## Genesis Skeleton {#genesis-skeleton} [Eric Clemmons](https://ericclemmons.github.io/) is working on a "Modern, opinionated, full-stack starter kit for rapid, streamlined application development". The version 0.4.0 has just been released and has first-class support for React.
a>
-## AgFlow Talk +## AgFlow Talk {#agflow-talk} [Robert Zaremba](http://rz.scale-it.pl/) working on [AgFlow](http://www.agflow.com/) recently talked in Poland about React. @@ -67,7 +67,7 @@ This round-up is the proof that React has taken off from its Facebook's root: it
-## JSX +## JSX {#jsx} [Todd Kennedy](http://tck.io/) working at Condé Nast wrote [JSXHint](https://github.com/CondeNast/JSXHint) and explains in a blog post his perspective on JSX. @@ -79,13 +79,13 @@ This round-up is the proof that React has taken off from its Facebook's root: it > [Read the full article...](http://tck.io/posts/jsxhint_and_react.html) -## Photo Gallery +## Photo Gallery {#photo-gallery} [Maykel Loomans](http://miekd.com/), designer at Instagram, wrote a gallery for photos he shot using React.
a>
-## Random Tweet +## Random Tweet {#random-tweet}
diff --git a/content/blog/2013-12-19-react-v0.8.0.md b/content/blog/2013-12-19-react-v0.8.0.md index 1a94597f8..71c384d0e 100644 --- a/content/blog/2013-12-19-react-v0.8.0.md +++ b/content/blog/2013-12-19-react-v0.8.0.md @@ -16,9 +16,9 @@ In order to make the transition to 0.8 for our current users as painless as poss We hope that by releasing `react` on npm, we will enable a new set of uses that have been otherwise difficult. All feedback is welcome! -## Changelog +## Changelog {#changelog} -### React +### React {#react} * Added support for more attributes: * `rows` & `cols` for `