All Projects → bingqichen → react-with-mobx-template

bingqichen / react-with-mobx-template

Licence: MIT License
project template-react&&mobx

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to react-with-mobx-template

React Mobx Demo
🔥 React, Mobx, and React-Router to achieve a Zhihu Daily App.
Stars: ✭ 59 (+293.33%)
Mutual labels:  mobx, react-router-v4
Favesound Mobx
🎶 A SoundCloud Client in React + MobX running in production. Live Demo and Source Code to explore React + MobX. Refactored from favesound-redux
Stars: ✭ 532 (+3446.67%)
Mutual labels:  mobx, react-router-v4
React Mobx Firebase Authentication
🔥Boilerplate Project for Authentication with Firebase in React and MobX
Stars: ✭ 111 (+640%)
Mutual labels:  mobx, react-router-v4
React Mobx Project
react-mobx-router开发模版
Stars: ✭ 49 (+226.67%)
Mutual labels:  mobx, react-router-v4
mobxSpa
企业级SPA项目,完整开发脚手架
Stars: ✭ 96 (+540%)
Mutual labels:  mobx, react-router-v4
react-candee
A react framework that encapsulates the redux.
Stars: ✭ 30 (+100%)
Mutual labels:  react-router-v4
frontend-handbook
Our handbook based on 10 years of experience in Frontend/JS development
Stars: ✭ 45 (+200%)
Mutual labels:  mobx
browsear
A Chrome extension to search a song like Shazam
Stars: ✭ 20 (+33.33%)
Mutual labels:  mobx
team-timesheets
Time tracking web app built as a replacement for old school timesheets.
Stars: ✭ 25 (+66.67%)
Mutual labels:  mobx
MERN-BUS-APP
This is a MFRP (My first Real Project) assigned to me during my internship at Cognizant. Made with MERN Stack technology.
Stars: ✭ 92 (+513.33%)
Mutual labels:  react-router-v4
react-native-firebase-starter
The ultimate React Native starter using Firebase, Mobx, CodePush, OneSignal made with ♥
Stars: ✭ 290 (+1833.33%)
Mutual labels:  mobx
react-universal-starter
React@16, react-router@4, redux and webpack@4 starter project
Stars: ✭ 44 (+193.33%)
Mutual labels:  react-router-v4
docker-ui
Web UI For managing Docker images, containers, volumes, and networks
Stars: ✭ 45 (+200%)
Mutual labels:  mobx
BXStage
基于mobx + react 构建一个60多个页面大型跨平台 react-naive 应用
Stars: ✭ 49 (+226.67%)
Mutual labels:  mobx
boring-router
A type-safe MobX router with parallel routing support.
Stars: ✭ 74 (+393.33%)
Mutual labels:  mobx
myConsole
基于 TS + React + Mobx 实现的移动端浏览器控制台开发教程
Stars: ✭ 26 (+73.33%)
Mutual labels:  mobx
over-hangman
💥 Over powered hangman game
Stars: ✭ 42 (+180%)
Mutual labels:  mobx
egg-react-mobx-demo
A simple todo list demo of using Egg.js, React and MobX.
Stars: ✭ 15 (+0%)
Mutual labels:  mobx
react-typescript
A Front-End Project with Typescript/Antd. webpack5+react-router4+antd+typescript4+grahql
Stars: ✭ 63 (+320%)
Mutual labels:  mobx
react-cli
基于 create-react-app 搭建的前端脚手架
Stars: ✭ 18 (+20%)
Mutual labels:  react-router-v4

react-with-mobx-template

项目模版-react&&react-router@4&&mobx

技术选型

目录结构

├── src/
│   ├── components/     # 组件
│   ├── config/         # 一些配置项
│   ├── containers/     # 路由组件(页面维度)
│   ├── services/       # 数据接口
│   ├── stores/         # 数据模型
│   ├── utils/          # 工具
│   ├── app.js          # 入口文件
│   └── router.js       # 路由配置
├── webpack/            # webpack配置
├── index.html
├── package.json

在组件的设计上,应该明确componentscontainers目录中的组件职责:

  • 尽量保持components中的为纯组件(PureComponent),一般来说它所需要的数据都来源于页面组件或者父组件传给它的props
  • containers是页面维度的组件,它的职责是绑定相关联的stores数据,以数据容器的角色包含其它子组件。

接口服务都放在services中,供stores中的方法来调用。

使用

npm:
  npm install
  npm run dll
  npm run dev
  
yarn:
  yarn
  yarn dll
  yarn dev

在启动dev任务之前请务必先运行一次dll任务。该功能可以大大提升webpack打包性能,关于dll plugin的详细资料可查看 dll plugin

其他

  • 启用editorconfig来让编辑器自动读取格式化文件;启用eslint
  • 使用happypack加速打包。

关于项目的一些配置项

  • webpack的配置:
    • .babalrc中配置transform-decorators-legacy来使用修饰器;
    • webpack.config.js是基础配置,一般情况下不需要更改;
    • prod配置中,publicPath属性区分了测试和线上环境的静态资源引用路径,请按需替换;
    • dll配置用来生成一个单独的、平时不需要更改的vendor.min.js,在业务代码之前引入,只有在后续升级或者增删了主要依赖包才需要重新执行dll(大部分情况下后续更新的都是业务代码,更新依赖包的频次远远小于业务),这样一来只要这部分不发生改变,我们平时更新业务代码时这部分是不需要更迭版本的,利用原有缓存而不需要用户重新下载。
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].