FEX 技术周刊 - 2018/02/26
微信搜索『FEX』关注我们的公众号,及时获得最新资讯。
深阅读
Announcing Dart 2: Optimized for Client-Side Development
https://medium.com/dartlang/announcing-dart-2-80ba01f43b6
With Dart 2, we’ve dramatically strengthened and streamlined the type system, cleaned up the syntax, and rebuilt much of the developer tool chain from the ground up to make mobile and web development more enjoyable and productive. Dart 2 also incorporates lessons learned from early adopters of the language including Flutter, AdWords, and AdSense, as well as thousands of improvements big and small in response to customer feedback.
The Practical Test Pyramid
https://martinfowler.com/articles/practical-test-pyramid.html
The “Test Pyramid” is a metaphor that tells us to group software tests into buckets of different granularity. It also gives an idea of how many tests we should have in each of these groups. Although the concept of the Test Pyramid has been around for a while, teams still struggle to put it into practice properly. This article revisits the original concept of the Test Pyramid and shows how you can put this into practice. It shows which kinds of tests you should be looking for in the different levels of the pyramid and gives practical examples on how these can be implemented.
Lazy deserialization
https://v8project.blogspot.com/2018/02/lazy-deserialization.html
Lazy deserialization was recently enabled by default in V8 version 6.4, reducing V8’s memory consumption by over 500 KB per browser tab on average. Read on to find out more!
nohoist in Workspaces
https://yarnpkg.com/blog/2018/02/15/nohoist/
As wonderful as yarn workspaces are, the rest of the community hasn’t yet fully caught up with the monorepo hoisting scheme. The introducing of the nohoist is the attempt to provide an easy-to-use mechanism, natively supported by yarn, for enabling workspaces to work with otherwise incompatible libraries. We hope this feature would ease the pain for monorepo developers and strike a balance between efficiency (hoisting as much as possible) and usability (unblock the libraries who haven’t been adapted for workspaces).
Exploring ES2018 and ES2019
http://exploringjs.com/es2018-es2019/
This book is about two versions of JavaScript: ECMAScript 2018 and ECMAScript 2019 It only covers what’s new in those versions. 另附:Using Promise.prototype.finally in Node.js
Introducing Storage Access API
https://webkit.org/blog/8124/introducing-storage-access-api/
In June last year we introduced Intelligent Tracking Prevention (ITP). ITP is a privacy feature that detects which domains have the ability to track the user cross-site and either partitions the domain’s cookies or purges its website data all together. The strongest developer feedback we got on ITP was that it needs to provide a way for embedded cross-site content to authenticate users who are already logged in to their first-party services. Today we are happy to provide a solution in the form of Storage Access API. It allows for authenticated embeds while continuing to protect customers’ privacy by default.
基于 Node.js 实现压缩和解压缩
https://zhuanlan.zhihu.com/p/33783583
zip 和 gzip 是两种我们最常见到的压缩格式,当然,gzip 在 Windows 下很少有人接触。
tar 是一种归档格式,它默认不会压缩,需要结合 gzip 来将最终的 tar 文件以 gzip 格式压缩成为一个 tar.gz 文件,通常我们会缩写为 tgz。本文将分别介绍 gzip,tar,tgz 和 zip 的压缩和解压缩在 Node.js 下如何实现。
聊聊微软刚发布的区块链去中心化身份识别系统DID
https://mp.weixin.qq.com/s?__biz=MzAwMDU1MTE1OQ==&mid=2653549389&idx=1&sn=158f9feb10d76a2e6ca7e15f8ec8a3e8
这两天区块链技术圈都在讨论微软发布的去中心化身份识别系统 DID (1),微软的 DID Decentralized IDs 是一线大型互联网公司首次公开拥抱去中心化技术,虽然有传闻说 facebook 也在做区块链方面尝试,但是一直未有正式的消息证实。而微软的 DID 项目已经在内部孵化了 12 个月,它给我们展示了未来利用区块链技术实现 DID 身份验证的一个宏伟蓝图。
精读《Rekit Studio》
https://zhuanlan.zhihu.com/p/33853805
以前,我们不断完善前端基础设施建设,现在前端不缺工具和库了,下一步怎么发展?发展方向有很多,比如继续完善框架和库、争论数据流的取舍、推动 ECMA 规范打造未来蓝图、投入新语言的怀抱、可视化规范与平台的建设等等。有一个没啥技术含量的领域正在成长,就是前端工具链整合。有人走在更前面,Rekit Studio,就是根据文件结构解析出逻辑结构的工具,让开发以逻辑结构管理项目,真的可能带来项目维护、开发成本的大幅优化。另附:精读《React’s new Context API》
Node 定时器详解
http://www.ruanyifeng.com/blog/2018/02/node-event-loop.html
科普 Node 的异步语法的执行细节,对这块不太熟的同学可以看看。
聊聊市面上的「真伪」设计系统
http://www.uisdc.com/authenticity-design-system
原子设计系统(下均称为设计系统)这个词应该已经流行很久了,像蚂蚁金服最近出的 Ant Design 3.0 也说是基于「设计系统」进行构建的。如果你没有了解过原子设计系统,那么我建议先去对原子设计系统做一个初步的了解。虽然设计系统这个概念出现了很久,但是从设计师的角度来看,业界仍然存在大量的「伪」设计系统。为什么这么说?
State of JavaScript Frameworks & Libraries
https://www.youtube.com/watch?v=edXRi6z7zrE
Watch this State of JavaScript and keep up with the advancement of prominent open source frameworks, libraries, and browser standards. 另附:The JavaScript Learning Landscape in 2018.
How to JavaScript in 2018
https://www.telerik.com/blogs/how-to-javascript-in-2018
From command-line tools and webpack to TypeScript, Flow and beyond, let’s talk about how to use JavaScript in 2018. This blog post is part of our whitepaper, “The Future of JavaScript: 2018 and Beyond”, which offers our future-looking analysis and predictions about the latest in JavaScript.
Elm changed my mind about unpopular languages
https://blog.realkinetic.com/elm-changed-my-mind-about-unpopular-languages-190a23f4a834
This is way better than Javascript. First, Elm has the natural predictability of a pure functional language; when you write Elm, the compiler forces you to consider every case. The second reason that Elm is better than Javascript is that Elm is a natural fit for the DOM.
Bringing Together React, D3, And Their Ecosystem
https://www.smashingmagazine.com/2018/02/react-d3-ecosystem/
In this post, we will see how we can approach building React projects that need the powerful charting goodness of D3. We will discover different techniques and how to choose the best library for your needs in your main work and side projects.
Introducing HTTP/2 Server Push with NGINX 1.13.9
https://www.nginx.com/blog/nginx-1-13-9-http2-server-push/
Server push can be used to prime a client with style sheets, images, and other resources that it will need to render a web page. You should take care to only push resources that are required; don’t push resources that a client is likely to already have cached.
Using SSE Instead Of WebSockets For Unidirectional Data Flow Over HTTP/2
https://www.smashingmagazine.com/2018/02/sse-websockets-data-flow-http2/
Nowadays, there are a few ways to implement these: Long/short polling (client pull); WebSockets (server push); Server-Sent events (server push). We are going to take an in-depth look at the three alternatives after we have set the requirements for our business case.
Code Migration in Production: Rewriting the Sharding Layer of Uber’s Schemaless Datastore
https://eng.uber.com/schemaless-rewrite/
In this article, we discuss how we migrated the Schemaless sharding layer from Python to Go, a process that enabled us to handle more traffic with less resources and led to improved user experiences across our services.
How production engineers support global events on Facebook
https://code.facebook.com/posts/166966743929963/how-production-engineers-support-global-events-on-facebook/
People around the world come to Facebook to celebrate and share experiences during special events, such as the Olympics or New Year’s Eve. These types of global occurrences can cause spikes in the load and traffic patterns on Facebook’s systems, especially with high-bandwidth content like Facebook Live videos. The Production Engineering team at Facebook carefully plans and builds infrastructure to ensure service uptime and reliability even through such spikes. To illustrate how we handle these kinds of planned special events, let’s look at how the Production Engineering team has prepared the live video streaming infrastructure for New Year’s Eve.
Designing, Implementing, and Using Reactive APIs
https://www.infoq.com/articles/Designing-Implementing-Using-Reactive-APIs
In this article, we aim to give you some opinionated suggestions about how you should write reactive code. These opinions come from years of experience developing a large-scale reactive API, and while they might not all be right for you, we hope they give you some direction as you get started on your reactive journey.
A Programmable Programming Language
https://cacm.acm.org/magazines/2018/3/225475-a-programmable-programming-language/fulltext
Our decision to develop a new language—Racket—is partly an historical artifact and partly due to our desire to free ourselves from any unnecessary constraints of industrial mainstream languages as we investigate LOP. The next section spells out how Racket got started, how we honed in on LOP, and what the idea of LOP implies.
新鲜货
Solid
https://solid.mit.edu/
Solid is an exciting new project led by Prof. Tim Berners-Lee, inventor of the World Wide Web, taking place at MIT. The project aims to radically change the way Web applications work today, resulting in true data ownership as well as improved privacy. Solid (derived from “social linked data”) is a proposed set of conventions and tools for building decentralized social applications based on Linked Data principles. Solid is modular and extensible and it relies as much as possible on existing W3C standards and protocols.
Announcing ARCore 1.0 and new updates to Google Lens
https://blog.google/products/google-vr/announcing-arcore-10-and-new-updates-google-lens/
With ARCore and Google Lens, we’re working to make smartphone cameras smarter. ARCore enables developers to build apps that can understand your environment and place objects and information in it. Google Lens uses your camera to help make sense of what you see, whether that’s automatically creating contact information from a business card before you lose it, or soon being able to identify the breed of a cute dog you saw in the park. At Mobile World Congress, we’re launching ARCore 1.0 along with new support for developers, and we’re releasing updates for Lens and rolling it out to more people.
Ember 3.0 Released
https://emberjs.com/blog/2018/02/14/ember-3-0-released.html
Ember 3.0 doesn’t introduce any new functionality, instead it focuses the framework by removing long-deprecated APIs and support for legacy platforms. This blog post will help you understand what is being removed in 3.0 and what migration strategies are available.
MongoDB Drops ACID
https://www.mongodb.com/blog/post/multi-document-transactions-in-mongodb
MongoDB 4.0 will add support for multi-document transactions, making it the only database to combine the speed, flexibility, and power of the document model with ACID data integrity guarantees. Through snapshot isolation, transactions provide a globally consistent view of data, and enforce all-or-nothing execution to maintain data integrity. Transactions in MongoDB will feel just like transactions developers are familiar with from relational databases. 另附:
MongoDB’s Drive to Multi-Document Transactions.
npm v5.7.0
http://blog.npmjs.org/post/171139955345/v570
Allow npm install to fix package-lock.json and npm-shrinkwrap.json files that have merge conflicts in them without your having to edit them. The new npm ci command installs from your lock-file ONLY. If your package.json and your lock-file are out of sync then it will report an error. 附:How To Speed Up CI Builds with the new NPM ‘ci’ Command.
Webpack 4.0
https://github.com/webpack/webpack/releases/tag/v4.0.0
Phaser 3.0: HTML5 game framework
http://www.daemonology.net/hn-daily/2018-02-14.html
Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering. 另附:Books I had to read to develop a game engine
An SQL-friendly ORM for Node.js
https://github.com/vincit/objection.js
Objection.js is an ORM for Node.js that aims to stay out of your way and make it as easy as possible to use the full power of SQL and the underlying database engine while keeping magic to a minimum.
Objection.js is built on an SQL query builder called knex. All databases supported by knex are supported by objection.js.
fast-xml-parser
https://github.com/NaturalIntelligence/fast-xml-parser
Validate or Parse XML to JS/JSON very fast without C/C++ based libraries
Unstated
https://github.com/jamiebuilds/unstated
A new paradigm for React state management that is as new as it is old. State so simple, it goes without saying. 另附:unstated — The setState of React State Management.
Pressure.js
https://pressurejs.com/
Pressure is a JavaScript library for handling Force Touch, 3D Touch, and Pointer Pressure on the web, bundled under one library with a simple API that makes working with them painless.
Proton Native
https://proton-native.js.org/#/
Then React Native came along, giving us a seamless way to build user interfaces and manage state in code, all while doing it cross platform. On desktop, there is no such tool. Proton Native does the same to desktop that React Native did to mobile. Build cross-platform apps for the desktop, all while never leaving the React eco-system. Popular React packages such as Redux still work.
Stencil: A Compiler for Web Components
https://github.com/ionic-team/stencil
Stencil is a simple compiler for generating Web Components. Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than run-time tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec. 附:Creating and Publishing Web Components with Stencil.
Framer
https://framer.com/
The best tool for screen design and interactive prototyping. Design everything from detailed icons to high-fidelity interactions—all in one place. 附:Learning Framer By Creating A Mobile App Prototype.
Front End Interview Handbook
https://github.com/yangshun/front-end-interview-handbook
Almost complete answers to “Front-end Job Interview Questions” which you can use to interview potential candidates, test yourself or completely ignore. 另附:8 React Interview Questions for 2018
Apache OpenWhisk
https://openwhisk.apache.org/
Apache OpenWhisk (Incubating) is a serverless, open source cloud platform that executes functions in response to events at any scale. As a developer there’s no need to manage the servers that run your code. Apache OpenWhisk operates and scales your application for you. Spend your time innovating, not configuring infrastructure. Plus, you only pay for what your app uses and needs at that moment.
JupyterLab is Ready for Users
https://blog.jupyter.org/jupyterlab-is-ready-for-users-5a6f039b8906
Jupyter Notebook enables users to create and share documents that combine live code with narrative text, mathematical equations, visualizations, interactive controls, and other rich output. It also provides building blocks for interactive computing with data: a file browser, terminals, and a text editor. The Jupyter Notebook has become ubiquitous with the rapid growth of data science and machine learning and the rising popularity of open-source software in industry and academia.
产品及其它
The business of SaaS
https://stripe.com/atlas/guides/business-of-saas
Understand why SaaS businesses work and how to grow them. If you are a software entrepreneur, and you do not sell mobile applications (which have a separate billing model, imposed by the platforms’ app stores), you should thoroughly understand the business of SaaS. This will let you make better decisions for your product (and company), allow you to see business-threatening problems months or years in advance of them being obvious, and help you in communicating with investors.
连线-这两年,动荡的Facebook和受伤的扎克伯格
http://36kr.com/p/5119578.html
杂志2018年3月刊封面报道了Facebook在近两年的动荡,以及扎克伯格在其中的变化。Facebook想要扭转一辆已经全速行驶了14年的汽车的行驶方向。从一开始,扎克伯格的抱负就是在Facebook内部创建另一个互联网,或者另一个世界,让人们尽可能多地使用它。这种商业模式是建立在广告之上的,而广告对于人们的时间来说是贪得无厌的。但现在扎克伯格表示,他希望这些新变化会让人们更少使用Facebook。
人生算法
https://mp.weixin.qq.com/s?__biz=MzA4NTU2MTg3MQ==&mid=2655163244&idx=1&sn=ccadc0ff834f1be1118b800c1a9d36cf
假如上帝是以算法来构建这个世界,我们也该找到自己的人生算法。至此,让我们总结一下上述段落的观点,并以此作为后面文字的基石:我们所在的世界,看起来是一个“一切不可改变的”钟表宇宙,其实是一个“一切不可预测”的混沌宇宙;我们努力去控制,无论是控制自己的大脑,还是控制外部事物,经常是徒劳的。结果其实是“涌现”出来的;“自动学习”,是一个智能体自我进化的本质,即“算法”。
曾鸣:区块链的春天还没有到来
https://mp.weixin.qq.com/s?__biz=MzI0NzY3Mjc0Mw==&mid=2247484668&idx=1&sn=c5aa950583c3428be81fe38d6220c483
到目前为止,区块链还没有任何应用达到千万或者上亿用户的。这应该是区块链价值实现的一个基本标准。在这个意义上今天我们肯定还处于区块链前商业期。大部分关于区块链未来伟大前景的讨论还只是猜想而已。
比尔·盖茨:我和梅琳达的第10封年度公开信
https://weibo.com/ttarticle/p/show?id=2309404207026396909735
我们一直坦言自己具备乐观精神。不过如今,乐观精神似乎十分稀缺。 所谓乐观,并非认识到过去不如现在,而是知道如何使生活得到改善。这才是我们乐观情绪的真正源泉。虽然在工作中见到过许多疾病与贫穷,也面临着许多亟待解决的重大问题,但我们也看到了人性最美好的一面。我们向发明尖端工具治疗疾病的科学家讨教,与不遗余力地用创新方式为全世界人类谋取健康与福祉的政府领导交谈,也在世界各地见到过勇敢而睿智的个体通过发挥想象力,找到彻底改变社区状况的新方法。当有人问 “你们怎么这么乐观?”时,我们的回应便是这样的。越来越多的人问我们这个问题,我们相信自己的回答在很大程度上反映了我们对世界的看法。这是我们的第十封年度公开信,为表纪念,我们准备回答常被问到的10个难题。我们会尽可能坦率地回答,也希望各位在读完后能像我们一样乐观。