or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

index.md
tile.json

tessl/npm-babel--preset-stage-3

Deprecated Babel preset that throws an error and directs users to migrate to individual stage 3 plugins

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/@babel/preset-stage-3@7.8.x

To install, run

npx @tessl/cli install tessl/npm-babel--preset-stage-3@7.8.0

index.mddocs/

@babel/preset-stage-3

⚠️ DEPRECATED PACKAGE - This Babel preset was deprecated as of v7.0.0-beta.55. The package throws an error when used and directs users to migrate to individual stage 3 plugins for better long-term maintenance and clearer understanding of experimental features.

Package Information

  • Package Name: @babel/preset-stage-3
  • Package Type: npm
  • Language: JavaScript (ES6 modules)
  • Installation: npm install @babel/preset-stage-3 (not recommended - package is deprecated)
  • Status: Deprecated and non-functional
  • Main Entry: lib/index.js (references compiled source from /src/index.js)
  • Documentation: https://babeljs.io/docs/babel-preset-stage-3

Core Imports

Note: This preset is typically used in Babel configuration files rather than imported directly in application code.

ESM (in Node.js modules):

import presetStage3 from "@babel/preset-stage-3";

CommonJS:

const presetStage3 = require("@babel/preset-stage-3");

Important: Direct imports are not the typical usage pattern. The error occurs when this preset is used in Babel configuration.

Deprecation Notice

This package no longer provides functional preset configuration. Instead, it throws an error with migration instructions when used. The Babel team removed stage presets to encourage explicit plugin selection rather than adopting all experimental features in a given stage.

Migration Path

Recommended Replacement Configuration

Instead of using this deprecated preset, configure the following individual plugins:

{
  "plugins": [
    "@babel/plugin-syntax-dynamic-import",
    "@babel/plugin-syntax-import-meta",
    ["@babel/plugin-proposal-class-properties", { "loose": false }],
    "@babel/plugin-proposal-json-strings"
  ]
}

Migration Tools

Custom Preset Alternative

For projects needing shared configuration across multiple packages, create a custom preset:

module.exports = function() {
  return {
    plugins: [
      require("@babel/plugin-syntax-dynamic-import"),
      [require("@babel/plugin-proposal-decorators"), { "legacy": true }],
      [require("@babel/plugin-proposal-class-properties"), { "loose": false }],
    ],
    presets: [
      // Additional presets as needed
    ],
  };
};

Capabilities

Default Export Function

The package exports a single function that immediately throws an error with migration instructions.

/**
 * Deprecated preset function that throws an error with migration instructions
 * @throws {Error} Always throws with detailed migration guidance
 * @returns {never} Never returns, always throws
 */
export default function(): never;

Behavior: When called, this function throws an Error containing:

  • Explanation of the deprecation decision
  • Link to the blog post explaining the change
  • Recommended replacement plugin configuration
  • Instructions for using babel-upgrade for automated migration
  • Example of creating custom presets

Error Details

The thrown error includes comprehensive migration information:

  • Reason: Stage presets were removed for better long-term maintenance
  • Alternative: Explicit plugin configuration for better control
  • Migration Tool: babel-upgrade for automated updates
  • Documentation: Links to relevant blog posts and documentation

Typical Usage (Where Error Occurs)

This preset would normally be used in Babel configuration files. All of these configurations will now throw an error:

// .babelrc (DEPRECATED - will throw error)
{
  "presets": ["@babel/preset-stage-3"]
}
// babel.config.js (DEPRECATED - will throw error)
module.exports = {
  presets: ["@babel/preset-stage-3"]
};
// package.json babel config (DEPRECATED - will throw error)
{
  "babel": {
    "presets": ["@babel/preset-stage-3"]
  }
}

When Babel processes any of these configurations, the preset function is called and immediately throws the deprecation error.

Plugin Compatibility Notes

When migrating to individual plugins, note the following compatibility requirements:

  • Decorators + Class Properties: If using @babel/plugin-proposal-decorators, it must come before @babel/plugin-proposal-class-properties
  • Legacy Decorators: When using @babel/plugin-proposal-decorators with legacy: true, @babel/plugin-proposal-class-properties must use loose: true
  • Standalone Class Properties: If not using decorators, the loose option is not required

Error Message

The complete error message thrown by this package:

As of v7.0.0-beta.55, we've removed Babel's Stage presets.
Please consider reading our blog post on this decision at
https://babeljs.io/blog/2018/07/27/removing-babels-stage-presets
for more details. TL;DR is that it's more beneficial in the
long run to explicitly add which proposals to use.

For a more automatic migration, we have updated babel-upgrade,
https://github.com/babel/babel-upgrade to do this for you with
"npx babel-upgrade".

If you want the same configuration as before:

{
  "plugins": [
    "@babel/plugin-syntax-dynamic-import",
    "@babel/plugin-syntax-import-meta",
    ["@babel/plugin-proposal-class-properties", { "loose": false }],
    "@babel/plugin-proposal-json-strings"
  ]
}

If you're using the same configuration across many separate projects,
keep in mind that you can also create your own custom presets with
whichever plugins and presets you're looking to use.

module.exports = function() {
  return {
    plugins: [
      require("@babel/plugin-syntax-dynamic-import"),
      [require("@babel/plugin-proposal-decorators"), { "legacy": true }],
      [require("@babel/plugin-proposal-class-properties"), { "loose": false }],
    ],
    presets: [
      // ...
    ],
  };
};