This repository was archived by the owner on Jun 18, 2024. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork23
jgierer12/awesome-babel-macros
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A collection of awesomebabel macros and related resources
param.macro
: Partial application syntax and lambda parameters for JavaScript, inspired by Scala's_
and Kotlin'sit
ms.macro
: Convert various time formats to millisecondsdata-uri.macro
: Convert assets todata URIsregexgen.macro
: Convert set of strings to optimized regular expressiontinker.macro
: Evaluate Laravel code@lingui/macro
: Macro for internationalization inLinguiJSpipeline.macro
: Macro working similarly to the pipeline operatorpaths.macro
: Import paths like__dirname
and__filename
as static valuesfor-own.macro
: Makefor-in
only visit own propertiesfiles.macro
: Transform directory into array of file namesflavors.macro
: Build different flavors of an app by manipulating import headersyaml-to-js.macro
: Convert yaml template strings to javascript objects at build time@ts-delight/pipe.macro
: TypeScript friendly fluent pipeline API with support for async steps, additional arguments, early returns and reconciliation@ts-delight/if-expr.macro
: Expression-oriented fluent alternative to javascript's if-statement that compiles away to ternary expressions@ts-delight/switch-expr.macro
: An expression-oriented fluent alternative to javascript's switch-statement that compiles away to ternary expressions@ts-delight/async-to-generator.macro
: Transform async functions to generator functionsfast-fp.macro
: Zero overhead functional programming libraryreturn.macro
: Kotlin’s early-return guard?: return
in JavaScript
using.macro
: Wrap your resource handles into try-finally blocks automatically similarly to C#using declaration styleinline-loops.macro
: Inline to native loops for performanceassign.macro
: TranspileObject.assign
-style expressions to direct assignments
lqip.macro
: Create LQIP at build-time, similar to webpack'slqip-loader
raw.macro
: Apply webpack'sraw-loader
yaml.macro
: Load YAML files as pre-parsed objectsjson.macro
: Load JSON files individually or by pattern matching, with special support for package.json, version and tsconfig files.fetch.macro
: Allows you to build fetcher function by URL at compile-time.
traph.macro
: Transform Objects easily, leveraging object getters and graphsidx.macro
: Traverse properties on objects and arrays
typecheck.macro
: Automatically generate type-checker functions for TypeScript typests-nameof.macro
:nameof
in TypeScript
preval.macro
: Pre-evaluate code1codegen.macro
: Generate code1import-all.macro
: Import all files that match a glob
penv.macro
: Pick specified value or branch according to the build environmentdev-console.macro
: Remove allconsole.log
,console.warn
andconsole.error
calls from production buildsbabel-plugin-trace/macro
: Add labeled statement logging helpers with file and function name prefixinspect.macro
: Log an expression and the result of that expression to the consolerequire-context.macro
: Mock webpack'srequire.context()
@ts-delight/debug.macro
: Make usage ofvisionmedia/debug more convenient through build time enhancements
tersus-jsx.macro
: Inspired by AngularJS, ng-if (use tj-if) and ng-repeat (use tj-for) for neater JSX in Reacttagged-translations
: Translate text in React applicationssvgr.macro
: ApplySVGRcss-to-rn.macro
: Convert CSS to React Native style sheethooks.macro
: Automatic React Hooks memoization invalidationinline-mdx.macro
: Convert MDX into inline componentsreact-broker/macros
: Lazy-load React componentsrpi.macro
: Macro forreact-precious-image
mdi-norm/macro
: Embed Material Design system SVG iconsreactive.macro
: Reduce React boilerplate@ts-delight/inject-display-name.macro
: Inject display name into dynamically constructed componentsreact-css-modules.macro
: Map CSS Modules tostyleName
property
react-emotion/macro
: Minify and optimizeemotion stylesglamorous.macro
: Give yourglamorous components a nicedisplayName
for React DevToolsstyled-jsx/macro
: Usestyled-jsx'sresolve
tagstyled-components/macro
: Improve the debugging experience and add server-side rendering support tostyled-componentsstyled-import/macro
: Lightweight CSS parser for stealing rules from stylesheets, for use withstyled-components, React, or anywhere else you might be doing CSS in JS -- especially useful for working with global or 3rd-party stylesheetsunique-classname.macro
: Generate unique className for emotiontwin.macro
: Alternative and more up-to-date solution toTailwind as a macrocssed/macro
: 🤷♂️ CSS-in-JS modules that lets you write CSS in JS. That's it, no gimmicks
graphql.macro
: Compile GraphQL ASTblade.macro
: Generate GraphQL query strings inline and solve thedouble declaration problem
babel-plugin-macros
usage- Search npm forkeyword:babel-plugin-macros to find macros
- Difference between plugins and macros
- Zero-config code transformation with babel-plugin-macros
babel-plugin-macros
usage for macro authors- jamiebuilds/babel-handbook
- Writing custom Babel and ESLint plugins with ASTs
The following projects includebabel-plugin-macros
, so macros can be used out of the box without additional configuration:
Contributions welcome! Read thecontribution guidelines first.
To the extent possible under law, Jonas Gierer has waived all copyright andrelated or neighboring rights to this work.
About
A collection of awesome babel macros and related resources
Topics
Resources
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.