I created JSShaper a year and a half ago because I needed a way to do source-preserving JS-to-JS transformations so that I could implement
restricter, I decided to write a bunch of other plugins as well to show as examples if nothing else. One of the simplest of these ended up being one of the most useful, namely
I wanted to share with you some recent good stuff happening in Shaper land.
C. Scott Ananian has created the most advanced Shaper plugin yet, yielder, which transforms
cscott also contributed a number of fixes to Shaper, imported a newer version of Narcissus and rebased all my modifications on top of it. If you find any valid JS that Shaper fails parsing or round-tripping (
node run-shaper.js yourfile.js --source) then please open an issue and we’ll fix it.
I gave the same talk at Front-Trends the month before, which was my international conference speaking debut. Both talks were recorded so I’ll post the links once available. If you want me to come talk somewhere about coding with a focus on “easier to reason about”, restrict mode, Shaper or something related just contact me! I can easily do an hour presentation about Shaper and the concepts behind it, for example.
Creating Shaper plugins is very fun, and not that hard. Try it! To get started I recommend checking out the sources for
stringconverter (simple transformational plugins) or
bitwiser (simple static analysis plugin). You’ll find these in the
plugins/ directory. Then check out everything in the
examples/ directory as well.
Thank you for trying out, contributing to, writing about or filing issues on JSShaper.
Follow me on Twitter