0
自6個月起我們使用的是Typescript而不是簡單的JavaScript。如何構建一個大的打印稿文件?
目前我們的代碼正在增長(大型應用程序),一些打字稿文件大約有3000到5000行代碼。
1文件在我們的前端大部分是1視圖(例如historyView.cshtml有history.ts)。但是我們前端的一些觀點非常重要,可以做很多不錯的UI工作。
一個例子:
history.ts
namespace history
{
// 10 base functions here
export namespace zoomfunction
{
// 10 more functions here
}
export namespace chartfunctions
{
// 10 more functions here
}
// Repeat this 10 times with more namespaces and functions...
}
如何組織這個更好的方式則5000行代碼? 我讀過關於文件或模塊中的分割命名空間 - 這是「最佳實踐」?