You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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().
// a bunch of different transforms, more realistically pulled in separately from different modulesvarbrfs=staticModule({{fs: ... }, ... });varbrfoo=staticModule({{foo: ... }, ...});varbrbar=staticModule({{bar: ... }, ...});// combine them allvarmassiveTransform=staticModule.combine(brfs,brfoo,brbar);
Thoughts?
The text was updated successfully, but these errors were encountered:
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 usingstatic-module
(brfs
andvarlessify
(I wrote the latter)). I want to add anotherstatic-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 withinstatic-module
without requiring any changes to downstream modules likebrfs
, perhaps by returning an extra property on the result ofstaticModule()
.Thoughts?
The text was updated successfully, but these errors were encountered: