diff --git a/playground/examples.rt.js b/playground/examples.rt.js index 77045ad..ddadf1d 100644 --- a/playground/examples.rt.js +++ b/playground/examples.rt.js @@ -1,4 +1,4 @@ -var React = require('react'); +var React = require('react/addons'); var _ = require('lodash'); var playground = require('./playground'); 'use strict'; @@ -6,5 +6,14 @@ module.exports = function () { return React.DOM.div({ 'id': 'examples' }, React.DOM.div({ 'className': 'example' }, React.DOM.h3({}, 'A Simple Component'), React.DOM.p({}, '\n React components implement a ', React.DOM.code({}, 'render()'), ' method that takes input data and\n returns what to display. This example uses an XML-like syntax called\n JSX. Input data that is passed into the component can be accessed by\n ', React.DOM.code({}, 'render()'), ' via ', React.DOM.code({}, 'this.props'), '.\n '), React.DOM.p({}, React.DOM.strong({}, 'JSX is optional and not required to use React.'), ' Try\n clicking on "Compiled JS" to see the raw JavaScript code produced by\n the JSX compiler.\n '), React.DOM.div({ 'id': 'helloExample' }), playground({ 'direction': 'horizontal', 'style': { display: 'block' } - })), React.DOM.div({ 'className': 'example' }, React.DOM.h3({}, 'A Stateful Component'), React.DOM.p({}, '\n In addition to taking input data (accessed via ', React.DOM.code({}, 'this.props'), '), a\n component can maintain internal state data (accessed via ', React.DOM.code({}, 'this.state'), ').\n When a component\'s state data changes, the rendered markup will be\n updated by re-invoking ', React.DOM.code({}, 'render()'), '.\n '), React.DOM.div({ 'id': 'timerExample' })), React.DOM.div({ 'className': 'example' }, React.DOM.h3({}, 'An Application'), React.DOM.p({}, '\n Using ', React.DOM.code({}, 'props'), ' and ', React.DOM.code({}, 'state'), ', we can put together a small Todo application.\n This example uses ', React.DOM.code({}, 'state'), ' to track the current list of items as well as\n the text that the user has entered. Although event handlers appear to be\n rendered inline, they will be collected and implemented using event\n delegation.\n '), React.DOM.div({ 'id': 'todoExample' })), React.DOM.div({ 'className': 'example' }, React.DOM.h3({}, 'A Component Using External Plugins'), React.DOM.p({}, '\n React is flexible and provides hooks that allow you to interface with\n other libraries and frameworks. This example uses Showdown, an external\n Markdown library, to convert the textarea\'s value in real-time.\n '), React.DOM.div({ 'id': 'markdownExample' }))); + })), React.DOM.div({ 'className': 'example' }, React.DOM.h3({}, 'A Stateful Component'), React.DOM.p({}, '\n In addition to taking input data (accessed via ', React.DOM.code({}, 'this.props'), '), a\n component can maintain internal state data (accessed via ', React.DOM.code({}, 'this.state'), ').\n When a component\'s state data changes, the rendered markup will be\n updated by re-invoking ', React.DOM.code({}, 'render()'), '.\n '), React.DOM.div({ 'id': 'timerExample' }), playground({ + 'direction': 'horizontal', + 'style': { display: 'block' } + })), React.DOM.div({ 'className': 'example' }, React.DOM.h3({}, 'An Application'), React.DOM.p({}, '\n Using ', React.DOM.code({}, 'props'), ' and ', React.DOM.code({}, 'state'), ', we can put together a small Todo application.\n This example uses ', React.DOM.code({}, 'state'), ' to track the current list of items as well as\n the text that the user has entered. Although event handlers appear to be\n rendered inline, they will be collected and implemented using event\n delegation.\n '), React.DOM.div({ 'id': 'todoExample' }), playground({ + 'direction': 'horizontal', + 'style': { display: 'block' } + })), React.DOM.div({ 'className': 'example' }, React.DOM.h3({}, 'A Component Using External Plugins'), React.DOM.p({}, '\n React is flexible and provides hooks that allow you to interface with\n other libraries and frameworks. This example uses Showdown, an external\n Markdown library, to convert the textarea\'s value in real-time.\n '), React.DOM.div({ 'id': 'markdownExample' }), playground({ + 'direction': 'horizontal', + 'style': { display: 'block' } + }))); }; \ No newline at end of file diff --git a/playground/home-main.browser.js b/playground/home-main.browser.js index 469f2f3..f43befb 100644 --- a/playground/home-main.browser.js +++ b/playground/home-main.browser.js @@ -68957,7 +68957,16 @@ module.exports = function () { return React.DOM.div({ 'id': 'examples' }, React.DOM.div({ 'className': 'example' }, React.DOM.h3({}, 'A Simple Component'), React.DOM.p({}, '\n React components implement a ', React.DOM.code({}, 'render()'), ' method that takes input data and\n returns what to display. This example uses an XML-like syntax called\n JSX. Input data that is passed into the component can be accessed by\n ', React.DOM.code({}, 'render()'), ' via ', React.DOM.code({}, 'this.props'), '.\n '), React.DOM.p({}, React.DOM.strong({}, 'JSX is optional and not required to use React.'), ' Try\n clicking on "Compiled JS" to see the raw JavaScript code produced by\n the JSX compiler.\n '), React.DOM.div({ 'id': 'helloExample' }), playground({ 'direction': 'horizontal', 'style': { display: 'block' } - })), React.DOM.div({ 'className': 'example' }, React.DOM.h3({}, 'A Stateful Component'), React.DOM.p({}, '\n In addition to taking input data (accessed via ', React.DOM.code({}, 'this.props'), '), a\n component can maintain internal state data (accessed via ', React.DOM.code({}, 'this.state'), ').\n When a component\'s state data changes, the rendered markup will be\n updated by re-invoking ', React.DOM.code({}, 'render()'), '.\n '), React.DOM.div({ 'id': 'timerExample' })), React.DOM.div({ 'className': 'example' }, React.DOM.h3({}, 'An Application'), React.DOM.p({}, '\n Using ', React.DOM.code({}, 'props'), ' and ', React.DOM.code({}, 'state'), ', we can put together a small Todo application.\n This example uses ', React.DOM.code({}, 'state'), ' to track the current list of items as well as\n the text that the user has entered. Although event handlers appear to be\n rendered inline, they will be collected and implemented using event\n delegation.\n '), React.DOM.div({ 'id': 'todoExample' })), React.DOM.div({ 'className': 'example' }, React.DOM.h3({}, 'A Component Using External Plugins'), React.DOM.p({}, '\n React is flexible and provides hooks that allow you to interface with\n other libraries and frameworks. This example uses Showdown, an external\n Markdown library, to convert the textarea\'s value in real-time.\n '), React.DOM.div({ 'id': 'markdownExample' }))); + })), React.DOM.div({ 'className': 'example' }, React.DOM.h3({}, 'A Stateful Component'), React.DOM.p({}, '\n In addition to taking input data (accessed via ', React.DOM.code({}, 'this.props'), '), a\n component can maintain internal state data (accessed via ', React.DOM.code({}, 'this.state'), ').\n When a component\'s state data changes, the rendered markup will be\n updated by re-invoking ', React.DOM.code({}, 'render()'), '.\n '), React.DOM.div({ 'id': 'timerExample' }), playground({ + 'direction': 'horizontal', + 'style': { display: 'block' } + })), React.DOM.div({ 'className': 'example' }, React.DOM.h3({}, 'An Application'), React.DOM.p({}, '\n Using ', React.DOM.code({}, 'props'), ' and ', React.DOM.code({}, 'state'), ', we can put together a small Todo application.\n This example uses ', React.DOM.code({}, 'state'), ' to track the current list of items as well as\n the text that the user has entered. Although event handlers appear to be\n rendered inline, they will be collected and implemented using event\n delegation.\n '), React.DOM.div({ 'id': 'todoExample' }), playground({ + 'direction': 'horizontal', + 'style': { display: 'block' } + })), React.DOM.div({ 'className': 'example' }, React.DOM.h3({}, 'A Component Using External Plugins'), React.DOM.p({}, '\n React is flexible and provides hooks that allow you to interface with\n other libraries and frameworks. This example uses Showdown, an external\n Markdown library, to convert the textarea\'s value in real-time.\n '), React.DOM.div({ 'id': 'markdownExample' }), playground({ + 'direction': 'horizontal', + 'style': { display: 'block' } + }))); }; },{"./playground":280,"lodash":113,"react":275}],279:[function(require,module,exports){ 'use strict'; diff --git a/playground/intro.rt.js b/playground/intro.rt.js index 6328ad1..65bdc92 100644 --- a/playground/intro.rt.js +++ b/playground/intro.rt.js @@ -1,4 +1,4 @@ -var React = require('react'); +var React = require('react/addons'); var _ = require('lodash'); var playGround = require('./PlayGround.js'); 'use strict'; diff --git a/playground/playground.rt.js b/playground/playground.rt.js index 048c2e2..87da26e 100644 --- a/playground/playground.rt.js +++ b/playground/playground.rt.js @@ -1,4 +1,4 @@ -var React = require('react'); +var React = require('react/addons'); var _ = require('lodash'); var CodeEditor = require('./aceEditor'); 'use strict'; diff --git a/test/data/div.rt.js b/test/data/div.rt.js index 11fdceb..7cfbead 100644 --- a/test/data/div.rt.js +++ b/test/data/div.rt.js @@ -1,6 +1,6 @@ /*eslint new-cap:0,no-unused-vars:0*/ define([ - 'react', + 'react/addons', 'lodash' ], function (React, _) { 'use strict'; diff --git a/test/data/repeat.rt.js b/test/data/repeat.rt.js index 3ed0b71..51a845e 100644 --- a/test/data/repeat.rt.js +++ b/test/data/repeat.rt.js @@ -1,6 +1,6 @@ /*eslint new-cap:0,no-unused-vars:0*/ define([ - 'react', + 'react/addons', 'lodash' ], function (React, _) { 'use strict'; diff --git a/test/data/test.rt.js b/test/data/test.rt.js index 97c6282..6f4531c 100644 --- a/test/data/test.rt.js +++ b/test/data/test.rt.js @@ -1,6 +1,6 @@ /*eslint new-cap:0,no-unused-vars:0*/ define([ - 'react', + 'react/addons', 'lodash' ], function (React, _) { 'use strict'; diff --git a/test/src/test.js b/test/src/test.js index de1f7d5..4f22eb9 100644 --- a/test/src/test.js +++ b/test/src/test.js @@ -85,6 +85,7 @@ test('html tests', function (t) { return content.apply(this, requirements); }; var comp = React.createFactory(React.createClass({ + /* eslint no-eval:0 */ render: eval(code) })); var actual = React.renderToStaticMarkup(comp());