Socket
Socket
Sign inDemoInstall

@anolilab/babel-preset

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@anolilab/babel-preset - npm Package Compare versions

Comparing version 2.3.1 to 3.0.0

11

CHANGELOG.md

@@ -0,1 +1,12 @@

## @anolilab/babel-preset [3.0.0](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/babel-preset@2.3.1...@anolilab/babel-preset@3.0.0) (2021-09-16)
### ⚠ BREAKING CHANGES
* Babel runtime transform need to be added manually if needed
### Performance Improvements
* removed babel/plugin-transform-runtime ([0cd296b](https://github.com/anolilab/javascript-style-guide/commit/0cd296b72283f22ff0a984dfd46ab0a830f944ac))
### @anolilab/babel-preset [2.3.1](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/babel-preset@2.3.0...@anolilab/babel-preset@2.3.1) (2021-09-13)

@@ -2,0 +13,0 @@

9

package.json
{
"name": "@anolilab/babel-preset",
"version": "2.3.1",
"version": "3.0.0",
"description": "A babel preset for transforming your JavaScript for Anolilab.",

@@ -49,2 +49,3 @@ "keywords": [

"@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/plugin-proposal-class-static-block": "^7.15.4",
"@babel/plugin-proposal-decorators": "^7.14.5",

@@ -61,3 +62,2 @@ "@babel/plugin-proposal-export-namespace-from": "^7.14.5",

"@babel/plugin-syntax-bigint": "^7.8.3",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-classes": "^7.14.9",

@@ -71,3 +71,2 @@ "@babel/plugin-transform-computed-properties": "^7.14.5",

"@babel/plugin-transform-property-mutators": "^7.14.5",
"@babel/plugin-transform-runtime": "^7.15.0",
"@babel/plugin-transform-template-literals": "^7.14.5",

@@ -87,8 +86,6 @@ "@babel/preset-env": "^7.15.0",

"@babel/preset-typescript": "7.15.0",
"@babel/runtime": "7.15.4",
"babel-plugin-transform-react-remove-prop-types": "0.4.24"
},
"peerDependencies": {
"@babel/core": "^7.15.0",
"@babel/runtime": "^7.15.3"
"@babel/core": "^7.15.0"
},

@@ -95,0 +92,0 @@ "optionalDependencies": {

@@ -259,3 +259,3 @@ # Babel preset

By default, this preset will compile everything in normal mode. This is safer, but comes with bundle size and runtime overhead. We have options to selectively opt in to loose mode for features. These options are:
By default, this preset will compile everything in lose mode. We have options to selectively opt out to loose mode for features. These options are:

@@ -266,2 +266,3 @@ - [classes](https://babeljs.io/docs/en/babel-plugin-transform-classes#loose): `looseClasses`

- [template literals](https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose): `looseTemplateLiterals`
- [object rest spread](https://babeljs.io/docs/en/babel-plugin-proposal-object-rest-spread#loose): `looseObjectRestSpread`

@@ -276,6 +277,7 @@ Example:

{
"looseClasses": true,
"looseComputedProperties": true,
"looseParameters": true,
"looseTemplateLiterals": true
"looseClasses": false,
"looseComputedProperties": false,
"looseParameters": false,
"looseTemplateLiterals": false,
"looseObjectRestSpread": false
}

@@ -289,29 +291,2 @@ ]

## Specifying a babel runtime version
By default @babel/plugin-transform-runtime will [assume the oldest version of the runtime](https://github.com/babel/babel/blob/e6264a09921c60b8f18870d0a75678e4fa04f0f8/packages/babel-plugin-transform-runtime/src/index.js#L42) to avoid importing helpers that don’t exist which would fail at runtime. This can result in newer helpers being inlined into modules (ex. objectSpread2) which increases bundle size.
To avoid this you can configure the preset to use the same version of the runtime that’s installed in your package.json.
Ex. If package.json has `"@babel/runtime": "^7.5.5"` then you can use:
```json
{
"presets": [
[
"@anolilab/babel-preset",
{
"runtimeVersion": "7.5.5"
}
]
]
}
```
> Note: This will result in a runtime breakage if the version passed into the anolilab preset is newer than the version of the babel runtime being used at build time.
## Disabling `plugin-transform-runtime`
You can use the `transformRuntime` option to disable [`@babel/plugin-transform-runtime`](https://babeljs.io/docs/en/babel-plugin-transform-runtime). Specifying `false` will disable the plugin. This option defaults to `true`.
## Specifying module transforms

@@ -336,22 +311,5 @@

You can use the `runtimeHelpersUseESModules` option to prevent transformation of runtime helpers to CommonJS modules.
```json
{
"presets": [
[
"@anolilab/babel-preset",
{
"runtimeHelpersUseESModules": true
}
]
]
}
```
`true` will not transform runtime helpers to CommonJS modules. `false` will transform runtime helpers to CommonJS modules. The option defaults to `true` if `modules` is set to `false`, and `false` otherwise.
## Optimizations
- [`babel-plugin-annotate-pure-calls`](https://github.com/Andarist/babel-plugin-annotate-pure-calls): Injects for `#__PURE` annotations to enable treeshaking
- [`babel-plugin-annotate-pure-calls`](https://github.com/Andarist/babel-plugin-annotate-pure-calls): Injects for `#__PURE` annotations to enable tree-shaking
- [`babel-plugin-dev-expressions`](https://github.com/4Catalyzer/babel-plugin-dev-expression): A mirror of Facebook's dev-expression Babel plugin. It reduces or eliminates development checks from production code

@@ -358,0 +316,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc