Month: 2018-07



jihchi 09:45:04



yubaba - :sparkles: Element to element animation orchestrator for React.js :point_right:

mrorz 10:38:50
👩 1


mofas 05:39:10
聽一堆對前端不熟的辦公室同事討論前端 會一直想要翻白眼
mrorz 10:08:51
jihchi 18:42:04
😢 2
jihchi 08:31:59
Announcing CodeSandbox Dashboard & Teams! 🎉

🗃️ Use your dashboard to organize, search and edit all of your sandboxes
⚡ Create teams to collaborate on sandboxes together in real-time
🔴 Because of this, CodeSandbox Live is now free!

there's more:
jihchi 18:50:21

🌩️ Instantly understand where your webpack 4 build time is going by adding one argument.

webpack --plugin webpack/lib/debug/ProfilingPlugin
💪 1


jihchi 09:22:52

CSS Guidelines

High-level advice and guidelines for writing sane, manageable, scalable CSS

👍 1
jihchi 17:26:30



termtosvg - Record terminal sessions as SVG animations

❤️ 1
jihchi 17:28:08



quine-relay - An uroboros program with 100+ programming languages


mofas 05:17:29
The man, the meth, the legend!
jihchi 08:31:04

Obviously Promises are not cancellable.
But what we can do, is make them lazy by wrapping them inside a function and making them quasi cancellable. Cancellable is a very small function, might be useful if you're not using Tasks, bluebird or rxjs f.e.
jihchi 09:00:11

Deriving the Y Combinator

A walkthrough of the purpose and workings of the Y combinator in JavaScript.

mofas 21:50:44
jihchi 17:35:19 @swei.hsu 上次一直找不到,最近找到了!

JavaScript Event KeyCodes

Keycode testing tool - which keys map to which keycodes?

💯 1
jihchi 22:37:51



itty-bitty - Itty.bitty is a tool to create links that contain small sites


mofas 06:07:03

Speaker Deck

ReasonReact - A Love Story

When I first met ReactJS, it was love at first sight. We built beautiful UIs for years together with our firstborn, Redux. I felt like nothing would get between us. Not even when a younger, skinnier version came along (Preact). Life was good. Everything changed when ReasonReact showed up on our block. I was curious, of course. Didn’t act on it, though. Why would I? We’d run into each other a lot since we shared the same circles. One day, the temptations got too strong. What was I thinking? Nothing about what I was doing felt right, at first. I was leaving a lot behind but for some weird reason, I knew I’d end up here anyway. I mean, it’s not like we’re splitting apart. React will still be there, but so will Reason... I’m here to announce my love affair.

mofas 12:12:55
GraphQL Europe 2018


mofas 00:34:47


The Future of GraphQL Servers - Peggy Rayzis @ GraphQL Europe 2018

mrorz 10:46:14
totally agree that sever-side adoption is super important
… But we use python in backends, and graphene is still very cryptic ._.
yhsiang 23:07:56
drop it
🎉 2
mofas 00:34:54
Best talk in graphQL Europe
jihchi 19:06:21
GitHub - rhysd/vim.wasm: Vim editor ported to WebAssembly



vim.wasm - Vim editor ported to WebAssembly

mofas 22:38:34
const reg1 = /^[abc]+$/gi;
const reg2 = /^[def]+$/gi;

const f1 = (words) => {
return words.filter(d => {
console.log(reg1.test(d), reg2.test(d));
return reg1.test(d) || reg2.test(d);

const f2 = (words) => {
return words.filter(d => {
return reg1.test(d) || reg2.test(d);

console.log(f1(['abc', 'abf', 'def']));
console.log(f2(['abc', 'abf', 'def']));

mrorz 22:50:25

> test() called multiple times on the same global regular expression instance will advance past the previous match.

看來沒事不要亂用 regexp instance 的 method,你永遠猜不到哪些會是記憶性的 lol
jihchi 23:23:56
恭喜🎉 要 reset
Michael Hsu 09:27:29
可以參考 ramda 實作 test(或直接用
每次都 new 一個新的 Reg
mofas 22:18:19
把g拿掉就好了 哪來這麼麻煩= =


mofas 22:15:55

Jxnblk Writing

The writing of Brent Jackson

mofas 22:46:28
"Avoid Apropcalypse" is really an art.
abstracting a new prop or defining a new component is a hard decision.


mofas 01:29:32
if (d > 1) ret += (d >> 1) << 1;
想不到寫js 也會有一天寫出這樣的code lol
mofas 01:41:50
唉呀, 我錯了 有更快的 `if (d > 1) ret += d & ~1;`
mofas 01:43:46
總之就是某段code要跑 `Math.floor(d/2)*2` 但是速度太慢了(這clock應該破千). 只好直接條bit 只要兩個clock
mrorz 01:46:15
`if (d > 1) ret += d - d%2` ?
調 bit 是否會比較快要看 interpreter 是否會正確翻譯 instruction 呢
mofas 01:46:38
d % 2 你這裡就在跑 除法
mofas 01:46:52
mrorz 01:53:44
那浮點數轉 int 再轉回來要多少 cycle?
mrorz 01:55:24
v8 如果能猜對 type 應該就會比較快就是了
mofas 01:56:34
mofas 01:57:30
`In Java, the bitwise operators work with integers. JavaScript doesn't have integers. It only has double precision floating-point numbers. So, the bitwise operators convert their number operands into integers, do their business, and then convert them back. In most languages, these operators are very close to the hardware and very fast. In JavaScript, they are very far from the hardware and very slow. JavaScript is rarely used for doing bit manipulation.`
mofas 01:57:43
好像真的不會快 = =
mofas 02:00:46
mrorz 10:26:10
原來 jsperf 還活著
mofas 02:00:54
module 比較快 !! lol
mrorz 10:28:11
我每次跑都不一樣,有時候 bitwise 比較快,有時候 module 比較快
mrorz 10:49:27 `uint` 發生什麼事了囧
👍 2
Michael Hsu 09:57:49
Airbnb Tech Talk: GraphQL and Apollo at Airbnb



jihchi 08:28:37

ICYMI: we have made a major release: bs-platform 4.0.0


mofas 01:25:55
eslint-scope 3.7.2 was compromised
mrorz 01:59:14
wow 大新聞
mofas 03:28:04
mrorz 10:11:20
mofas 03:28:25

Introducing Logpoints and auto-attach

Introducing Logpoints and auto-attach to make debugging easier and simpler to use in Visual Studio Code

mofas 03:56:54
This observation is especially relevant for JavaScript developers, who mostly deal with the complexity of managing state, and this might explain why most JavaScript developers still prefers to add console.log's to their source code instead of using a script debugger.
mofas 04:11:18
`Logpoints` 還蠻好用的 不用打 `console.log` 但是我還是比較喜歡一鍵執行
👍 1
jihchi 09:48:16


ESLint - Pluggable JavaScript linter

Postmortem for Malicious Packages Published on July 12th, 2018

A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.

mrorz 10:27:13
jihchi 12:39:15

Just got a report that CodePens in the official Tutorial on the React website used a two-years-old version of React (0.14).

Can’t decide if I should be embarrassed that I forgot to update them, or proud that all of them work with latest React 16 with ZERO changes.
jihchi 14:27:56

Tip: Webpack supports performance budgets for sites :moneybag:

You can..
:writing_hand: Configure a max file size (e.g JS should be < some KB)
:rotating_light: Throw a warning or error if files get large
:mag_right: Only apply to certain file extensions (.js, .css etc)
jihchi 17:28:03



react-notifications-component - Highly configurable and easy to use React Component to notify your users!


mofas 03:25:00

Fastpack · Pack JavaScript fast &amp; easy

Pack JavaScript fast &amp; easy

mofas 03:26:15
Ultra fast pack tool, 10x faster than webpack/parcel


mofas 03:34:25
How to build yourself npm worm!
mofas 21:34:10
The good example of worm! Try to find by yourself.
😂 1


mofas 03:05:35


10 years of the App Store: The design evolution of the earliest apps

One of the most significant design opportunities in recent history was announced with a simple blog post on Apple&rsquo;s website. &ldquo;Let me just say it: We want native third-party applications on the iPhone, and we plan to have an SDK in developers&rsquo; hands in February,&rdquo; Steve Jobs wrote. On a quiet Thursday morning less than a year later, the App Store opened to iPhone users with a selection of just over 500 apps. Few contemporary innovations have changed how we live our lives and interact with the world around us more than iPhone apps. The creators of the first 500 available at launch had the unique opportunity of shaping the design direction and interaction methods of the millions of apps created since. To celebrate the App Store&rsquo;s 10th anniversary, let&rsquo;s study the visual evolution of 10 original App Store apps. The Apps For the purpose of this piece, I&rsquo;ve focused exclusively on notable visual changes to apps that were available to download on day one and are still receiving updates today. While many of these apps are also available for iPad, this review highlights changes to iPhone versions. (Click on any photo to view a larger version.) iTunes Remote Apple set an example for other developers right out of the gate by publishing some of their own software on the App Store. Two of the first apps created were the game Texas Hold&rsquo;em and Remote, a simple utility for controlling playback of your Mac or Apple TV&rsquo;s iTunes library over Wi-Fi. While Texas Hold&rsquo;em was pulled from the store in 2011, Remote lives on today. From the beginning, Remote&rsquo;s design was heavily influenced by the look and feel of the iPhone&rsquo;s iPod app (today called Music). In fact, the Now Playing view was essentially identical in appearance. Version 2.0 brought a new icon designed by Louie Mantia. The two apps began to diverge at iOS 6, when the stock Music app was completely redesigned and featured a volume slider that responded dynamically to the movement of your iPhone. Remote kept a more stock appearance. The icon was again updated to match the styling of iTunes 11 on the Mac. Remote&rsquo;s first major ground-up redesign came with iOS 7. In contrast to the Music app&rsquo;s stark white theme, Remote featured a dark, blurred background that was tinted by the color of your album artwork. In 2016, Apple released the Apple TV Remote app for the 4th-generation Apple TV, a logical step forward that appeared to replace Remote. Shortly after, Remote was renamed iTunes Remote. While the app continued to be available for download, it remained practically unchanged until this past June, when it received a completely new design and support for the iPhone X&rsquo;s taller display. iTunes Remote&rsquo;s refresh returns to a much more visually conservative look reminiscent of the iOS 11 Music app, but forgoes large titles and cards in favor of traditional navigation. Instead of a red tint color, iTunes Remote uses blue to match the updated icon. Facebook In contrast to iTunes Remote&rsquo;s modest changes, the Facebook app has been continuously redesigned over the past decade with increasing frequency. A comprehensive visual history of the app would fill a small book, so I&rsquo;ve chosen to highlight eight of the more significant changes. Facebook&rsquo;s adventures on the iPhone actually began before the App Store existed. The service was initially available as one of the iPhone&rsquo;s first web apps in October 2007. Version 1.0 in the App Store is barely recognizable as Facebook today aside from the signature blue navigation bar. Even the icon is missing the signature white &ldquo;f.&rdquo; The app&rsquo;s News Feed was essentially an embellished table view above a tab bar with five icons: Home, Profile, Friends, Chat, and Inbox. Version 2.0 built on the same concept, adding two more layers of navigation underneath the main title bar. Facebook 3.0 was first previewed in July 2009, and introduced a 3&times;3 grid of icons to help solve the app&rsquo;s ballooning navigation. Early screenshots show an entirely blue tiled grid, but this design was never released in a public build of the app. In October 2011, Facebook 4.0 was an early adopter of the &ldquo;hamburger menu&rdquo; for navigation. The app&rsquo;s popularity hastened the embrace of the controversial design element across countless apps and websites in following years. After version 4, Facebook&rsquo;s design timeline becomes significantly more challenging to follow. The app&rsquo;s look began to iterate faster, and changes were often rolled out incrementally instead of being held for major releases. In April 2013, Facebook experimented with &ldquo;Chat Heads&rdquo; in the iOS app, moveable profile photos that expanded into chat windows when tapped on. iOS 7&rsquo;s new look necessitated a redesign that saw the reintroduction of a tab bar for navigation. Tab bar icons are still regularly redesigned and relocated between updates. Some of Facebook&rsquo;s design challenges come from their operational scale. Unlike many smaller apps, Facebook must offer a consistent experience to its customers on a large number of platforms, not just Apple&rsquo;s. An update in August 2017 attempted to unify the design of the News Feed across iOS, Android, and the web with comments styled to look more like a Messenger conversation. Things Things began development as a task management tool for the Mac, but ended up hitting 1.0 status on iOS first. Cultured Code, the app&rsquo;s developer, noted in their launch post that the original version was built in just over a month &ndash; a deadline that seemed impossible. Things 1.0 lacked a way to sync with the Mac version and had tagging disabled, both critical features. Despite the stressful launch, the same basic hierarchy of the app persists to this day. An excellent Flickr album documents the app&rsquo;s early design stages. The first major visual refresh came in August 2012 when Things 2.0 was released. A fresh coat of paint shed the stock iOS look, and little graphical embellishments gave it unique personality. Things 2.5 in September 2014 refreshed the app&rsquo;s UI again with a flatter look and lighter color scheme. A redesign was originally planned for Things 3, but development took longer than expected. Things 3 released in May 2017 was the most significant change the app&rsquo;s look yet. Virtually every icon and UI element was re-drawn while preserving the underlying layout. In the update&rsquo;s launch video, Cultured Code specifically highlights how animation was used to give the app an all-new feel. The redesign earned Cultured Code an Apple Design Award in 2017. OmniFocus Even in its infancy, the App Store was well-stocked with task management apps. Both Things and OmniFocus, from The Omni Group, have been available since day one. Although both apps provide similar utility, each has taken unique design directions over the past decade. OmniFocus for iPhone initially used simple table views with custom iconography for navigation, winning an Apple Design Award in 2008. The Omni Group redrew all of their artwork and the app&rsquo;s icon in June 2010 in response to the iPhone 4&rsquo;s Retina display. One of the app&rsquo;s largest changes came in June 2011 when Forecast mode was added. A glossy date picker just under the navigation bar became a defining UI element, even when the gloss was dropped in 2013 for an iOS 7-era redesign. The new flat look relied heavily on text tint colors for spatial awareness. An update in spring 2015 brought a darker app icon to the iPhone with softer edges on the check mark. Every icon since 2012 has included an Easter egg that even longtime users might not know about. Zoom in and you&rsquo;ll notice that the carbon fiber texture is actually made up of tiny, repeating Omni logos. The most recent major update to OmniFocus came this past May with OmniFocus 3.0. While many of the changes were engi…

jihchi 22:10:44



v8n - :ballot_box_with_check: JavaScript fluent validation library.

jihchi 22:23:43



graphql-engine - Blazing fast, instant GraphQL APIs on Postgres with fine grained access control


mofas 05:13:26
Twitter as your REPL.
mofas 05:14:06
"only work when you have 129k followers"
😂 2
mofas 23:25:01
Tutorial: Designing a GraphQL API


jihchi 21:57:52



rogue.js - Rogue.js - a nearly invisible framework for creating server-rendered React applications


jihchi 08:14:49

Measure web performance with the RAIL model: - goals and guidelines for faster pages. Updated for 2018 ⚡
jihchi 08:35:55

If you've been wondering how the Pipeline Proposal has been moving along, @JamesDiGioia has written a post on the @babeljs blog 🎉!
jihchi 18:21:59



yarn - :package::cat2: Fast, reliable, and secure dependency management.


jihchi 15:11:41



Front-End-Performance-Checklist - :video_game:The only Front-End Performance Checklist that runs faster than the others.

jihchi 15:11:46



pax - The fastest JavaScript bundler in the galaxy.


mofas 12:07:11



ndb is an improved debugging experience for Node.js, enabled by Chrome DevTools

👍 2
mofas 12:07:49
現在js的dev tools DX 應該top1惹
mofas 12:09:35
之前 vs code attach debug整合 node.js 已經還不錯了
mofas 12:09:44
mofas 12:10:05


mofas 08:54:49
用了vue這段時間 真的覺得vue-cli是一個大贏react eco system的設計
mofas 08:57:28
你可以開 ui 去選擇要inject什麼東西到你的project去, 不用自己 yarn install 然後調config 和 import
像是inject jest plugin 他就幫你開好資料夾 加上example code 注入npm script 和install all dependency
mofas 08:58:08
雖然覺得這沒定義好 inject不同plugin 應該會overwrite的亂七八遭 然後壞掉
mofas 08:58:13
但是目前還沒發生過 lol
mrorz 10:52:23

不過 React 也何嘗不會有這種問題呢 XDD
mrorz 10:53:12
所以 vue-cli 讓大家亂 inject 還可以繼續 work?
這樣 create-react-app 又在堅持什麼,讓大家啥都不能改 Orz
mofas 11:22:28
另外vue-cli 裡面用webpack-chain 讓你想怎麼改webpack就怎麼改
mofas 11:22:41
我用rewired-cra 寫到都快吐血惹
mofas 11:24:25
我覺得是vue-cli的plugin 已經吸取大量前人精髓(望向webpack) 所以設計的plugin可以cover到大多數人的用途 又能避免炸掉
看這精美的dev documents
mrorz 22:42:22
Next.js 也是呢
不過沒有 dev docs 一切自求多福囧
jihchi 09:19:58
beginner friendly ?
jihchi 09:59:29



react-window - React components for efficiently rendering large lists and tabular data

jihchi 10:00:23 . 各種 AutoSizer


AutoSizer · Issue #5 · bvaughn/react-window

Document an AutoSizer solution built with react-measure (based on the Resize Observer spec, can be polyfilled). This seems like a more future-friendly way of detecting resize. For the moment, I hav...

mofas 10:07:16
Shamelessly copy and use!
👍 2 2 2 😎 1
mrorz 11:39:00
由於我們希望可以重複使用 action creator,我們現在的 code base 的 action creator 有很多這種 code:
dispatch(setState('isLoading', false));

但其實上面這樣的 code 會觸發 3 次 re-render。

讀了一下 發現其實 2015 年 gaearon 曾經推薦過 redux-batched-actions:

jihchi 11:42:02
re-render 透過 PureComponent 可以不用太擔心?
mrorz 11:43:46
但我的例子裡,state 被更新了三次沒錯。

如果你的 component 是 `Form` 好死不死就 connect 了 `isLoading`, `loadError`, `data`
就會 render 三次呢 XD
jihchi 11:45:10
假設裡面的 component 沒用到 prop 就不會 re-render
mrorz 11:53:44
Hmm 確實透過夠細緻的封裝可以避免 re-render
不過同時也會進行很多的 prop comparison(當然與 vdom 比起來,這個比較確實輕量很多)

如果能把 dispatch batch 起來,就不用做這些 prop comparison 惹
mofas 21:01:22
你可以用updater pattern 呀 XD
updater => updater(reducer)

dispatcher('update', state => state.set('isLoading', false).set('loadingError', '').set('data', resp));
jihchi 21:08:44
mofas 21:10:04
我偷懶不想create action/action type/listener 的時候 整個reducer就只會有一個action 叫update XD
mofas 21:10:48
反正我已經幾乎沒在用redux log 去看action dispatch
jihchi 21:10:51
mofas 21:11:13
it is fine if you don't need to maintain
jihchi 21:11:20
jihchi 21:11:26
It’s true
mofas 21:03:40
react-select v2 offical release


A flexible and beautiful Select Input control for ReactJS with multiselect, autocomplete and ajax support.

jihchi 21:08:07
Downshift 正夯?
mofas 21:08:37
mofas 21:08:50
jihchi 21:12:25
時代不一樣,定位也不一樣。react-select 當時還是最好用
jihchi 21:12:42


jihchi 08:14:49

A quick tutorial on React's Context API - pass props around easily without "prop drilling" (and no Redux needed):
mofas 10:25:30



learn-react-source-code - :fire: Build react from scratch (code + blog)

mofas 10:25:45
mofas 10:25:55
still a good source
mrorz 10:32:56
mofas 10:36:32
mofas 10:36:44
mofas 10:37:06
這位作者 就是在fb專門負責fiber suspense那段code嘚
mrorz 10:37:19
酷,原來他有更新到 fiber
👏 1
mrorz 10:37:45 原本這個沒有 guidance 這些文件呢



building-react-from-scratch - Code for my React Rally talk.