#babel : Your first code transformations
▻https://hackernoon.com/babel-your-first-code-transformations-2d1a9a2f3bc4?source=rss----3a8144e
In this tutorial, we will do some basic transforms to some source code, using Babel. Many people find the idea of transforming code scary, and unapproachable, but utilising the power of AST’s (abstract syntax trees), and a set of tools provided to us by Babel, most of the heavy lifting is done for us.Note: The examples in the article will include code specific to react, redux, and react-redux, but familiarity with these libraries is not necessary for this tutorial.AST ExplorerThere is a website called AST explorer, that we can paste our code into and get an AST representation in many formats. This website will be useful for quickly viewing code in AST format, and will be useful when ascertaining which nodes we need to target.Basic insertionBelow, we have a file reducers.js with a couple (...)