nizniz187 / study-es6transpilingpolyfill Goto Github PK
View Code? Open in Web Editor NEWStudy notes for ES6 polyfill implementation.
License: MIT License
Study notes for ES6 polyfill implementation.
License: MIT License
let
→ var
)Promise.resolve().finally();
)core-js
函式庫來實現 Polyfill。node
環境下執行,綁定 npm
工具與 node
專案架構,因此需要其他工具來打包轉譯過的檔案才能與現有開發環境作整合。Babel
+ webpack
,而這些通常是跟著 React.js
需求走的。webpack
才比較容易評估。如有興趣可自行先研究:
目標 | 主題 | 工時 |
---|---|---|
webpack + polyfill | Shimming | 1 天 |
webpack + babel | @babel/polyfill in webpack babel-loader |
1 天 |
webpack + babel + VS | 相關插件 檔案配置 自動化編譯與整合 |
2 天 |
webpack + babel + VS + IIS | webpack middleware 即時編譯與部署 |
2 天 |
如只是要執行前端程式而不需要修改,從 git 下載最新版本即可,不需額外變動。前端人員會在上版前把所需資源編譯配置好,所有配置好的前端資源都會在 Assets/dist 資料夾下。
如需修改前端程式並上版,需要進行以下步驟:
其實 Modern JS 是一條往前端獨立發展的進程,所以沿著 ES6、Module API、NodeJS、babel、webpack 這條路線一直往下走,會發現前端專案管理已經自成一套體系。此時要再回頭來探討如何與 VS 這種偏向後端的 IDE 整合,就會顯得格格不入──整合相關資源少,未來發展性也不高。
因此可以說:整合進 VS 的 Modern JS 專案會是閹割後的版本;很多前端專案管理自動化或優化的功能無法實現,或是得要花額外的成本來整合實現。例如:cache 優化、動態配置檔名與打包、自動化測試等。
參考:Visual Studio +WebPack 构建Asp.net Mvc
整合議題有兩大面向:
我們會希望儘可能降低這兩者的成本,但在許多角度看來兩者似乎是相互牴觸的。
使用 ReactJS.NET
能滿足我們的基本需求:使用 babel 轉譯 ES6 語法、與 VS 建置功能整合。
主要缺點是前端的擴展性會受到限制。
前後端完全分離會是一個很好的方向。兩者的檔案放在同一目錄結構下,但使用各自的 IDE 開發;前端能因而有完整的專案管理機制,擴展性高。
主要缺點是:非主要前端開發者的學習成本高,且前後端傳值得完全 API 化(不再有 cshtml)。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.