Socket
Socket
Sign inDemoInstall

@babel/plugin-transform-react-pure-annotations

Package Overview
Dependencies
Maintainers
4
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-transform-react-pure-annotations - npm Package Compare versions

Comparing version 7.22.5 to 8.0.0-alpha.0

19

lib/index.js

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

"use strict";
import { declare } from '@babel/helper-plugin-utils';
import annotateAsPure from '@babel/helper-annotate-as-pure';
import { types } from '@babel/core';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _helperPluginUtils = require("@babel/helper-plugin-utils");
var _helperAnnotateAsPure = require("@babel/helper-annotate-as-pure");
var _core = require("@babel/core");
const PURE_CALLS = [["react", new Set(["cloneElement", "createContext", "createElement", "createFactory", "createRef", "forwardRef", "isValidElement", "memo", "lazy"])], ["react-dom", new Set(["createPortal"])]];
var _default = (0, _helperPluginUtils.declare)(api => {
var index = declare(api => {
api.assertVersion(7);

@@ -18,3 +13,3 @@ return {

if (isReactCall(path)) {
(0, _helperAnnotateAsPure.default)(path);
annotateAsPure(path);
}

@@ -25,3 +20,2 @@ }

});
exports.default = _default;
function isReactCall(path) {

@@ -41,3 +35,3 @@ const calleePath = path.get("callee");

const callee = calleePath.node;
if (!callee.computed && _core.types.isIdentifier(callee.property)) {
if (!callee.computed && types.isIdentifier(callee.property)) {
const propertyName = callee.property.name;

@@ -53,2 +47,3 @@ for (const [module, methods] of PURE_CALLS) {

export { index as default };
//# sourceMappingURL=index.js.map
{
"name": "@babel/plugin-transform-react-pure-annotations",
"version": "7.22.5",
"version": "8.0.0-alpha.0",
"description": "Mark top-level React method calls as pure for tree shaking",

@@ -19,17 +19,21 @@ "repository": {

"dependencies": {
"@babel/helper-annotate-as-pure": "^7.22.5",
"@babel/helper-plugin-utils": "^7.22.5"
"@babel/helper-annotate-as-pure": "^8.0.0-alpha.0",
"@babel/helper-plugin-utils": "^8.0.0-alpha.0"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
"@babel/core": "^8.0.0-alpha.0"
},
"devDependencies": {
"@babel/core": "^7.22.5",
"@babel/helper-plugin-test-runner": "^7.22.5"
"@babel/core": "^8.0.0-alpha.0",
"@babel/helper-plugin-test-runner": "^8.0.0-alpha.0"
},
"engines": {
"node": ">=6.9.0"
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
},
"author": "The Babel Team (https://babel.dev/team)",
"type": "commonjs"
"exports": {
".": "./lib/index.js",
"./package.json": "./package.json"
},
"type": "module"
}

@@ -5,3 +5,3 @@ # @babel/plugin-transform-react-pure-annotations

See our website [@babel/plugin-transform-react-pure-annotations](https://babeljs.io/docs/en/babel-plugin-transform-react-pure-annotations) for more information.
See our website [@babel/plugin-transform-react-pure-annotations](https://babeljs.io/docs/babel-plugin-transform-react-pure-annotations) for more information.

@@ -8,0 +8,0 @@ ## Install

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