Registry / devops / babel-plugin-proposal-object-rest-spread-stable

babel-plugin-proposal-object-rest-spread-stable

JSON →
library1.0.3jsnpmunverified

A Babel plugin that provides stable transpilation of object rest/spread properties, downgrading from the objectSpread2 helper to the original objectSpread helper to avoid potential property loss. This package is based on @babel/plugin-proposal-object-rest-spread from Babel v7.7.4. It is released on an ad-hoc basis and serves as a drop-in replacement for the official plugin when the 'useBuiltIns' option causes issues with objectSpread2. Not actively maintained; use at your own risk as it may lag behind Babel updates.

npm install babel-plugin-proposal-object-rest-spread-stable
INSTALL
IMPORT
SIG · BABEL-PLUGIN-PROPO
B
babel-plugin-proposal-object-rest-spread-stable
devopsjavascriptv1.0.3
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
// No import needed; add to .babelrc plugins array as "babel-plugin-proposal-object-rest-spread-stable"
This is a Babel plugin, not a JavaScript module. Configure it in Babel config files (e.g., .babelrc, babel.config.js).
module: @babel/plugin-proposal-object-rest-spread
module.exports = { plugins: ['babel-plugin-proposal-object-rest-spread-stable'] };
const plugin = require('babel-plugin-proposal-object-rest-spread-stable'); module.exports = { plugins: [plugin] };
Plugins are resolved by string name in Babel config; requiring them as references can work but is not recommended.

Shows how to configure the plugin in .babelrc and demonstrates object rest/spread transpilation without the objectSpread2 issues.

// .babelrc { "plugins": ["babel-plugin-proposal-object-rest-spread-stable"] } // Input source.js const { x, ...rest } = obj; const merged = { ...a, ...b }; // Run: npx babel source.js --out-file compiled.js // Output: Uses stable objectSpread helper instead of objectSpread2
Debug
Known issues
gotchaUsing this plugin may produce code that does not align with the latest Babel spec proposals.
fix
Evaluate if the objectSpread2 issues apply to your project. For most modern use cases, use @babel/plugin-proposal-object-rest-spread directly.
affects: >=1.0
deprecatedThe official @babel/plugin-proposal-object-rest-spread has been deprecated in favor of @babel/plugin-transform-object-rest-spread with preset-env.
fix
Use @babel/plugin-transform-object-rest-spread or rely on @babel/preset-env's built-in support.
affects: >=1.0
Errors
Common errors & fixes
TypeError: Cannot read property 'objectRestSpread' of undefined
Babel version mismatch or plugin not found in config.
fix
Ensure Babel 7.x is installed and the plugin is listed in .babelrc or babel.config.js.
Error: [BABEL] unknown: Requires Babel "^7.0.0-0" (in this plugin)
Using an incompatible Babel version (e.g., Babel 6).
fix
Upgrade to Babel 7 or use a different plugin for older Babel.
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
babel-plugin-proposal-object-rest-spread-stable — npm install babel-plugin-proposal-object-rest-spread-stable · libregistry