-
Notifications
You must be signed in to change notification settings - Fork 0
module
2012 edited this page Jul 20, 2020
·
2 revisions
| - | es module | node module |
|---|---|---|
| 严格模式 | 总是 | 默认不是 |
| 导出方式 | 引用(输出对外接口) | 复制(module.exports) |
| 书写位置 | 顶层 | 任意 |
| 加载方式 | 编译时输出 | 运行时加载 |
| this | undefined | module.exports |
- es 输出的是对外接口,而 node 输出的是模块对象
- es 输出的引用是 const 类型,不能重新指向新的值
| - | static import | dynamic import | require.ensure |
|---|---|---|---|
| 语法支持 | es6 模块语法 | es2017 新增动态导入 | webpack 支持的异步加载 |
| promise | 不需要 | 需要 | 需要 |
| 加载方式 | 同步 | 异步 | 异步 |
| 环境 | es6 | es6 | nodejs |
| 位置 | top level | any | any |
| 参数 | string | any | any |
- require.ensure 是 webpack 用于异步加载而编写的导入方法,不是 node.js 的方法
- import()和 require.ensure 都是基于 promise 而实现异步的
- dynamic import 不是函数,它是一个操作符,类似 typeof()
- import()和 require.ensure 可以是任何表达式,而 static import 只能是明确的字符串
JS
CSS
- float
- BFC
- position
- flex
- grid
DOM
- DOM
- how browser works
Node.js
react
- 生命周期
- setState
- hook
git
- git 基础命令
- git rebase 理解
- git bisect
- git commit
- git hook
设计模式
- 策略模式
- ...
TCP/IP 协议
- HTTP/1.x
- HTTP/2
- SSL/TLS
- TCP
- DNS
- HTTP Cache
- CORS
- http status code
linux(shell)知识点