2 ms·
Worth noting that sweet.js mostly fell by the sidelines after Babel came along. With babel-macros, one can write macros that look exactly like function calls.
by lhorie 8y ago
Worth noting that sweet.js mostly fell by the sidelines after Babel came along.
With babel-macros, one can write macros that look exactly like function calls. Or, more accurately, one can make any valid syntactical construct expand as a macro. Webpack and friends also do this to an extent with loaders.
In the current Javascript landscape, I don't generally see macros being used for syntactical sugar as much as they are used for code generation: things like "take this SVG file and generate a React component that renders it" or "generate the boilerplate to inject this stylesheet that I added via a ES6 import declaration".