Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update grunt-react to use react-tools v0.12.0 #40

Merged
merged 1 commit into from
Oct 29, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "grunt-react",
"description": "Grunt task for compiling Facebook React's JSX templates into JavaScript",
"version": "0.9.0",
"version": "0.10.0",
"homepage": "https://github.com/ericclemmons/grunt-react",
"author": {
"name": "Eric Clemmons",
Expand Down Expand Up @@ -29,7 +29,7 @@
"test": "./node_modules/.bin/grunt"
},
"dependencies": {
"react-tools": "^0.11.0",
"react-tools": "^0.12.0",
"through": "~2.3.4"
},
"devDependencies": {
Expand Down
6 changes: 1 addition & 5 deletions test/expected/browserify
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/**
* @jsx React.DOM
*/

var ModuleComponent = React.createClass({displayName: 'ModuleComponent',
render: function() {
return (
React.DOM.p(null, "Module")
React.createElement("p", null, "Module")
);
}
});
Expand Down
6 changes: 1 addition & 5 deletions test/expected/default_options
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/**
* @jsx React.DOM
*/

(function(greeting) {
return greeting;
})(React.DOM.p(null, "Howdy"));
})(React.createElement("p", null, "Howdy"));
6 changes: 1 addition & 5 deletions test/expected/extension_option
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/**
* @jsx React.DOM
*/

var FixtureComponent = React.createClass({displayName: 'FixtureComponent',
render: function() {
return (
React.DOM.p(null, "Howdy")
React.createElement("p", null, "Howdy")
);
}
});
8 changes: 2 additions & 6 deletions test/expected/multiple_jsx_files
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/**
* @jsx React.DOM
*/

var FixtureComponent = React.createClass({displayName: 'FixtureComponent',
render: function() {
return (
React.DOM.p(null, "Howdy")
React.createElement("p", null, "Howdy")
);
}
});
Expand All @@ -14,7 +10,7 @@ var FixtureComponent = React.createClass({displayName: 'FixtureComponent',
* Plain JS File with .jsx extension
*/

var FixtureComponent = React.createClass({
var FixtureComponent = React.createClass({displayName: 'FixtureComponent',
render: function() {
return '<p>Howdy</p>';
}
Expand Down
9 changes: 9 additions & 0 deletions test/expected/vanilla_js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Plain JS File with .jsx extension
*/

var FixtureComponent = React.createClass({displayName: 'FixtureComponent',
render: function() {
return '<p>Howdy</p>';
}
});
4 changes: 0 additions & 4 deletions test/fixtures/browserify/module.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/**
* @jsx React.DOM
*/

var ModuleComponent = React.createClass({
render: function() {
return (
Expand Down
4 changes: 0 additions & 4 deletions test/fixtures/js/fixture-jsx.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/**
* @jsx React.DOM
*/

(function(greeting) {
return greeting;
})(<p>Howdy</p>);
4 changes: 0 additions & 4 deletions test/fixtures/jsx/fixture.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/**
* @jsx React.DOM
*/

var FixtureComponent = React.createClass({
render: function() {
return (
Expand Down
4 changes: 2 additions & 2 deletions test/react_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ exports.react = {
test.expect(1);

var actual = grunt.file.read('tmp/jsx/nested/fixture-js.js');
var expected = grunt.file.read('test/fixtures/jsx/nested/fixture-js.jsx');
var expected = grunt.file.read('test/expected/vanilla_js');

test.equal(actual, expected, 'should leave vanilla JS alone');
test.equal(actual, expected, 'should convert even vanilla JS');
test.done();
},

Expand Down