Registry / fb-babel-plugin-utils

fb-babel-plugin-utils

JSON →
library0.13.1jsnpmunverified

A collection of shared utility functions used internally by Facebook for building Babel 7 transforms. Version 0.13.1 is the latest stable release, but the package is not intended for public consumption and has no explicit release cadence. It is tightly coupled with Facebook's internal toolchain and the `fbt` (Facebook Translation) ecosystem. Unlike general-purpose Babel utility libraries (e.g., `@babel/helper-plugin-utils`), this package provides internal helpers specific to Facebook's transform infrastructure. It is not recommended for external use.

npm install fb-babel-plugin-utils
INSTALL
IMPORT
SIG · FB-BABEL-PLUGIN-UT
F
fb-babel-plugin-utils
javascriptv0.13.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import fbBabelPluginUtils from 'fb-babel-plugin-utils'
const fbBabelPluginUtils = require('fb-babel-plugin-utils')
This package is ESM-only; CommonJS require may fail depending on Node/Babel configuration.
someExport
import { someExport } from 'fb-babel-plugin-utils'
const { someExport } = require('fb-babel-plugin-utils')
Named exports may be available, but internal structure is undocumented.
types
import { types } from 'fb-babel-plugin-utils'
import types from 'fb-babel-plugin-utils/types'
Subpath imports are not supported; always import from the main entry.

Shows importing the default export and using a utility to check JSX element type.

import fbBabelPluginUtils from 'fb-babel-plugin-utils'; import { types as t } from '@babel/core'; // Example usage: check if a node is a JSX element const isJsxElement = fbBabelPluginUtils.isJSXElement(t.JSXElement()); console.log(isJsxElement); // true
Debug
Known issues
breakingThis package is intended for internal Facebook use only; breaking changes can occur without notice.
fix
Do not depend on this package for public projects; consider using @babel/helper-plugin-utils instead.
affects: all
deprecatedThe package may use deprecated Babel 7 APIs that could break in future Babel versions.
fix
Monitor Babel compatibility updates; migrate to standard helpers if needed.
affects: >=0.10
gotchaExports are undocumented; relying on any specific export is risky as internals can change.
fix
Pin to a specific version and test thoroughly after upgrades.
affects: all
Errors
Common errors & fixes
Cannot find module 'fb-babel-plugin-utils'
Package not installed or not in node_modules.
fix
Run npm install fb-babel-plugin-utils --save-dev
fbBabelPluginUtils.isJSXElement is not a function
The export does not exist or was incorrectly imported.
fix
Check the available exports by inspecting the package's index.js or TypeScript definitions.
TypeError: t.JSXElement is not a function
Incorrect usage of @babel/types; JSXElement is a node type, not a builder.
fix
Use t.jsxElement(...) or t.jSXElement(...) depending on the version.
Upgrade
Version history
0.13.1latest on npm
Audit
Dependencies
@babel/corerequiredPeer dependency for Babel 7 plugin development
@babel/typesrequiredUsed for AST node creation and manipulation
Agent activity
2 hits · last 30 days
node
2
Resources
fb-babel-plugin-utils — npm install fb-babel-plugin-utils · libregistry