browserify / browserify/static-module

Some way of combining multiple transforms using static-module

オープン
#7 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
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 が downstream の変更を必要とせずに動作することを示すパフォーマンスおよび互換性の検証を確立します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
tooling
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。