
Security News
Node.js TSC Votes to Stop Distributing Corepack
Corepack will be phased out from future Node.js releases following a TSC vote.
@babel/plugin-proposal-class-static-block
Advanced tools
The @babel/plugin-proposal-class-static-block npm package allows developers to use the static block feature in class definitions within JavaScript code. This feature is a proposal for ECMAScript and is not yet part of the official language specification. The plugin enables Babel to compile code containing static blocks so that it can run in current JavaScript environments.
Static Initialization Blocks
Static initialization blocks allow developers to write a block of code within a class definition that is executed once when the class is created. This is useful for setting up static properties or performing one-time setup for the class.
class MyClass {
static {
// Initialization code
this.myStaticProperty = 'value';
}
}
This package allows the use of private instance methods and accessors in classes. It is similar to @babel/plugin-proposal-class-static-block in that it deals with class features that are not yet part of the ECMAScript standard.
This package provides support for decorators, which are a stage 2 proposal for JavaScript. Decorators are a way to add annotations and a meta-programming syntax for class declarations and members. While decorators are not the same as static blocks, they are another example of a proposed class feature that can be used with Babel.
This package allows developers to use class properties, which are a part of the ECMAScript proposal. It enables both static and instance properties to be defined in a more concise way, similar to how @babel/plugin-proposal-class-static-block allows for static blocks.
Allow parsing of class static blocks
See our website @babel/plugin-proposal-class-static-block for more information.
Using npm:
npm install --save-dev @babel/plugin-proposal-class-static-block
or using yarn:
yarn add @babel/plugin-proposal-class-static-block --dev
v7.21.0 (2023-02-20)
babel-core
, babel-helper-create-class-features-plugin
, babel-plugin-proposal-class-properties
, babel-plugin-proposal-private-methods
, babel-plugin-proposal-private-property-in-object
babel-helper-create-regexp-features-plugin
, babel-plugin-proposal-regexp-modifiers
, babel-standalone
babel-cli
, babel-core
, babel-generator
, babel-plugin-transform-destructuring
, babel-plugin-transform-modules-commonjs
, babel-plugin-transform-react-jsx
, babel-traverse
babel-parser
, babel-types
const
modifier in type parameters (@nicolo-ribaudo)babel-generator
, babel-helpers
, babel-parser
, babel-plugin-proposal-decorators
, babel-plugin-syntax-decorators
, babel-runtime-corejs2
, babel-runtime-corejs3
, babel-runtime
2023-01
TC39 meeting (@nicolo-ribaudo)babel-parser
new.target
outside functions (@overlookmotel)annexb: false
parser option to disable Annex B (@nicolo-ribaudo)babel-core
.cts
as configuration file (@liuxingbaoyu)babel-generator
, babel-parser
, babel-plugin-transform-typescript
export type * from
(@nicolo-ribaudo)babel-plugin-transform-typescript
babel-core
babel-helper-create-class-features-plugin
, babel-plugin-proposal-class-properties
, babel-plugin-proposal-class-static-block
, babel-plugin-proposal-private-methods
, babel-plugin-transform-classes
, babel-plugin-transform-new-target
babel-parser
, babel-plugin-transform-flow-comments
, babel-plugin-transform-flow-strip-types
, babel-types
babel-core
@babel/core
(@nicolo-ribaudo)babel-plugin-transform-typescript
FAQs
Transform class static blocks
The npm package @babel/plugin-proposal-class-static-block receives a total of 3,611,669 weekly downloads. As such, @babel/plugin-proposal-class-static-block popularity was classified as popular.
We found that @babel/plugin-proposal-class-static-block demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.
Research
Security News
Research uncovers Black Basta's plans to exploit package registries for ransomware delivery alongside evidence of similar attacks already targeting open source ecosystems.
Security News
Oxlint's beta release introduces 500+ built-in linting rules while delivering twice the speed of previous versions, with future support planned for custom plugins and improved IDE integration.