diff --git a/README.md b/README.md index 5284486..5a25363 100644 --- a/README.md +++ b/README.md @@ -6,22 +6,22 @@ React技术栈系列教程,涉及React、Redux、Babel、Webpack等相关技
@@ -41,33 +41,51 @@ React技术栈系列教程,涉及React、Redux、Babel、Webpack等相关技 - Webpack 1. [使用Webpack加载ES6模块、ADM模块、CommonJS模块](https://github.com/iSpring/babel-webpack-react-redux-tutorials/tree/master/tutorials/load-commonjs-amd-es6-modules-with-webpack/README.md) - 2. [使用Webpack加载打包npm包](https://github.com/iSpring/babel-webpack-react-redux-tutorials/tree/master/tutorials/bundle-npm-packages-with-webpack/README.md) + 2. [使用Webpack加载打包NPM模块](https://github.com/iSpring/babel-webpack-react-redux-tutorials/tree/master/tutorials/bundle-npm-packages-with-webpack/README.md) 3. [使用Webpack加载CSS、SASS、LESS资源并集成PostCSS](https://github.com/iSpring/babel-webpack-react-redux-tutorials/blob/master/tutorials/load-css-with-webpack/README.md) - 4. 使用ExtractTextPlugin分离CSS - 5. 使用Webpack加载图片 - 6. Webpack Code Splitting - 7. Webpack Common Chunk - 8. HtmlWebpackPlugin - 9. Webpack Dev Server - 10. Webpack Source Maps - 11. Webpack vs Browserify + 4. [使用ExtractTextPlugin分离CSS以及文本文件](https://github.com/iSpring/babel-webpack-react-redux-tutorials/blob/master/tutorials/use-extract-text-webpack-plugin/README.md) + 5. [使用Webpack加载图片和SVG](https://github.com/iSpring/babel-webpack-react-redux-tutorials/blob/master/tutorials/load-image-with-webpack/README.md) + 6. [使用HtmlWebpackPlugin自动生成html文件](https://github.com/iSpring/babel-webpack-react-redux-tutorials/blob/master/tutorials/use-html-webpack-plugin/README.md) + 7. [在Webpack中使用环境变量](https://github.com/iSpring/babel-webpack-react-redux-tutorials/blob/master/tutorials/webpack-environment-variables/README.md) + 8. [Webpack中Chunk概念详解以及通过Webpack Code Splitting实现异步按需加载](https://github.com/iSpring/babel-webpack-react-redux-tutorials/tree/master/tutorials/webpack-code-splitting/README.md) + 9. 使用bundle-loader异步加载资源文件 + 10. 使用webpack-md5-hash + 11. Webpack中使用CommonsChunkPlugin + 12. Webpack Dev Server + 13. Webpack Source Maps - React - 1. React简介 - 2. JSX语法 - 3. React组件 - 4. React组件状态与生命周期 - 5. React组件事件 - 6. React组件ref + 1. JSX语法 + 2. React组件 + 3. React组件状态与生命周期 + 4. React组件事件和ref + 5. Conditional Rendering + 6. Lists and Keys + 7. 在React中使用classnames和CSS Module + 8. React Developer Tools + 9. Performance + 10. Context + 11. Animation + 12. PureRender + 13. Two-way Binding + 14. Test + +- react-router + 1. react-router使用基础 + 2. Route配置 + 3. history + 4. location对象以及路由切换时的参数传递 + 5. 通过Route向Component传递props + 6. 在react-router中使用代码分离实现动态路由 - Redux - 1. Redux简介 - 2. Redux使用基础 + 1. Redux使用基础 2. Redux中间件 3. Redux异步中间件 4. redux-combineReducers 5. react-redux-binding - 6. react-redux-binding - 7. 异步加载组件 + 6. 异步加载组件 + 7. Immutable.js + 8. Chrome Redux Plugin 未完待续... \ No newline at end of file diff --git a/tutorials/babel-basic-use/README.md b/tutorials/babel-basic-use/README.md index a8d9f17..37ddf2e 100644 --- a/tutorials/babel-basic-use/README.md +++ b/tutorials/babel-basic-use/README.md @@ -1,4 +1,10 @@ -Babel原名叫做`6to5`,顾名思义,它的使命就是把ES6的代码编译成ES5,使得我们可以使用ES6的新特性与语法编写代码。 +# [Babel使用基础](https://github.com/iSpring/babel-webpack-react-redux-tutorials/tree/master/tutorials/babel-basic-use/README.md) + +- -
+# [使用Flow进行静态类型检查](https://github.com/iSpring/babel-webpack-react-redux-tutorials/blob/master/tutorials/babel-flow-type/README.md) + +- +
Flow判断出上面`fool(x)`期待的形参x是`number`类型,但是实际传入的确实`string`类型,因此报错。 @@ -80,7 +82,7 @@ Flow允许我们像静态语言那样显式地指定变量的类型,修改`exa 执行`npm run flow`,输出错误如下:- +
这是因为`return x.length * y`返回的实际值类型应该是`number`,而`function foo(): string`却声明返回的是`string`类型,所以报错。此处将方法签名改为`function foo(x: string, y: number): number`即可。 @@ -164,7 +166,7 @@ total([1, 2, 3, 'Hello']); 执行`npm run flow`,输出错误如下:- +
我们将`total(numbers)`方法中的numbers形参声明为Array- +
我们在[《使用Webpack加载ES6模块、ADM模块、CommonJS模块》](https://github.com/iSpring/babel-webpack-react-redux-tutorials/tree/master/tutorials/load-commonjs-amd-es6-modules-with-webpack)一文中学习了如何使用Webpack打包各种CommonJS模块、AMD模块以及ES6模块,我们在示例代码中演示的各种模块都是我们自己编写的。在实际项目中,我们需要依赖很多npm包,并且需要将这些npm模块通过Webpack打包到我们最终的输出文件中。 diff --git a/tutorials/load-commonjs-amd-es6-modules-with-webpack/README.md b/tutorials/load-commonjs-amd-es6-modules-with-webpack/README.md index 5e48beb..ae67b12 100644 --- a/tutorials/load-commonjs-amd-es6-modules-with-webpack/README.md +++ b/tutorials/load-commonjs-amd-es6-modules-with-webpack/README.md @@ -1,8 +1,10 @@ -- +# [使用Webpack加载ES6模块、ADM模块、CommonJS模块](https://github.com/iSpring/babel-webpack-react-redux-tutorials/tree/master/tutorials/load-commonjs-amd-es6-modules-with-webpack/README.md) + +
+
-## [Webpack](https://webpack.github.io/) +## Webpack A Bundler for JavaScript and Friends 现在前端项目越来越庞大,JavaScript、CSS文件、图片、JSON等各种文件杂乱堆砌,在前端我们可能需要不同的方式来加载不同的资源文件,比如通过创建` + +