Registry /
serialization / babel-plugin-extensible-destructuring
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
plugin
✓ // .babelrc
{
"plugins": ["extensible-destructuring"]
}
✗ // Wrong: using 'babel-plugin-extensible-destructuring' with Babel 6 (works but not short name)
{
"plugins": ["babel-plugin-extensible-destructuring"]
}
For Babel 6, use short name 'extensible-destructuring'. For Babel 7, use full name 'babel-plugin-extensible-destructuring'.
plugin with options
✓ // .babelrc
{
"plugins": [["extensible-destructuring", { "mode": "optin", "impl": "safe" }]]
}
✗ // Wrong: omitting double array brackets
{
"plugins": ["extensible-destructuring", { "mode": "optin" }]
}
Options must be passed as an array inside the plugins array: [ [pluginName, options] ].
use extensible directive
✓ // top of file
'use extensible';
var {a} = obj;
✗ // Wrong: misspelling
'use extansible';
var {a} = obj;
In opt-in mode, you must add 'use extensible' at the top of each file to enable transformation.
Demonstrates setup with Babel 7 and immutable mode destructuring of an Immutable.js Map.
// Install dependencies
// npm install --save-dev babel-plugin-extensible-destructuring
// npm install --save extensible-runtime
// .babelrc
{
"presets": ["@babel/preset-env"],
"plugins": ["babel-plugin-extensible-destructuring"]
}
// src/index.js (opt-in mode by default)
'use extensible';
import { fromJS } from 'immutable';
const map = fromJS({ author: { name: { first: "John", last: "Doe" }, birthdate: "10-10-2010" } });
const { author: { name: { first, last }, birthdate } } = map;
console.log(first, last, birthdate); // John Doe 10-10-2010
Errors
Common errors & fixes
Error: Cannot find module 'extensible-runtime'
Runtime package not installed.
fixnpm install --save extensible-runtime
ReferenceError: __extensible_get__ is not defined
Missing runtime import or Babel not transforming correctly.
fixEnsure both plugin and runtime are installed and Babel is configured correctly.
TypeError: Cannot destructure property 'x' of 'undefined' or 'null'
Using safe mode but the value is null, not undefined.
fixSafe mode only prevents undefined; for null, use a default value or check beforehand.
Audit
Dependencies
extensible-runtimerequiredProvides the runtime `__extensible_get__` function used by the transformed code.