-
# 前端模块化
## 为什么要使用模块
1. 独立性:模块化可以使你的代码低耦合,功能模块直接不相互影响;**好的模块,是高度独立的,它可以被随时加入或者移除,而不会损害系统。**
2. 可维护性:每个模块都是独立的,模块与外部是互不相干的,模块化以便于后续改进与维护
3. 命名空间:每个模块访问个自的模块内的变量,避免“命名空间”污染问题
4. 可复用性:方便公共模块的复用性
…
-
作者:holyZheng
转载请注明出处
模块化主要体现的是一种分而治之的思想。分而治之是软件工程的重要思想,是复杂系统开发和维护的有效措施。模块化则是前端最流行的分治手段。
> 分而治之:将一个大问题分解成多个较为独立的与原问题性质相同的小问题,将所有的小问题的解答组合起来即可得到大问题的答案。
### 模块化的意义
模块化的工程意义首先在于分治的思想,对功能进行分治,有利于我们的…
-
### What would you like or expect to see?
The link to the Slack channel on the [lab.js home page](https://lab.js.org/) needs to be fixed.
### What is currently happening?
Clicking on the link…
-
There's a way to compute dependencies efficiently and reliably on a first pass compile that would allow for the second pass to be optimized without needing to statically analyze the sass files for the…
-
You can include a collection of files in lab.js to loop over in the experiment. The framework also allows for custom plugins.
https://labjs.readthedocs.io/en/latest/reference/plugins.html
Percep…
-
## note: `jsnext:main` has been superseded by `pkg.module`, which indicates the location of a file with `import`/`export` declarations.
Typically, the `pkg.module` file will *not* have other ES2015…
-
Is the intention of this proposal that the laziness status -- whether it's been loaded-but-not-evaluated or also-fully-evaluated -- be detectable by the userland code, or that it be be opaque (impossi…
-
This is a list of the 3817 GitHub projects in Bower, that don't contain a bower.json file.
```
1140px-responsive-css-grid: github.com/aosmialowski/1140px-Responsive-CSS-Grid
320andup: github.com/mala…
-
Increasing number of this UA recently .... Worth blocking.
labjs.pro/bot
-
## 相同之处
RequireJS 和 Sea.js 都是模块加载器,倡导模块化开发理念,核心价值是让 JavaScript 的模块化开发变得简单自然。
## 不同之处
两者的主要区别如下:
1. **定位有差异**。RequireJS 想成为浏览器端的模块加载器,同时也想成为 Rhino / Node 等环境的模块加载器。Sea.js 则专注于 Web 浏览器端,同时通过 Node 扩展的方…