Part 06 · Readiness · 6.4
Sai lầm và checklist JavaScript/TypeScript
Type checker không sửa runtime races/security; framework không xóa semantics của language, browser và shipped bundle.
Red flags
Giải thích async chỉ bằng “single thread” và bỏ task/microtask/host APIs.
Dùng
JSON.parse(...) as Type, any hoặc non-null assertion thay runtime validation.Lưu secret/token dài hạn trong localStorage hoặc coi CORS là authorization.
Mutate shared module/object state và shallow copy rồi tưởng immutable.
Promise floating, timeout không abort, stale response ghi đè state mới.
Tối ưu theo dev bundle/microbenchmark, không RUM/profile/shipped artifact.
Checklist
- Tôi tách ECMAScript language khỏi browser/Node host.
- Tôi hiểu coercion/equality/numeric/reference semantics.
- Tôi dùng scope/closure/module lifecycle mà không leak shared state.
- Tôi hiểu property descriptors/prototypes/classes và pollution risk.
- Tôi hiểu call form/this/arrow/iteration/memory reachability.
- Tôi điều khiển task/microtask, Promise concurrency và cancellation.
- Tôi dùng DOM/fetch/storage theo lifecycle và origin security.
- Tôi dùng unknown, narrowing, union và runtime validation.
- Tôi thiết kế generics/modules/tsconfig theo consumer/runtime.
- Tôi đo performance, test behavior và bảo vệ supply chain.
Definition of Done
- Trả lời ít nhất 30/35 câu, giải thích được spec/host và production consequence.
- Hoàn thành ít nhất 6/8 lab, gồm async/browser và TypeScript boundary.
- Hoàn thành cả 4 execution labs với evidence tái chạy được.
- Có evidence cho race/cancellation, XSS defense và type-runtime mismatch.
- Có bundle/performance/test/supply-chain report và residual-risk note.
Pass gate: checklist chỉ đạt khi reviewer có thể tái chạy một failure fixture và thấy control sau fix; không chấp nhận output puzzle không có runtime/version context.