javascript组件_是的,JavaScript运行Swift。 无论如何都要构建您的组件库。
javascript组件
Here’s a question I’ve heard a few times recently:
这是我最近几次听到的一个问题:
“What if we create a component library in React/Vue/Angular/whatever and a new component technology replaces it?”
“如果我们在React / Vue / Angular /中创建组件库,而用新的组件技术替代它,该怎么办?”
That’s not a question of if. It’s a question of when. These technologies have become wildly popular, but they’re not the end game. Like all technologies, something better will eventually come along and replace them.
这不是一个问题。 这是什么时候的问题。 这些技术已经变得非常流行,但并不是最终的结果。 像所有技术一样,最终会出现更好的东西并取代它们。
But that fact is largely irrelevant. Establishing a library of reusable components for your company today remains absolutely critical.
但是,这一事实在很大程度上是无关紧要的。 今天,为您的公司建立可重用组件库仍然至关重要。
Here’s why.
这就是为什么。
今天快一点 (Move Faster Today)
Reusable components help your team move faster by creating higher level abstractions. Components eliminate decision fatigue by programmatically enforcing a standardized approach. Just consider an opinionated form TextInput
component.
可重用组件通过创建更高级别的抽象来帮助您的团队更快地移动。 组件通过以编程方式实施标准化方法来消除决策疲劳。 只需考虑一个带有形式的TextInput
组件。
It can eliminate all the following decisions:
它可以消除以下所有决策:
- Should I put the label above the input or beside it?我应该将标签放在输入上方还是旁边?
- Should I display validation errors to the right or below the input?我应该在输入的右侧还是下方显示验证错误?
- What color should the error be?错误应该是什么颜色?
- How should I mark required fields?如何标记必填字段?
- Should I validate required fields on blur or upon submit?我应该在模糊或提交时验证必填字段吗?
- How much padding should I place between the label and the input?标签和输入之间应放置多少填充?
The list goes on. These aren’t questions your designers and developers should be asking every time they create a new form.
清单继续。 这些并不是您的设计师和开发人员每次创建新表单时都应该问的问题。
增强一致性 (Enforce Consistency)
Reusable components enforce user interface consistency. Your company likely has many developers. Yet your job is to build an app that looks like it was built by one developer.
可重用组件可增强用户界面的一致性。 您的公司可能有很多开发人员。 然而,您的工作是构建一个看起来像是由开发人员开发的应用程序。
To do that, it’s critical to use reusable components. Copy/paste isn’t a design pattern. If designers and developers have the freedom to start from scratch again and again, your application will quickly become a patchwork of different looks, feels, and technologies.
为此,使用可重用组件至关重要。 复制/粘贴不是设计模式。 如果设计人员和开发人员能够一次又一次地从头开始,那么您的应用程序将Swift成为各种外观,感觉和技术的拼凑而成。
提高绩效 (Improve Performance)
In a client side rendered app, every time you use a component you improve performance. Why? Because it minimizes the application’s bundle size and memory footprint. Using a component a second time requires no additional download, and hardly any extra memory.
在客户端渲染的应用程序中,每次使用组件都会提高性能。 为什么? 因为它最大程度地减少了应用程序的捆绑包大小和内存占用。 第二次使用组件不需要额外的下载,几乎不需要任何额外的内存 。
Without a component library, your team is highly likely to include duplicate JavaScript that solves the same problems in slightly different ways which will bloat the bundle and slow performance. Even worse, they’re likely to grab another competing library and thus require users to download multiple full libraries that do the same thing.
没有组件库,您的团队很可能会包含重复JavaScript,这些JavaScript会以略有不同的方式解决相同的问题,从而使捆绑包膨胀并降低性能。 更糟糕的是,他们可能会抢夺另一个竞争的库,从而要求用户下载多个执行相同操作的完整库。
减少维护 (Less Maintenance)
More code leads to more maintenance. More maintenance leads to higher costs and more people which creates additional communication overhead that slows you down even further. Reusable components minimize the amount of code you need to create and maintain today.
更多代码导致更多维护。 更多的维护会导致更高的成本和更多的人员,从而造成额外的通信开销,从而使您进一步放慢速度。 可重用组件最大程度地减少了您今天需要创建和维护的代码量。
以后更容易更新 (Easier Updates Later)
Finally, yes, eventually the component tech you’re using today is going to be legacy. But by creating a reusable component library today, you minimize the surface area that needs updated later.
最后,是的,最终您今天使用的组件技术将成为传统。 但是,通过今天创建可重用的组件库,可以最大程度地减少以后需要更新的表面积。
It’s far easier to migrate a carefully componentized app because you can replace existing components one component at a time. That’s not so easy when your application is a patchwork of different technologies and patterns. Reusable components minimize the surface area you’ll need to update later.
迁移经过仔细组成的应用程序要容易得多,因为您可以一次替换一个组件中的现有组件。 当您的应用程序是不同技术和模式的拼凑而成时,这并不是那么容易。 可重复使用的组件可以最大程度地减少您以后需要更新的表面积。
投资少 (Low Investment)
A component library doesn’t actually require that much work. For instance, if you choose React, you need not, (and typically shouldn’t) start from scratch. There are literally dozens of mature component libraries to choose from and 100’s of standalone components as well.
组件库实际上并不需要那么多的工作。 例如,如果您选择React,则不需要(通常也不应)从头开始。 实际上,有数十种成熟的组件库可供选择,还有100多种独立组件。
Use a popular component library as your starting point and tweak it to your needs. Trust me, this need not take long and the benefits are significant.
使用流行的组件库作为起点,并根据需要进行调整。 相信我,这不需要花很长时间,而且好处是巨大的。
Alternatively, you could choose to create plain CSS components as your foundation. An example of this approach is Stacks from StackOverflow. The advantage to this approach is twofold:
另外,您可以选择创建简单CSS组件作为基础。 这种方法的一个示例是StackOverflow中的Stacks 。 这种方法的优点是双重的:
- If you move to a new technology in the future, the plain CSS foundation that you’re using behind the scenes in your JavaScript components can be reused.如果将来使用新技术,则可以重用JavaScript组件在幕后使用的普通CSS基础。
- If your company is currently using multiple component approaches such as React, Angular, and/or Vue, then this CSS approach can be used as the foundation for all.如果您的公司当前正在使用诸如React,Angular和/或Vue之类的多种组件方法,那么此CSS方法可以用作所有方法的基础。
The disadvantage? You have to build your components from scratch so that they utilize your plain CSS component foundation.
劣势? 您必须从头开始构建组件,以便它们利用您的普通CSS组件基础。
My preference? Leverage an existing JavaScript component library as your foundation to minimize the amount of code you need to write to get rolling.
我的偏好? 利用现有JavaScript组件库作为基础,以最大限度地减少滚动所需的代码量。
摘要 (Summary)
Don’t let the rapid innovation in JavaScript scare you away from investing in a reusable component library for your company. Yes, today’s technology will eventually be replaced, but change is the only constant in technology. For all the reasons above, reusable components are worth embracing today.
不要让JavaScript的快速创新吓到您远离为公司投资可重用组件库的麻烦。 是的,今天的技术最终将被替代,但是变化是技术中唯一不变的。 由于上述所有原因,可重复使用的组件今天值得拥抱。
Looking for more details on how to get this done? I recently published “Creating a Reusable React Component Library” on Pluralsight. (free trial)
寻找有关如何完成此操作的更多详细信息? 我最近在Pluralsight上发布了“ 创建可重用的React组件库 ”。 ( 免费试用 )
寻找更多关于React的信息? ⚛️ (Looking for More on React? ⚛️)
I’ve authored multiple React and JavaScript courses on Pluralsight.
我已经在Pluralsight上撰写了多篇React和JavaScript课程 。
Cory House is the author of multiple courses on JavaScript, React, clean code, .NET, and more on Pluralsight. He is principal consultant at reactjsconsulting.com, a Software Architect, Microsoft MVP, and trains software developers internationally on front-end development practices. Cory tweets about JavaScript and front-end development on Twitter as @housecor.
Cory House是JavaScript,React,干净代码,.NET等课程的多本课程的作者,并且还提供了有关Pluralsight的更多课程 。 他是Microsoft MVP的软件架构师reactjsconsulting.com的首席顾问,并就前端开发实践对国际软件开发人员进行培训。 Cory在Twitter上以@housecor表示关于JavaScript和前端开发的推文 。
翻译自: https://www.freecodecamp.org/news/yep-javascript-moves-fast-build-your-component-library-anyway-a50576ab3031/
javascript组件
相关文章:

结对开发--求二维数组的最大子数组
小组成员:信1201-1班 黄亚萍 信1201-1班 袁亚姣 一、题目要求 程序要使用的数组放在一个叫 input.txt 的文件中, 文件格式是: 数组的行数, 数组的列数, 每一行的元素, (用逗号分开) 每一个数字都是有符号32位整数, 当然, 行数和列数都是正整数。 二、设计思路 在…

实验二 164 张增进
一、实验目的 掌握基于覆盖理论与基本路径的基本白盒测试方法和实践 二、实验要求 运用逻辑覆盖测试的覆盖准则设计被测程序的测试用例,并运行测试用例检查程序的正确与否,给出程序缺陷小结。 三、实验内容 根据各位同学自己的被测程序,分别作…

微信小程序之录音与播放功能(完整示例demo)
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 正文: 源码简介: 点击按钮实现相应效果 ↓↓↓↓↓↓↓↓ //test.wxml <button bindtapstart>开始录音</button> <button bindtapplay>播放录音</butt…

为什么您不需要精通数学就可以学习编程
by Pau Pavn通过保罗帕文(PauPavn) 为什么您不需要精通数学就可以学习编程 (Why you don’t need to excel at math to learn how to program) This is probably one of the greatest misconceptions I’ve ever heard.这可能是我听过的最大的误解之一。 If you want to prog…

Android动态加载jar/dex
http://www.cnblogs.com/over140/archive/2011/11/23/2259367.html 加载jar boolean bool new File("/sdcard/test.jar").exists();DexClassLoader cl new DexClassLoader("/sdcard/test.jar", this.getCacheDir().getAbsolutePath(), null, this.getCla…

使用μJava进行变异体测试
一、环境配置mujava运行的是Java程序,Java的环境配置见EclipseJDK配置那点事。 将下载的mujava相关文件放到一个文件夹,文件夹放到C:\muJava 添加mujava环境变量CLASSPATH: C:\mujava\mujava.jar;C:\mujava\openjava.jar;C:\mujava\junit.jar…

【微信小程序之画布】一:canvas组件
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 正文: 此文章主要是对canvas组件的介绍与基本的使用。在组件中绘画了一条固定的直线。 我们先了解一下canvas组件: wxml: <canvas classmyCanvas canvas-id"myCanvas…

JavaScript的“ this”通过成立一个高中乐队来解释
by Kevin Kononenko凯文科诺年科(Kevin Kononenko) JavaScript的“ this”通过成立一个高中乐队来解释 (JavaScript’s “this” Explained By Starting A High School Band) If you have ever been in a band, had a friend that started a band, or seen a corny 80s movie …

Ubuntu 16.04 安装Django
> pip install django1.10.3......或者:> pip3 install django1.10.3(我采用)......或者:>python3 -m pip install django1.10.3......或者:pip install -i https://pypi.douban.com/simple/ django1.10.3......如果你只安装一个版本的 Python,…

【微信小程序之画布】三:手指触摸绘画椭圆
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 正文: 功能:根据手指触摸绘画一个椭圆路径--> 起点为手指开始触摸时的坐标,终点为手指触摸结束时的坐标 效果图: 组件属性的描述在上一节中描述过了&…

ACdream 1099——瑶瑶的第K大——————【快排舍半,输入外挂】
瑶瑶的第K大Time Limit:2000MS Memory Limit:128000KB 64bit IO Format:%lld & %llu Submit Status Practice ACdream 1099Description 一天,萌萌的妹子--瑶瑶(tsyao)很无聊,就来找你玩。可是你们都不知道玩什么。。。尴尬了一阵子ÿ…

开源贡献 计算_如何克服恐惧并为开源做贡献
开源贡献 计算Are you a new developer? Or maybe even just an old-timer who has been in a company for ten years, working on an in-house project, and now you’re thinking, “Hey, I’ve been in my box a long time. What’s new out there?” I have been like th…

Android学习笔记进阶十一图片动画播放(AnimationDrawable)
大家平时见到的最多的可能就是Frame动画了,Android中当然也少不了它。它的使用更加简单,只需要创建一个 AnimationDrawabledF对象来表示Frame动画,然后通过addFrame 方法把每一帧要显示的内容添加进去,并设置播放间隔时间…

JS 把url的参数解析成对象
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 正文: 实现思路:请看log和打印结果 // url参数解析 function getUrlkey(url) {var params {};var urls url.split("?"); console.log(1_分割url:,…

Objective-C代码的文件扩展名
转载于:https://www.cnblogs.com/123qw/p/4375299.html

公司成立两周年感言_对我的副项目成立一周年的一些反思
公司成立两周年感言by Will Abramson威尔艾布拉姆森(Will Abramson) 对我的副项目成立一周年的一些反思 (Some reflections on my side project’s first anniversary) My side project turns one this month. It has been a real learning roller coaster.我的副业这个月变成…

2017.4.18 静态代码分析工具sonarqube+sonar-runner的安装配置及使用
配置成功后的代码分析页面: 可以看到对复杂度、语法使用、重复度等等都做了分析,具体到了每一个方法和每一句代码。 四种使用方式: sonarqube sonar-runnersonarqube mavensonarqube eclipsesonarqube IDE IntelliJ使用方式1 :…

c中结构体的4种定义
1、常规的标准方式: 1 #include <stdio.h> 2 3 struct student{ 4 int age; 5 float score; 6 char sex; 7 }; 8 9 int main(int argc, char **argv) 10 { 11 struct student studenta { 12 30, 13 79.5, 14 …

js 时间戳与日期处理集合
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 正文: 一:获取当前日期 使用方式:console.log(util.formatTime()) 打印结果:2018/04/24 11:06:45 // 获取当前日期 function formatTime() {var date…

超赞网站推荐_字体(更多)超赞-标志性发明
超赞网站推荐by Pubudu Dodangoda通过Pubudu Dodangoda 字体(更多)超赞-标志性发明 (Font (More) Awesome — an iconic invention) Whether you are building a website, a mobile app, or even a standalone app, there are few things you can never escape. The proper us…

JAVA中的垃圾回收机制以及其在android开发中的作用
http://blog.csdn.net/xieqibao/article/details/6707519 这篇文章概述了JAVA中运行时数据的结构,以及垃圾回收机制的作用。在后半部分,描述了如何检测和定位ANDROID程序是否内存溢出。转载于:https://www.cnblogs.com/u3shadow/p/4379336.html

微信小程序把后台传过来的数组坐标展示在地图上
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 正文: 功能实现: 1. 根据后台传递过来的数据,包括地址名字,经纬度坐标等都展示在map组件上; 2. 点击相应地址实现用户当前位置导航至点击的…

Flask-login Question
1 未登录访问鉴权页面如何处理? 如果未登录访问了一个作了 login_required 限制的 view,那么 Flask-Login 会默认 flash一条消息,并且将重定向到login_view,如果你没有指定login_view,那么 Flask-Login 将会抛出一个 4…

愉快的舞会c++_如何在5分钟内建立一个令人愉快的加载屏幕
愉快的舞会cFirst, here is what we will build. Set your timer!首先,这是我们将要建立的。 设置您的计时器! Does this look familiar?这看起来很熟悉吗? If yes, that’s because you’ve seen this somewhere — Slack!如果是…

有关C/C++中,表达式计算顺序的问题,以及表达式内部变量“副作用”问题(转)...
经常可以在一些讨论组里看到下面的提问:“谁知道下面C语句给n赋什么值?”m 1; n mm;最近有位不相识的朋友发email给我,问为什么在某个C系统里,下面表达式打印出两个4,而不是4和5:a 4; cout << a &…

HDU 3001
题目中说明每个城市至少要走一次,至多走2次,因此要用到三进制压缩,然后就是状态转移方程了。 这道题就处理三进制的地方麻烦一点。同时注意,在选择最小长度时,一定是要每一个点都经过至少一次的,即是状态的…

微信小程序 侧滑效果实现
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 正文: 先看效果图: 源码: <view wx:if{{if_show}} class{{show_centent?"show":"hide"}} /> <button bindtapbtn>展示 or 隐藏&l…

im和音视频开发哪个更好_如何阅读成为更好的开发者的方式
im和音视频开发哪个更好by nolan grace通过诺兰格雷斯 如何阅读成为更好的开发者的方式 (How to read your way to becoming a better developer) If you want to get better at programming, there are two things you need to do:如果您想提高编程水平,则需要做两…

MVC3学习 四 EF删除操作
由于EF的框架是4.1的,所以现在如果想更新部分字段的话,只能从数据库中查出一次数据(不用查的方法还没找到,需要继续研究),不能像5.1的版本可以不用查。 更新的Action需要用到[HttpGet]和[HttpPost]…

ThinkPHP5.0中Redis的使用和封装(原创)
Redis是一种常用的非关系型数据库,主要用作数据缓存,数据保存形式为key-value,键值相互映射.它的数据存储跟MySQL不同,它数据存储在内存之中,所以数据读取相对而言很快,用来做高并发非常不错. ThinkPhP5.0自带了Redis扩展,在使用之前先下载php_redis.dll 网址 http://windows.p…