Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fullstory/babel-plugin-annotate-react

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fullstory/babel-plugin-annotate-react - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

4

CHANGELOG.md
# Changelog
## 2.2.1
- Added a blocklist for known-incompatible node modules.
## 2.2.0

@@ -4,0 +8,0 @@

@@ -10,5 +10,43 @@ const webComponentName = 'data-component';

const nativeOptionName = 'native';
const annotateFragmentsOptionName = 'annotate-fragments'
const ignoreComponentsOptionName = 'ignoreComponents'
const annotateFragmentsOptionName = 'annotate-fragments';
const ignoreComponentsOptionName = 'ignoreComponents';
const knownIncompatiblePlugins = [
// This module might be causing an issue preventing clicks. For safety, we won't run on this module.
'react-native-testfairy',
// This module checks for unexpected property keys and throws an exception.
'@react-navigation',
// The victory* modules use `dataComponent` and we get a collision.
'victory',
'victory-area',
'victory-axis',
'victory-bar',
'victory-box-plot',
'victory-brush-container',
'victory-brush-line',
'victory-candlestick',
'victory-canvas',
'victory-chart',
'victory-core',
'victory-create-container',
'victory-cursor-container',
'victory-errorbar',
'victory-group',
'victory-histogram',
'victory-legend',
'victory-line',
'victory-native',
'victory-pie',
'victory-polar-axis',
'victory-scatter',
'victory-selection-container',
'victory-shared-events',
'victory-stack',
'victory-tooltip',
'victory-vendor',
'victory-voronoi',
'victory-voronoi-container',
'victory-zoom-container',
];
module.exports = function({ types: t }) {

@@ -22,2 +60,3 @@ return {

if (!path.node.id || !path.node.id.name) return
if (isKnownIncompatiblePluginFromState(state)) return
functionBodyPushAttributes(

@@ -35,2 +74,3 @@ state.opts[annotateFragmentsOptionName] === true,

if (!path.parent.id || !path.parent.id.name) return
if (isKnownIncompatiblePluginFromState(state)) return
functionBodyPushAttributes(

@@ -56,2 +96,3 @@ state.opts[annotateFragmentsOptionName] === true,

if (!render || !render.traverse) return
if (isKnownIncompatiblePluginFromState(state)) return

@@ -80,3 +121,3 @@ const ignoreComponentsFromOption = this.ignoreComponentsFromOption;

function sourceFileNameFromState(state) {
function fullSourceFileNameFromState(state) {
const name = state.file.opts.parserOpts.sourceFileName

@@ -86,2 +127,11 @@ if (typeof name !== 'string') {

}
return name
}
function sourceFileNameFromState(state) {
const name = fullSourceFileNameFromState(state)
if (name === undefined) {
return undefined
}
if (name.indexOf('/') !== -1) {

@@ -96,2 +146,19 @@ return name.split('/').pop()

function isKnownIncompatiblePluginFromState(state) {
const fullSourceFileName = fullSourceFileNameFromState(state)
if (fullSourceFileName == undefined) {
return false
}
for (let i = 0; i < knownIncompatiblePlugins.length; i += 1) {
let pluginName = knownIncompatiblePlugins[i];
if (fullSourceFileName.includes("/node_modules/" + pluginName + "/") ||
fullSourceFileName.includes("\\node_modules\\" + pluginName + "\\")) {
return true
}
}
return false
}
function attributeNamesFromState(state) {

@@ -98,0 +165,0 @@ if(state.opts[nativeOptionName] === true) {

2

package.json
{
"name": "@fullstory/babel-plugin-annotate-react",
"version": "2.2.0",
"version": "2.2.1",
"description": "A Babel plugin that annotates React components, making them easier to target with FullStory search",

@@ -5,0 +5,0 @@ "main": "index.js",

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