browserify / browserify/static-module
Some way of combining multiple transforms using static-module
- 主要语言
- JavaScript
- 星标
- 75
- 派生
- 22
- PR 合并指标
- 30 天内没有已合并 PR
描述
This is gonna be the most half-formed feature request I've ever posted on GitHub. Sorry!
**The problem to solve:** Since `static-module` works by parsing into an AST, transforming, and code-generating, it has a pretty significant overhead associated with it. For example: I have a script build using Browserify which takes about 8 seconds, where <2 seconds are spent compiling (TypeScript) and the remaining >6 seconds are spent in various transforms using `static-module` (`brfs` and `varlessify` (I wrote the latter)). I want to add another `static-module`-based transform, but I hesitate to add another 3 seconds to my incremental build time!
**Imagine a world** where multiple transforms using `static-module` could be combined into a single transform, thus significantly decreasing the performance impact. The source would only have to get parsed into an AST once! This would open the door to scalable use of tons of compile-time transformations. I'm not sure what the API for this would look like, but I have an inkling that it could _possibly_ be done entirely within `static-module` without requiring any changes to downstream modules like `brfs`, perhaps by returning an extra property on the result of `staticModule()`.
``` js
// a bunch of different transforms, more realistically pulled in separately from different modules
var brfs = staticModule({ { fs: ... }, ... });
var brfoo = staticModule({ { foo: ... }, ...});
var brbar = staticModule({ { bar: ... }, ...});
// combine them all
var massiveTransform = staticModule.combine(brfs, brfoo, brbar);
```
Thoughts?
贡献指南
这个仓库没有索引到贡献指南
调研方向
首先检查 static-module 当前的 transform API,以及 issue 中提到的相关 Browserify transforms,包括 brfs 和 varlessify。定义一个具体的组合 API,使其对每个源只进行一次解析和生成,然后建立性能和兼容性检查,以证明组合后的 transforms 无需下游更改即可正常工作。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- tooling
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100