From 4cb30ee5ac00054ee10c973f49ab8b0b4972f1e9 Mon Sep 17 00:00:00 2001 From: Salem Baira Date: Wed, 1 Feb 2017 21:45:40 +0000 Subject: [PATCH 1/6] fix babel presets and plugins --- 6-mobx-react/webpack.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/6-mobx-react/webpack.config.js b/6-mobx-react/webpack.config.js index 7c467bef..de21163e 100644 --- a/6-mobx-react/webpack.config.js +++ b/6-mobx-react/webpack.config.js @@ -12,6 +12,7 @@ module.exports = { test: /\.js$/, exclude: /(node_modules|bower_components)/, loader: 'babel-loader', + query: { presets: ['es2015', 'react'], plugins: ["transform-decorators-legacy", "transform-class-properties"] } }, { test: /\.css$/, loader: "style-loader!css-loader" }, ] From 7b15d9acc88810f0cea10257a6d8d8d69a0c03fa Mon Sep 17 00:00:00 2001 From: achmiral Date: Sun, 26 Feb 2017 21:33:04 +0700 Subject: [PATCH 2/6] ADD: tweet.id as the unique key of mapped tweet item --- 5-redux-react/src/js/components/Layout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5-redux-react/src/js/components/Layout.js b/5-redux-react/src/js/components/Layout.js index 41517fb3..8d416cd7 100644 --- a/5-redux-react/src/js/components/Layout.js +++ b/5-redux-react/src/js/components/Layout.js @@ -27,7 +27,7 @@ export default class Layout extends React.Component { return } - const mappedTweets = tweets.map(tweet =>
  • {tweet.text}
  • ) + const mappedTweets = tweets.map(tweet =>
  • {tweet.text}
  • ) return

    {user.name}

    From aa871682fe1d2cd8a2bc92651b616ea35d39e1ba Mon Sep 17 00:00:00 2001 From: Thibault Jan Beyer Date: Sat, 15 Apr 2017 14:08:58 +0200 Subject: [PATCH 3/6] Update webpack.config.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - it’s occurrence with two 'r' - should be 'false' not 'null' --- 1-basic-react/webpack.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-basic-react/webpack.config.js b/1-basic-react/webpack.config.js index 916380db..6ba7dd8f 100644 --- a/1-basic-react/webpack.config.js +++ b/1-basic-react/webpack.config.js @@ -4,7 +4,7 @@ var path = require('path'); module.exports = { context: path.join(__dirname, "src"), - devtool: debug ? "inline-sourcemap" : null, + devtool: debug ? "inline-sourcemap" : false, entry: "./js/client.js", module: { loaders: [ @@ -25,7 +25,7 @@ module.exports = { }, plugins: debug ? [] : [ new webpack.optimize.DedupePlugin(), - new webpack.optimize.OccurenceOrderPlugin(), + new webpack.optimize.OccurrenceOrderPlugin(), new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }), ], }; From 8f1d3142e984d6e18ad4fef09da46c2daff3b5d1 Mon Sep 17 00:00:00 2001 From: Will Stern Date: Tue, 2 May 2017 12:54:37 -0500 Subject: [PATCH 4/6] Update tweetsActions.js --- 5-redux-react/src/js/actions/tweetsActions.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/5-redux-react/src/js/actions/tweetsActions.js b/5-redux-react/src/js/actions/tweetsActions.js index cba31e31..078064bb 100644 --- a/5-redux-react/src/js/actions/tweetsActions.js +++ b/5-redux-react/src/js/actions/tweetsActions.js @@ -2,7 +2,13 @@ import axios from "axios"; export function fetchTweets() { return function(dispatch) { - axios.get("http://rest.learncode.academy/api/test123/tweets") + /* + http://rest.learncode.academy is a public test server, so another user's experimentation can break your tests + If you get console errors due to bad data: + - change "reacttest" below to any other username + - post some tweets to http://rest.learncode.academy/api/yourusername + */ + axios.get("http://rest.learncode.academy/api/reacttest/tweets") .then((response) => { dispatch({type: "FETCH_TWEETS_FULFILLED", payload: response.data}) }) From 14c11ad4e349f11500a0701723839959d5c23c8e Mon Sep 17 00:00:00 2001 From: Will Stern Date: Tue, 2 May 2017 12:55:51 -0500 Subject: [PATCH 5/6] Update tweetsActions.js --- 5-redux-react/src/js/actions/tweetsActions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5-redux-react/src/js/actions/tweetsActions.js b/5-redux-react/src/js/actions/tweetsActions.js index 078064bb..edf6ed0d 100644 --- a/5-redux-react/src/js/actions/tweetsActions.js +++ b/5-redux-react/src/js/actions/tweetsActions.js @@ -6,7 +6,7 @@ export function fetchTweets() { http://rest.learncode.academy is a public test server, so another user's experimentation can break your tests If you get console errors due to bad data: - change "reacttest" below to any other username - - post some tweets to http://rest.learncode.academy/api/yourusername + - post some tweets to http://rest.learncode.academy/api/yourusername/tweets */ axios.get("http://rest.learncode.academy/api/reacttest/tweets") .then((response) => { From 23b30f0f547b9e1c95f29e5364745c4510f515b3 Mon Sep 17 00:00:00 2001 From: Will Stern Date: Tue, 23 May 2017 09:42:48 -0500 Subject: [PATCH 6/6] dispatch FETCH_TWEETS --- 5-redux-react/src/js/actions/tweetsActions.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/5-redux-react/src/js/actions/tweetsActions.js b/5-redux-react/src/js/actions/tweetsActions.js index edf6ed0d..87926d0f 100644 --- a/5-redux-react/src/js/actions/tweetsActions.js +++ b/5-redux-react/src/js/actions/tweetsActions.js @@ -2,6 +2,8 @@ import axios from "axios"; export function fetchTweets() { return function(dispatch) { + dispatch({type: "FETCH_TWEETS"}); + /* http://rest.learncode.academy is a public test server, so another user's experimentation can break your tests If you get console errors due to bad data: