or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing
xxxxxxxxxx
用 typescript 寫一個 codegen 可以學到什麼? - Wayne Tsai
歡迎來到 MOPCON 2020 共筆
- 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/@mopcon/2020
手機版請點選上方 按鈕展開議程列表。
本場簡報連結
Codegen工具
相關工具:前端模板template
code generator wrapper on vscode
開發緣由:Swagger repo 的更新趨緩
講者其他參考文章:自己用的工具自己做! 30天玩轉VS Code Extension之旅 :: 第 12 屆 iT 邦幫忙鐵人賽
TreeView 元件開發
VSCode 為物件導向,元件開發需要思考
TreeView 做為 data provider,會提供外部使用者存取事件,驅動文件自動更新
使用 Singleton 模式
使用class:
當有多個元件時,管理上較為麻煩。
其他元件類別開發情境
需在類別創建時於constructor裡使用async await處理非同步行為,可以改用static method來創建類別或元件。
Log 輸出
-> 需要如有共享的全域狀態容易發生問題,慎選使用情境。
Registry Pattern 註冊表模式
常被用於實作Service Locator。
使用Map來管理物件的註冊,是更好管理多個全域物件的方式
透過Map的has()方法判斷是否已經註冊了要用的物件或物件服務,避免使用該物件的方法時拿不到物件出錯。
VSCode裡的Registry
github連結
VSCode 的 registry命名上比較難懂
export物件時將物件型態指定為interface的類型。使用介面隔離class之間的方法,class或物件、function之間彼此只了解對方介面的方法。
將 instance 類型分類
應用:群組化、模組化
使用 enum 分隔 constant variables
盡量使用小介面為主
使用 Interface:注入端(使用者端)
使用 constructor injection
好處:
預防null建議
聽眾演講中反應
問題區
有相關問題可以在這發問喔!
tags:
MOPCON 2020