blog's People
blog's Issues
老系统改造和React的应用
关于老系统
说来惭愧,公司产品未上线 代码已成老人 - - !由于入职前的前端没有很好的规划且现在项目已然成体系,真是应了网上那句全局变量满天飞!各种页面混乱不堪。。说多了都是泪啊。。
虽然心里已有准备,但是看到代码的那一刻,瞬间压力山大啊。如何在现有资源情况下,进行最好的重组与重构,梳理清楚业务逻辑和代码覆盖率是重中之重。想必大家也遇到过这种情况吧。
我的思路
- 保证老系统的正常稳定运行(不要旧坑未填有生新坑)
- 解耦
解耦的关键在了解业务需求,还有就是对老系统代码的熟悉程度,需要话大功夫 - 模块化
AMD和CMD都可以,nodeJs也有很多工具webpack等,这种基于模块化的代码版本管理是梳理代码的重要途径 - 重构
重构其实就是摒弃部分老代码,引用一些成熟的框架且需要处理好与老代码之前的交互
React的应用
为什么我会选择React?
业界现在MVVM框架比较成熟的就是angular和React,vue算是angular的小弟(不兼容IE8是个坑啊),其他框架要么不成熟,要么有很多坑,所以果断舍弃。
比较下 angular和v,其实都很好,但是要根据业务选择最适合自己的。
- 我们的产品是基于品牌的海量试用,那么问题来了,海量嘛 首先就得快!相对于angular(霍华德),React就是个布鲁尔,天下武功,唯快不破。
- 兼容性
由于产品方面的考虑,我们现在确实无法舍弃低版本的IE,兼容性确实是我们切实考虑的 - 专注视图和控制层
angular是个应用级的框架,其中一些模版控制语句是节约的方便了开发成本,而React只能自己去考虑这方面的东西,这点是React不如angular的地方,但是React更专注于表现层,我们正式需要这样的 - 学习成本
如何让团队的人迅速掌握新的框架并应用到实际的工作中,根据团队的水平去考量也是很重要的一方面,相比较与angular的很多新概念,我认为React相对来说学习成本会更低一些。。
大概能想到的几点就这些,最近开始着手改造登录/注册模块。后续开发完成后再写一些总结吧。。
ok let's go!!!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.