跟著 Angular 一路成長的朋友,相信對 NgModule 並不陌生,它相當重要,但其複雜性通常隨著軟體規模增長。
Angular 14 提出 Angular Standalone Components 預覽版本 (ref.),隨後在 Angular 15.2 提供遷移指令 (ref.),Angular 團隊持續讓 Standalone 變得可行。
順著近日撰寫的兩篇文章,再思考 Squash commit 與合併衝突(Conflict) 的關係。
我時常透過 Gitlab 提供的 Squash commit 功能,在 Merge Request 合併的當下,將工作分支的所有 Commits 壓縮為一,再併入主線當中,讓主線維持簡潔有序,也方便未來 cherry-pick 的執行。
憑藉一時好奇,探討一下如何透過 Git 指令來重現這樣的結果。
過去我曾在文章「Jasmine 測試當中建立假物件的小技巧」介紹 Jasmine.Spy 系列方法,提到 Spy 可以幫助提高測試的「靈活度」與「可測性」,這樣的說法是基於 Spy 擁有「改變結果」與「觀察」的能力。
Jasmine.Spy
本文記錄透過 Jasmine 撰寫單元測試時,如何進行一反向的驗證,例如「不等於」某個值、「不要執行」某個行為的測試場景,並簡單描述「延遲驗證」的使用案例。
最近與團隊分享偶然看到由 BoxUK 提供的線上敏捷小遊戲 Battleships,它改編自 James Scrimshire 的發想。我們可以從一開始的模式 “Delayed feedback”…
Angular 從 v13 開始使用 Webpack5,在引入某個第三方套件後,建置(Build) 遇到錯誤:
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.This is no longer the case. Verify if you need this module and configure a polyfill for it…
使用 Angular 或其他當代前端框架/函式庫,不外乎想透過它來簡化開發,而其中「繫結」(binding) 則是要角,使繫結得以運作背後需有一列的努力,這包含變動偵測,以及決定何時偵測。
什麼時候偵測變動才是合理的?讓我們先思考有什麼操作該引發變動偵測。在 Angular Repo 當中 zone.md 已經整理需要偵測的時機,摘要如下: