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.21.4-esm.3 to 7.21.4-esm.4

lib/package.json

19

lib/index.js

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

"use strict";
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");
import { declare } from "@babel/helper-plugin-utils";
import annotateAsPure from "@babel/helper-annotate-as-pure";
import { types as t } from "@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 => {
export default declare(api => {
api.assertVersion(7);

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

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

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

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

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

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

@@ -44,0 +37,0 @@ for (const [module, methods] of PURE_CALLS) {

{
"name": "@babel/plugin-transform-react-pure-annotations",
"version": "7.21.4-esm.3",
"version": "7.21.4-esm.4",
"description": "Mark top-level React method calls as pure for tree shaking",

@@ -19,4 +19,4 @@ "repository": {

"dependencies": {
"@babel/helper-annotate-as-pure": "7.21.4-esm.3",
"@babel/helper-plugin-utils": "7.21.4-esm.3"
"@babel/helper-annotate-as-pure": "7.21.4-esm.4",
"@babel/helper-plugin-utils": "7.21.4-esm.4"
},

@@ -27,4 +27,4 @@ "peerDependencies": {

"devDependencies": {
"@babel/core": "7.21.4-esm.3",
"@babel/helper-plugin-test-runner": "7.21.4-esm.3"
"@babel/core": "7.21.4-esm.4",
"@babel/helper-plugin-test-runner": "7.21.4-esm.4"
},

@@ -31,0 +31,0 @@ "engines": {

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