owned this note changed 4 years ago
Published Linked with GitHub

Jeremy Lu - 採用 TypeScript 前你該考慮的十件事

歡迎來到 JSDC 2020 下半場 | 術場 (14:00 ~ 17:00) 共筆

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

共筆入口:https://hackmd.io/9r79EYfvTgW23Yy9fgTFxA

點選主題就可以進到個別場次的共筆

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

tags: jsdc2020, 下半場 - 術場

缺點:

  • 需要寫 type
  • 為了 compile 過,常常需要改變寫法
  • 讀得更慢(code 變多)
  • 3rd party lib 是否支援?(eg. day.js, moment)
  • 平均增加 30~50 % 開發時間!
  • 不安全
    • non-soundness 可能造成 runtime 出現無法預期的錯誤

替代方案

  • flowtype
  • 乾脆不用,但調整 mindset (OO -> FP)
    • ramda、sanctuary
  • 使用狀態機
    • xstate
  • 換語言
    • AltJS -> Elm、PureScript、ReScript
    • to WASM -> Haskell、Rust
  • Type-level programming
Select a repo