Giter Site home page Giter Site logo

chiji's Introduction

前言-(大吉大利,今晚吃鸡!)

一个关于React同构的实践项目。

哇,很难受。正在第二次重构中...

技术栈

React + React-Router4.0 + Sass + Webpack + ES6/ES7 + Koa2.0 + Mongodb

项目运行

下载、安装

cd ./client

npm i

运行

npm start

效果演示

项目结构

目标功能

  • Webpack-开发环境搭建
  • ESLint代码校验
  • React热加载和替换功能
  • Node端处理css(scss)
  • 前后端路由统一
  • React按需加载(Code Spliting)
  • Webpack-生产环境搭建

总结

css in js, css module 和 scss如何选择?

css-modules 优缺点

优点

1、CSS Modules 可以有效避免全局污染和样式冲突,能最大化地结合现有 CSS 生态和 JS 模块化能力

2、与 SCSS 对比,可以避免 className 的层级嵌套,只使用一个 className 就能把所有样式定义好。

缺点:

1、与组件库难以配合

2、会带来一些使用成本,本地样式覆盖困难,写到最后可能一直在用 :global。

chiji's People

Contributors

gvnzhou avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.