logrocket-react
Advanced tools
Comparing version 5.0.1 to 6.0.0
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -7,7 +7,5 @@ Object.defineProperty(exports, "__esModule", { | ||
exports.default = setupReact; | ||
var _reactDom = require('react-dom'); | ||
var getInstanceFromNode = void 0; | ||
var secret = _reactDom.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
var _reactDom = require("react-dom"); | ||
let getInstanceFromNode; | ||
const secret = _reactDom.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
if (secret && secret.Events && secret.Events[0]) { | ||
@@ -18,9 +16,8 @@ getInstanceFromNode = secret.Events[0]; | ||
} | ||
function setupReact() { | ||
var listener = function listener(event) { | ||
const listener = event => { | ||
try { | ||
var fiberNode = getInstanceFromNode(event.target); | ||
var names = []; | ||
var currentElement = fiberNode; | ||
const fiberNode = getInstanceFromNode(event.target); | ||
const names = []; | ||
let currentElement = fiberNode; | ||
while (currentElement) { | ||
@@ -34,2 +31,3 @@ var name = typeof currentElement.elementType === 'function' && currentElement.elementType.displayName; | ||
event.__lrName = names; | ||
console.log(names); | ||
} catch (err) { | ||
@@ -39,5 +37,6 @@ console.error('logrocket-react caught an error while hooking into React. Please make sure you are using the correct version of logrocket-react for your version of react-dom.'); | ||
}; | ||
document.body.addEventListener('click', listener, { capture: true, passive: true }); | ||
} | ||
module.exports = exports['default']; | ||
document.body.addEventListener('click', listener, { | ||
capture: true, | ||
passive: true | ||
}); | ||
} |
{ | ||
"name": "logrocket-react", | ||
"version": "5.0.1", | ||
"version": "6.0.0", | ||
"description": "React library for [LogRocket](https://logrocket.com/).", | ||
@@ -17,51 +17,27 @@ "main": "dist/index.js", | ||
"lint": "eslint src/", | ||
"build": "babel src --out-dir dist", | ||
"react:clean": "node_modules/.bin/rimraf node_modules/react node_modules/react-dom", | ||
"test": "node_modules/.bin/karma start", | ||
"test:17": "npm run react:clean && npm i react@17.0 react-dom@17.0 --no-save && npm test", | ||
"test:all": "DEV=true npm run test:17", | ||
"build": "babel src --out-dir dist --ignore **/__tests__/*.js", | ||
"react:clean": "rm -rf ./node_modules/react && rm -rf ./node_modules/react-dom", | ||
"test:18": "npm run react:clean && npm i react@18.2 react-dom@18.2 --no-save && jest --verbose false", | ||
"test": "DEV=true npm run test:18", | ||
"prepublish": "npm run build" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.11.4", | ||
"babel-core": "^6.13.0", | ||
"babel-eslint": "^7.0.0", | ||
"babel-loader": "7.1.1", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-plugin-add-react-displayname": "^0.0.4", | ||
"babel-polyfill": "^6.13.0", | ||
"babel-preset-es2015": "^6.13.2", | ||
"babel-preset-react": "^6.24.1", | ||
"babel-preset-stage-3": "^6.17.0", | ||
"chai": "^4.1.2", | ||
"enzyme": "3.2.0", | ||
"enzyme-adapter-react-16": "^1.1.0", | ||
"eslint": "^3.8.1", | ||
"eslint-config-airbnb": "^16.1.0", | ||
"eslint-plugin-import": "^2.8.0", | ||
"eslint-plugin-jsx-a11y": "^6.0.2", | ||
"eslint-plugin-mocha": "^4.11.0", | ||
"eslint-plugin-react": "^7.4.0", | ||
"json-loader": "^0.5.7", | ||
"karma": "^1.7.1", | ||
"karma-browserstack-launcher": "^1.3.0", | ||
"karma-chrome-launcher": "^2.2.0", | ||
"karma-firefox-launcher": "^1.0.1", | ||
"karma-junit-reporter": "^1.2.0", | ||
"karma-mocha": "^1.3.0", | ||
"karma-mocha-reporter": "^2.2.5", | ||
"karma-safari-launcher": "^1.0.0", | ||
"karma-sinon": "^1.0.5", | ||
"karma-webpack": "^2.0.6", | ||
"mocha": "^4.0.1", | ||
"mocha-circleci-reporter": "^0.0.2", | ||
"rimraf": "^2.6.1", | ||
"sinon": "^4.1.2", | ||
"webpack": "^1.5.1" | ||
"@babel/cli": "^7.23.0", | ||
"@babel/core": "^7.23.2", | ||
"@babel/plugin-transform-modules-commonjs": "^7.23.0", | ||
"@babel/preset-env": "^7.23.2", | ||
"@babel/preset-react": "^7.22.15", | ||
"@testing-library/jest-dom": "^6.1.4", | ||
"@testing-library/react": "^14.0.0", | ||
"@testing-library/user-event": "^14.5.1", | ||
"babel-jest": "^29.7.0", | ||
"jest": "^29.7.0", | ||
"jest-environment-jsdom": "^29.7.0", | ||
"jest-puppeteer": "^9.0.1" | ||
}, | ||
"peerDependencies": { | ||
"logrocket": ">=2.0", | ||
"react": ">=17.0", | ||
"react-dom": ">=17.0" | ||
"react": ">=18", | ||
"react-dom": ">=18" | ||
} | ||
} |
# LogRocket React plugin | ||
Optional add-on package for [logrocket](https://www.npmjs.com/package/logrocket). | ||
Please note that this is intended to be used in conjunction with build tooling that automatically adds the `displayName` property to your React components. Without this property existing, our plugin doesn't have any component names to report to LogRocket. You can also manually add them if you want LogRocket to report a different name. | ||
------ | ||
@@ -5,0 +7,0 @@ |
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
12
36
34
4765
4