@anolilab/babel-preset
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -0,1 +1,13 @@ | ||
## @anolilab/babel-preset [2.2.0](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/babel-preset@2.1.0...@anolilab/babel-preset@2.2.0) (2021-07-21) | ||
### Features | ||
* extended the react preset to be configurable ([559772d](https://github.com/anolilab/javascript-style-guide/commit/559772dbccb9a69a8aa23a6a0096571fc6dfd31a)) | ||
### Bug Fixes | ||
* **deps:** upgraded dependencies ([fa697d0](https://github.com/anolilab/javascript-style-guide/commit/fa697d09930c04b9c2ef2612b8940dba36a452c5)) | ||
## @anolilab/babel-preset [2.1.0](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/babel-preset@2.0.4...@anolilab/babel-preset@2.1.0) (2021-06-09) | ||
@@ -2,0 +14,0 @@ |
{ | ||
"name": "@anolilab/babel-preset", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "A babel preset for transforming your JavaScript for Anolilab.", | ||
@@ -33,27 +33,27 @@ "keywords": [ | ||
"dependencies": { | ||
"@babel/helper-plugin-utils": "^7.13.0", | ||
"@babel/plugin-proposal-class-properties": "^7.13.0", | ||
"@babel/plugin-proposal-decorators": "^7.14.2", | ||
"@babel/plugin-proposal-export-namespace-from": "^7.14.2", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.2", | ||
"@babel/plugin-proposal-numeric-separator": "^7.14.2", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.14.4", | ||
"@babel/plugin-proposal-optional-catch-binding": "^7.14.2", | ||
"@babel/plugin-proposal-optional-chaining": "^7.14.2", | ||
"@babel/plugin-proposal-private-methods": "^7.13.0", | ||
"@babel/plugin-proposal-private-property-in-object": "^7.14.0", | ||
"@babel/helper-plugin-utils": "^7.14.5", | ||
"@babel/plugin-proposal-class-properties": "^7.14.5", | ||
"@babel/plugin-proposal-decorators": "^7.14.5", | ||
"@babel/plugin-proposal-export-namespace-from": "^7.14.5", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5", | ||
"@babel/plugin-proposal-numeric-separator": "^7.14.5", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.14.7", | ||
"@babel/plugin-proposal-optional-catch-binding": "^7.14.5", | ||
"@babel/plugin-proposal-optional-chaining": "^7.14.5", | ||
"@babel/plugin-proposal-private-methods": "^7.14.5", | ||
"@babel/plugin-proposal-private-property-in-object": "^7.14.5", | ||
"@babel/plugin-syntax-async-generators": "^7.8.4", | ||
"@babel/plugin-syntax-bigint": "^7.8.3", | ||
"@babel/plugin-syntax-dynamic-import": "^7.8.3", | ||
"@babel/plugin-transform-classes": "^7.14.4", | ||
"@babel/plugin-transform-computed-properties": "^7.13.0", | ||
"@babel/plugin-transform-exponentiation-operator": "^7.12.13", | ||
"@babel/plugin-transform-jscript": "^7.12.13", | ||
"@babel/plugin-transform-member-expression-literals": "^7.12.13", | ||
"@babel/plugin-transform-parameters": "^7.14.2", | ||
"@babel/plugin-transform-property-literals": "^7.12.13", | ||
"@babel/plugin-transform-property-mutators": "^7.12.13", | ||
"@babel/plugin-transform-runtime": "^7.14.3", | ||
"@babel/plugin-transform-template-literals": "^7.13.0", | ||
"@babel/preset-env": "^7.14.4", | ||
"@babel/plugin-transform-classes": "^7.14.5", | ||
"@babel/plugin-transform-computed-properties": "^7.14.5", | ||
"@babel/plugin-transform-exponentiation-operator": "^7.14.5", | ||
"@babel/plugin-transform-jscript": "^7.14.5", | ||
"@babel/plugin-transform-member-expression-literals": "^7.14.5", | ||
"@babel/plugin-transform-parameters": "^7.14.5", | ||
"@babel/plugin-transform-property-literals": "^7.14.5", | ||
"@babel/plugin-transform-property-mutators": "^7.14.5", | ||
"@babel/plugin-transform-runtime": "^7.14.5", | ||
"@babel/plugin-transform-template-literals": "^7.14.5", | ||
"@babel/preset-env": "^7.14.8", | ||
"babel-plugin-dynamic-import-node": "^2.3.3", | ||
@@ -63,6 +63,6 @@ "babel-plugin-macros": "^3.1.0" | ||
"devDependencies": { | ||
"@babel/cli": "^7.14.3", | ||
"@babel/cli": "^7.14.8", | ||
"@babel/core": "7.14.3", | ||
"@babel/plugin-syntax-jsx": "7.12.13", | ||
"@babel/plugin-transform-typescript": "7.14.3", | ||
"@babel/plugin-transform-typescript": "7.14.4", | ||
"@babel/preset-react": "7.13.13", | ||
@@ -74,10 +74,10 @@ "@babel/preset-typescript": "7.13.0", | ||
"peerDependencies": { | ||
"@babel/core": "^7.14.3", | ||
"@babel/runtime": "^7.14.0" | ||
"@babel/core": "^7.14.8", | ||
"@babel/runtime": "^7.14.8" | ||
}, | ||
"optionalDependencies": { | ||
"@babel/plugin-syntax-jsx": "^7.12.13", | ||
"@babel/plugin-transform-typescript": "^7.14.4", | ||
"@babel/preset-react": "^7.13.13", | ||
"@babel/preset-typescript": "^7.13.0", | ||
"@babel/plugin-syntax-jsx": "^7.14.5", | ||
"@babel/plugin-transform-typescript": "^7.14.6", | ||
"@babel/preset-react": "^7.14.5", | ||
"@babel/preset-typescript": "^7.14.5", | ||
"babel-plugin-transform-react-remove-prop-types": "^0.4.24" | ||
@@ -84,0 +84,0 @@ }, |
@@ -5,8 +5,9 @@ # Babel preset | ||
Currently, contains transforms for all stage 4 (ES2018) and stage 3 syntax. | ||
It contains transforms for all stage 4 (ES2018) and stage 3 syntax. | ||
<!-- textlint-disable --> | ||
Additionally, stage 4 syntax that is excluded is as follows: | ||
- generators: regenerator-runtime is too heavyweight for our use. | ||
- lifted template literal restrictions: we do not use tagged template literals, nor implement custom DSLs, otherwise we would enable this. | ||
- Generators: regenerator-runtime is too heavyweight for our use. | ||
- Lifted template literal restrictions: we do not use tagged template literals, nor implement custom DSLs, otherwise we would enable this. | ||
<!-- textlint-enable --> | ||
[fast-async](https://github.com/MatAtBread/fast-async) is used to compile async function without generators. | ||
@@ -48,7 +49,7 @@ | ||
This module uses @babel/preset-env to target specific environments. | ||
This module uses `@babel/preset-env` to target specific environments. | ||
Please refer to [@babel/preset-env#targets](https://babeljs.io/docs/en/babel-preset-env#targets) for a list of available options. | ||
For a list of browsers please see [browserlist](https://github.com/ai/browserslist). | ||
For a list of browsers please see [browserlist](https://github.com/browserslist/browserslist). | ||
@@ -140,3 +141,3 @@ You may override our default list of targets by providing your own `targets` key. | ||
This preset can be configured to support `react`, using `"react": true` in our preset. | ||
This preset can be configured to support `react`, using `"react": true` or `"react": {...}` in our preset. | ||
@@ -156,2 +157,23 @@ ```json | ||
Or | ||
```json | ||
{ | ||
"presets": [ | ||
[ | ||
"@anolilab/babel-preset", | ||
{ | ||
"react": { | ||
"pragma": "dom", // default pragma is React.createElement (only in classic runtime) | ||
"pragmaFrag": "DomFrag", // default is React.Fragment (only in classic runtime) | ||
"throwIfNamespace": false, // defaults to true | ||
"runtime": "classic" // defaults to classic | ||
// "importSource": "custom-jsx-library" // defaults to react (only in automatic runtime) | ||
} | ||
} | ||
] | ||
] | ||
} | ||
``` | ||
## React Development Mode | ||
@@ -223,7 +245,7 @@ | ||
For example, if you are using this plugin in a deployable app, you might want to use the remove mode for your production build (and disable this transform entirely in development for optimal build speeds). | ||
For example, if you are using this plugin in a deployable app, you want to use the remove mode for your production build (and disable this transform entirely in development for optimal build speeds). | ||
## Selective loose modes | ||
By default, this preset will compile everything in normal mode. This is safer, but comes with bundle size and runtime overhead. We have some options to selectively opt in to loose mode for some features. These options are: | ||
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: | ||
@@ -257,7 +279,7 @@ - [classes](https://babeljs.io/docs/en/babel-plugin-transform-classes#loose): `looseClasses` | ||
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. | ||
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. | ||
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: | ||
Ex. If package.json has `"@babel/runtime": "^7.5.5"` then you can use: | ||
@@ -277,3 +299,3 @@ ```json | ||
Note that this will result in a runtime breakage if the version passed into the anolilab preset is newer than the version of the babel runtime actually being used at build time. | ||
> 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. | ||
@@ -280,0 +302,0 @@ ## Disabling `plugin-transform-runtime` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26620
334
Updated@babel/plugin-proposal-nullish-coalescing-operator@^7.14.5
Updated@babel/plugin-proposal-optional-catch-binding@^7.14.5
Updated@babel/plugin-proposal-private-property-in-object@^7.14.5
Updated@babel/plugin-transform-exponentiation-operator@^7.14.5
Updated@babel/plugin-transform-member-expression-literals@^7.14.5
Updated@babel/preset-env@^7.14.8