-
Notifications
You must be signed in to change notification settings - Fork 38
Feature/react transform hmre #27
Changes from 4 commits
e53288f
f4f64d8
92f2d69
e9900e7
115b39b
a9afe40
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"env": { | ||
"development": { | ||
"presets": [ | ||
"react-hmre" | ||
] | ||
}, | ||
"production": { | ||
"plugins": [ | ||
"transform-react-remove-prop-types", | ||
"transform-react-constant-elements", | ||
"transform-react-inline-elements" | ||
] | ||
} | ||
}, | ||
"presets": ["es2015", "react", "stage-0"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v5 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't think this should be committed, probably should be ignored in your local .gitignore. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,8 @@ import ReactTestUtils from 'react-addons-test-utils'; | |
import Application from '../index.jsx'; | ||
import styles from '../style.sass'; | ||
|
||
describe('Application', function() { | ||
it('displays the component', function() { | ||
describe('Application', function () { | ||
it('displays the component', function () { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please remove these leading spaces before each function so that eslint passes? There are a few more throughout the PR too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry about that... fixed now through the awesome power of |
||
const application = ReactTestUtils.renderIntoDocument( | ||
<Application /> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,13 +10,13 @@ import Header from '../Header'; | |
import styles from './style'; | ||
|
||
export default class Application extends React.Component { | ||
render() { | ||
render () { | ||
return <div className={styles.main}> | ||
<div className={styles.wrap}> | ||
<Header /> | ||
|
||
<main className={styles.body}> | ||
<p>Seems like creating your own React starter kit is a right of passage. So, here's mine.</p> | ||
<p>Seems like creating your own React starter kit is a rite of passage. So, here's mine.</p> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oy. Thanks for catching this |
||
<p>For more information, see the <a href="https://github.com/bradleyboy/yarsk#yarsk">Readme</a>.</p> | ||
</main> | ||
</div> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,14 +4,14 @@ import ReactTestUtils from 'react-addons-test-utils'; | |
import Header from '../index.jsx'; | ||
import styles from '../style.sass'; | ||
|
||
describe('Header', function() { | ||
it('displays the title', function() { | ||
describe('Header', function () { | ||
it('displays the title', function () { | ||
const header = ReactTestUtils.renderIntoDocument( | ||
<Header /> | ||
); | ||
|
||
const title = ReactTestUtils.findRenderedDOMComponentWithClass(header, styles.title); | ||
const dom = ReactDOM.findDOMNode(title); | ||
const dom = ReactDOM.findDOMNode(title); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extra space here. |
||
|
||
expect(dom.textContent).to.equal('YARSK'); | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const React = require('react') | ||
|
||
import styles from './style' | ||
|
||
const SubHeader = ({children}) => ( | ||
<h2 className={styles.tagline}> | ||
{children.split(' ').map((word) => { | ||
const arr = word.split('') | ||
return (<span><strong>{arr.shift()}</strong>{arr.join('')} </span>) | ||
} | ||
)} | ||
</h2> | ||
) | ||
|
||
export default SubHeader |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
var karmaFactory = require('./make-karma-config.js'); | ||
|
||
module.exports = function(config) { | ||
module.exports = function (config) { | ||
config.set(karmaFactory({ | ||
coverage: true, | ||
coverageReporters: [ | ||
{ type: 'text' }, | ||
{type: 'text'}, | ||
], | ||
})); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,33 @@ | ||
(function() { | ||
(function () { | ||
var Ap = Array.prototype; | ||
var slice = Ap.slice; | ||
var Fp = Function.prototype; | ||
|
||
var Ap = Array.prototype; | ||
var slice = Ap.slice; | ||
var Fp = Function.prototype; | ||
if (!Fp.bind) { | ||
// PhantomJS doesn't support Function.prototype.bind natively, so | ||
// polyfill it whenever this module is required. | ||
Fp.bind = function (context) { | ||
var func = this; | ||
var args = slice.call(arguments, 1); | ||
|
||
if (!Fp.bind) { | ||
// PhantomJS doesn't support Function.prototype.bind natively, so | ||
// polyfill it whenever this module is required. | ||
Fp.bind = function(context) { | ||
var func = this; | ||
var args = slice.call(arguments, 1); | ||
function bound() { | ||
var invokedAsConstructor = func.prototype && (this instanceof func); | ||
return func.apply( | ||
// Ignore the context parameter when invoking the bound function | ||
// as a constructor. Note that this includes not only constructor | ||
// invocations using the new keyword but also calls to base class | ||
// constructors such as BaseClass.call(this, ...) or super(...). | ||
!invokedAsConstructor && context || this, | ||
args.concat(slice.call(arguments)) | ||
); | ||
} | ||
|
||
function bound() { | ||
var invokedAsConstructor = func.prototype && (this instanceof func); | ||
return func.apply( | ||
// Ignore the context parameter when invoking the bound function | ||
// as a constructor. Note that this includes not only constructor | ||
// invocations using the new keyword but also calls to base class | ||
// constructors such as BaseClass.call(this, ...) or super(...). | ||
!invokedAsConstructor && context || this, | ||
args.concat(slice.call(arguments)) | ||
); | ||
} | ||
|
||
// The bound function must share the .prototype of the unbound | ||
// function so that any object created by one constructor will count | ||
// as an instance of both constructors. | ||
bound.prototype = func.prototype; | ||
|
||
return bound; | ||
}; | ||
} | ||
// The bound function must share the .prototype of the unbound | ||
// function so that any object created by one constructor will count | ||
// as an instance of both constructors. | ||
bound.prototype = func.prototype; | ||
|
||
return bound; | ||
}; | ||
} | ||
})(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of spaces between
function
and the opening paren, so would prefer "never" here.