改善內嵌 YouTube 影片的載入速度

YouTube 的 embed 會載入大量的元件,所以就有專案把對使用者沒有意義的元件都拔掉:「Lite YouTube Embed」。

從比較可以看出來 Lite YouTube Embed 下載的元件少很多:

當然在功能上有差異,不過基本的功能應該都沒問題...

雖然還是 JavaScript 實做,但可以看到實際的程式碼大概 40 行而已?(註解的行數大約是程式碼的兩倍):「lite-youtube-embed/src/lite-yt-embed.js」。

不過要注意的是,程式碼中用到 ES6 的 class 語法,所以如果要考慮到 IE11,應該是要打包轉換...

現代 JavaScript 常見的特性

GitHub 上「mbeaudru/modern-js-cheatsheet」這邊看到的,標題「Cheatsheet for the JavaScript knowledge you will frequently encounter in modern projects.」說明了文章的主題...

大約花了半個小時看完,範例給的都蠻不錯的,讓人容易了解...

AWS Lambda 支援 Node.js 4.3

AWS 宣佈 Lambda 支援 Node.js 4.3:「AWS Lambda Supports Node.js 4.3」:

You can now develop your AWS Lambda functions using Node.js 4.3.2 in addition to Node.js 0.10.4.

另外同步在「Node.js 4.3.2 Runtime Now Available on Lambda」這邊也有文章介紹。

這樣總算可以拿出新的套件以及語法了...

Node.js 的 LTS 計畫

Node.js 在 4.0 開始啟動 LTS (Long Term Support) 計畫:「Node v4.0.0 (Stable)」。

可以參考「Node.js Long-term Support Working Group」這邊的說明。最主要的重點是生命週期,首先是每六個月就會放一次新版,跟 Ubuntu 相同,也都是四月與十月:

In parallel, we will be branching a new Stable line of releases every 6 months, one in October and one in April each year.

每個 LTS 版本將會有 18 + 12 = 30 個月的支援期:

This means that there will be overlapping LTS branches being maintained throughout the year, each receiving attention for a total of 30 months (LTS plus Maintenance).

這張圖說明了 LTS 與維護的時間線:

有個 LTS 的指標可以挑了...