A collection of awesome babel macros and related resources
Switch branches/tags
Nothing to show
Clone or download
Latest commit 735086e Dec 13, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitattributes Init Nov 14, 2018
code-of-conduct.md Init Nov 14, 2018
contributing.md Init Nov 14, 2018
readme.md Remove broken link Dec 13, 2018

readme.md

Awesome babel macros Awesome

A collection of awesome babel macros and related resources

Contents


Macros

General

Object/Array manipulation

  • traph.macro: Transform Objects easily, leveraging object getters and graphs
  • idx.macro: Traverse properties on objects and arrays
  • assign.macro: Transpile Object.assign-style expressions to direct assignments

Code generation

Development

  • scope.macro: Useful build time console functions
  • penv.macro: Pick specified value or branch according to the build environment
  • dev-console.macro: Remove all console.log, console.warn and console.error calls from production builds
  • babel-plugin-trace/macro: Add labeled statement logging helpers with file- and function name prefix
  • inspect.macro: Log an expression and the result of that expression to the console

React

CSS-in-JS

GraphQL

Resources

General

Developing macros

Integrations

The following projects include babel-plugin-macros, so macros can be used out-of-the-box without additional configuration:


Footnotes

  1. preval vs codegen ↩️

Contribute

Contributions welcome! Read the contribution guidelines first.

License

CC0

To the extent possible under law, Jonas Gierer has waived all copyright and related or neighboring rights to this work.