前言
花了半个月时间阅读微前端框架qiankun源码,中途老是被一些没见过的概念困扰,于是一边弥补基础知识一边整理成文章,本文着重介绍了下能阅读qiankun源码的基础前置知识索引,希望能对大家有所帮助,后续也会持续更新我在阅读源码的一些心得和解读,同时自己也在用qiankun进行着公司的项目开发,会阅读qiankun源码将会让你的开发过程一帆风顺。
TS
参考资料:了不起的 TypeScript 入门教程
-
type、interface
-
泛形
-
断言 <>、as
-
联合类型 |
-
implements,extends
ES6,7,8,9,10
参考资料:Web API 接口参考
- 解构赋值
- 类型判断 typeof,instanceof
- 正则匹配
- 原型链
- 模版字符串
- eval
- this
- call,apply,bind
- async/await
- 三元表达式 ? :
- noop
- Map
- Proxy
- Reflect
- Symbol
- CustomEvent
- Promise
- Deferred
- throw,try catch
- 箭头函数
- 函数回调栈 [() => {}, () => {}]
- ?? || &&
Object方法
参考资料:Web API Object
- Object.getOwnPropertyNames
- Object.getOwnPropertyDescriptor
- Object.hasOwnProperty
- Object.defineProperty
- Object.freeze
- Object.assign
- Object.keys
- Object.create
Array方法
参考资料:Web API Array
- Array.isArray
- Array.prototype.filter
- Array.prototype.forEach
- Array.prototype.map
- Array.prototype.some
- Array.prototype.reduce
- Array.prototype.push
- Array.prototype.splice
- Array.prototype.slice
- Array.prototype.concat
String方法
参考资料:Web API String
- String.prototype.includes
- String.prototype.indexOf (性能比startsWith好)
DOM
参考资料:Web API DOM
「DOM类型」
- HTMLHeadElement
- HTMLBodyElement
- HTMLStyleElement
- HTMLHeadElement
- HTMLScriptElement
- HTMLElement
- ShadowRoot
- CSSStyleSheet
「DOM对象」
- CSSRuleList
「DOM操作」
- insertRule
- insertBefore
- getElementById
- getAttribute
- setAttribute
- appendChild
- removeChild
- createElement
- createTextNode
- createComment
- createShadowRoot
- contains
- dispatchEvent
- attachShadow
- innerHTML
- firstChild
最后
听说爱点赞的人今年都没有秃顶。咳咳,是今年都能找到女朋友:)