This repository has been archived by the owner on Oct 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Feature/react transform hmre #27
Merged
bradleyboy
merged 6 commits into
bradleyboy:master
from
oliverturner:feature/react-transform-hmre
Apr 23, 2016
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e53288f
Waypoint before updating eslint config to presets
oliverturner f4f64d8
Linting adapted for OP's style
oliverturner 92f2d69
Final tweaks and amends
oliverturner e9900e7
Added a stateless function example: Header/SubHeader
oliverturner 115b39b
Implemented OP's requested amends
a9afe40
Resolved formatting issues
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,33 @@ | ||
(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; | ||
}; | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<html lang="en"> | ||
<head> | ||
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Yet Another React Starter Kit</title> | ||
{% if (o.htmlWebpackPlugin.options.production) { %} | ||
<link rel="stylesheet" href="app.{%=o.webpack.hash%}.css" media="all"> | ||
{% } %} | ||
</head> | ||
<body> | ||
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. Hmm, does this still build the production HTML correctly with CSS and JS included? 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. Magically, it does :) |
||
<div id="app"></div> | ||
|
||
{% for (var chunk in o.htmlWebpackPlugin.files.chunks) { %} | ||
<script src="{%=o.htmlWebpackPlugin.files.chunks[chunk].entry %}"></script> | ||
{% } %} | ||
<div class="app" id="app"></div> | ||
</body> | ||
</html> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Oy. Thanks for catching this☺️