diff --git a/extension/background.ts b/extension/background.ts index 3b20342..7cb49e8 100644 --- a/extension/background.ts +++ b/extension/background.ts @@ -1,4 +1,4 @@ -console.log("BACKGROUND.TS: Loaded"); +// console.log("BACKGROUND.TS: Loaded"); let devToolPort: chrome.runtime.Port | null = null; let activeContentPort: chrome.runtime.Port | null = null; @@ -8,11 +8,11 @@ let devToolMessageQueue: any = []; let contentMessageQueue: any = []; // Listen for connection from content.ts and devtools panel -chrome.runtime.onConnect.addListener((port) => { - console.log("BACKGROUND.TS: Connection established: ", port); - if (port.name === "content-background") { +chrome.runtime.onConnect.addListener(port => { + // console.log('BACKGROUND.TS: Connection established: ', port); + if (port.name === 'content-background') { handleContentConnection(port); - } else if (port.name === "background-devtool") { + } else if (port.name === 'background-devtool') { handleDevToolsConnection(port); } }); @@ -37,14 +37,14 @@ function handleContentConnection(port: chrome.runtime.Port) { contentMessageQueue = []; // If devtool is connected send messages otherwise place in queue - activeContentPort.onMessage.addListener((message) => { + activeContentPort.onMessage.addListener(message => { // The background script goes inactive after 30 seconds idle so we log every 25 seconds - if (message.type === "heartbeat") { - console.log("BACKGROUND.TS: Logging to keep service worker connected"); + if (message.type === 'heartbeat') { + // console.log('BACKGROUND.TS: Logging to keep service worker connected'); } if (devToolPort) { - console.log("BACKGROUND.TS: Message to dev tool", message); + // console.log('BACKGROUND.TS: Message to dev tool', message); devToolPort.postMessage(message); } else { devToolMessageQueue.push(message); @@ -52,13 +52,13 @@ function handleContentConnection(port: chrome.runtime.Port) { }); port.onDisconnect.addListener(() => { - console.log("BACKGROUND.TS: Content.ts disconnected"); + // console.log('BACKGROUND.TS: Content.ts disconnected'); activeContentPort = null; }); } function handleDevToolsConnection(port: chrome.runtime.Port) { - console.log("BACKGROUND.TS: DevTool connected"); + // console.log('BACKGROUND.TS: DevTool connected'); devToolPort = port; // Send queued messages from the devtool before connection was established @@ -68,22 +68,22 @@ function handleDevToolsConnection(port: chrome.runtime.Port) { devToolMessageQueue = []; // If content.ts is connected send messages otherwise place in queue - devToolPort.onMessage.addListener((message) => { - if (message.type === "profiling-status") { - console.log("BACKGROUND.TS: Profiling status", message); + devToolPort.onMessage.addListener(message => { + if (message.type === 'profiling-status') { + // console.log('BACKGROUND.TS: Profiling status', message); } - console.log('Injecting content.js into tab with message: ', message); - if (message.action === "injectContentScript" && message.tabId) { - console.log( - "BACKGROUND.TS: Injecting content script into tab:", - message.tabId - ); + // console.log('Injecting content.js into tab with message: ', message); + if (message.action === 'injectContentScript' && message.tabId) { + // console.log( + // 'BACKGROUND.TS: Injecting content script into tab:', + // message.tabId + // ); chrome.scripting.executeScript({ target: { tabId: message.tabId }, - files: ["content.js"], + files: ['content.js'], }); } else if (activeContentPort) { - console.log("BACKGROUND.TS: Message to content.ts", message); + // console.log('BACKGROUND.TS: Message to content.ts', message); activeContentPort.postMessage(message); } else { // console.log('BACKGROUND.TS: Message added to content.ts queue'); @@ -92,7 +92,7 @@ function handleDevToolsConnection(port: chrome.runtime.Port) { }); port.onDisconnect.addListener(() => { - console.log("BACKGROUND.TS: DevTool disconnected"); + // console.log('BACKGROUND.TS: DevTool disconnected'); devToolPort = null; }); } diff --git a/extension/content_scripts/content.ts b/extension/content_scripts/content.ts index 907316b..efa834a 100644 --- a/extension/content_scripts/content.ts +++ b/extension/content_scripts/content.ts @@ -1,38 +1,38 @@ - // Function to inject the script into the current tab - const inject = () => { - let isInjected = false; - - return function(fileName: string) { - if (!isInjected) { - if (document.getElementById("treeScript-jkhsdfkdshdsf")) { - console.log('Tree script already injected'); - return; - } - const treeScript = document.createElement("script"); - // Adding a unique id to the script tag to prevent it from being injected multiple times because my closure isn't working for some reason (not sure if it's because of how content scripts work or something else) - treeScript.id = "treeScript-jkhsdfkdshdsf"; - treeScript.setAttribute("type", "text/javascript"); - treeScript.setAttribute("src", chrome.runtime.getURL(fileName)); - document.body.appendChild(treeScript); - isInjected = true; - console.log('Injected tree script'); - } else { - console.log('Tree script already injected'); +// Function to inject the script into the current tab +const inject = () => { + let isInjected = false; + + return function (fileName: string) { + if (!isInjected) { + if (document.getElementById('treeScript-jkhsdfkdshdsf')) { + // console.log('Tree script already injected'); + return; } + const treeScript = document.createElement('script'); + // Adding a unique id to the script tag to prevent it from being injected multiple times because my closure isn't working for some reason (not sure if it's because of how content scripts work or something else) + treeScript.id = 'treeScript-jkhsdfkdshdsf'; + treeScript.setAttribute('type', 'text/javascript'); + treeScript.setAttribute('src', chrome.runtime.getURL(fileName)); + document.body.appendChild(treeScript); + isInjected = true; + // console.log('Injected tree script'); + } else { + // console.log('Tree script already injected'); } }; +}; // Immediatly-Invoked Function Expression (IIFE) (function () { // Check if the content script has already been loaded into the current tab // Prevents it from injecting into the same page twice if the developer opens and closes the dev tool if (window.myContentScriptLoaded) { - console.log("CONTENT.TS: Content script already injected"); + // console.log("CONTENT.TS: Content script already injected"); return; } else { // Set the flag on the window to indicate the content script has already been loaded in the tab window.myContentScriptLoaded = true; - console.log("CONTENT.TS: Loaded"); + // console.log("CONTENT.TS: Loaded"); } let appConnected = false; @@ -44,21 +44,21 @@ // Function to setup and initialize the background port function setupPort() { - console.log("CONTENT.TS: Background.ts Connected"); + // console.log("CONTENT.TS: Background.ts Connected"); // Connect to background script - backgroundPort = chrome.runtime.connect({ name: "content-background" }); + backgroundPort = chrome.runtime.connect({ name: 'content-background' }); // Handle background.ts messages - send message if connected to app otherwise add to queue - backgroundPort.onMessage.addListener((message) => { - console.log("CONTENT.TS: BackgroundPort.OnMessage: ", message.data?.type); + backgroundPort.onMessage.addListener(message => { + // console.log("CONTENT.TS: BackgroundPort.OnMessage: ", message.data?.type); if (appConnected) { - console.log("CONTENT.TS: Message to app", message); + // console.log("CONTENT.TS: Message to app", message); // Inject script to get react tree data - if (message.type === "profiling-status") { - console.log('tree script *should* be injected'); + if (message.type === 'profiling-status') { + // console.log('tree script *should* be injected'); const scriptToInject = inject(); - scriptToInject("inject.js"); + scriptToInject('inject.js'); // return so message isn't posted anywhere return; } @@ -69,7 +69,7 @@ }); backgroundPort.onDisconnect.addListener(() => { - console.log("CONTENT.TS: Background.ts Disconnected"); + // console.log('CONTENT.TS: Background.ts Disconnected'); // Reset the port to trigger reconnection attempt backgroundPort = null; setupPort(); @@ -82,13 +82,13 @@ } // Add listener to the window to handle messages from the app - window.addEventListener("message", handleMessageFromApp, false); + window.addEventListener('message', handleMessageFromApp, false); function handleMessageFromApp(message: MessageEvent) { - console.log("CONTENT.TS: handleMessageFromApp", message.data?.type); + // console.log('CONTENT.TS: handleMessageFromApp', message.data?.type); // Initial message from the app to confirm connection - if (message.data?.type === "app-connected") { - console.log("CONTENT.TS: App Connected"); + if (message.data?.type === 'app-connected') { + // console.log('CONTENT.TS: App Connected'); clearInterval(appConnectionInterval); appConnected = true; appMessageQueue.forEach((message: any) => window.postMessage(message)); @@ -96,8 +96,8 @@ } // Send tree data to background.ts - if (message.data.type && message.data.type === "tree") { - console.log("CONTENT.ts: component tree sending event: ", message); + if (message.data.type && message.data.type === 'tree') { + // console.log('CONTENT.ts: component tree sending event: ', message); backgroundPort?.postMessage({ type: message.data.type, data: JSON.parse(message.data.eventListStr), @@ -106,7 +106,7 @@ } // All other messages are sent to background.ts - if (message.data?.type === "event") { + if (message.data?.type === 'event') { // console.log('CONTENT.TS: Message from App:', message); sendMessageToBackground(message); } @@ -115,7 +115,7 @@ // Notify app that content.ts is ready function establishAppConnection() { if (!appConnected) { - window.postMessage({ type: "content-script-ready" }, "*"); + window.postMessage({ type: 'content-script-ready' }, '*'); } } @@ -125,7 +125,7 @@ // Function to send a heartbeat message to the background script to keep it active function sendHeartbeat() { - backgroundPort?.postMessage({ type: "heartbeat" }); + backgroundPort?.postMessage({ type: 'heartbeat' }); // console.log('heartbeat'); } diff --git a/extension/content_scripts/inject.ts b/extension/content_scripts/inject.ts index 53ce9b4..5c9a3d5 100644 --- a/extension/content_scripts/inject.ts +++ b/extension/content_scripts/inject.ts @@ -1,5 +1,8 @@ //retrieve global hook and save in reactdevglobahook variable, used to interact w/react devtools -console.log('INJECT.TS - React Dev Tools: ', window.__REACT_DEVTOOLS_GLOBAL_HOOK__); +// console.log( +// 'INJECT.TS - React Dev Tools: ', +// window.__REACT_DEVTOOLS_GLOBAL_HOOK__ +// ); // Extend Window interface for TypeScript to recognize custom properties // Requires dummy export so that typescript treats this as a module @@ -27,18 +30,18 @@ const getReactTree = () => { // console.log("REACT DEVTOOLS NOT DETECTED"); // window.postMessage({ type: "REACT_DEVTOOLS_NOT_DETECTED"}); } else { - console.log('React Dev Tools Detected'); + // console.log('React Dev Tools Detected'); try { const reactDevGlobalHook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; // store the parsed fiber tree info // each element will represent one re-render that has occurred - let eventList:[] = []; - + let eventList: [] = []; + //recursively parse fiber tree, creates a structured object type ParseTreeType = (reactFiberTree: any) => any; - const parseTree:ParseTreeType = (reactFiberTree: any) => { + const parseTree: ParseTreeType = (reactFiberTree: any) => { if (reactFiberTree === null) return null; - else if (typeof reactFiberTree.elementType === "function") { + else if (typeof reactFiberTree.elementType === 'function') { // console.log("In the else if block", reactFiberTree.elementType.name); const elemObj = { name: reactFiberTree.elementType.name, @@ -51,7 +54,7 @@ const getReactTree = () => { } else { // console.log("In the else block", reactFiberTree.elementType); return { - name: "NFC", + name: 'NFC', actualDuration: reactFiberTree.actualDuration, selfBaseDuration: reactFiberTree.selfBaseDuration, child: parseTree(reactFiberTree.child), @@ -59,11 +62,11 @@ const getReactTree = () => { }; } }; - + //retrieve children for given node - type GetChildrenType = (tree: TreeNode|null|undefined) => TreeNode[]; - const getChildren:GetChildrenType = (tree) => { - const children:any[] = []; + type GetChildrenType = (tree: TreeNode | null | undefined) => TreeNode[]; + const getChildren: GetChildrenType = tree => { + const children: any[] = []; if (!tree) return children; while (tree.sibling) { children.push(tree.sibling); @@ -71,10 +74,10 @@ const getReactTree = () => { } return children; }; - + //create tree structure from parsed fiber tree type ParseTreeInTreeStructureType = (tree: TreeNode | null) => any; - const parseTreeInTreeStructure:ParseTreeInTreeStructureType = (tree) => { + const parseTreeInTreeStructure: ParseTreeInTreeStructureType = tree => { if (!tree) return; let obj; // console.log("parsetree", tree); @@ -86,8 +89,8 @@ const getReactTree = () => { name: tree.name, actualDuration: tree.actualDuration, selfBaseDuration: tree.selfBaseDuration, - children: [tree.child, ...getChildren(tree.child)].map((elem: TreeNode) => - parseTreeInTreeStructure(elem) + children: [tree.child, ...getChildren(tree.child)].map( + (elem: TreeNode) => parseTreeInTreeStructure(elem) ), }; } else { @@ -103,14 +106,14 @@ const getReactTree = () => { return obj; } }; - + //remove nodes w/NFC(non functional component) from child array - const removeNFCsFromChildArray = (tree:any) => { + const removeNFCsFromChildArray = (tree: any) => { if (tree.children === null) return null; - let parsedChildArray:any[] = []; + let parsedChildArray: any[] = []; for (let i = 0; i < tree.children.length; i++) { const el = tree.children[i]; - if (el.name === "NFC") { + if (el.name === 'NFC') { parsedChildArray = parsedChildArray.concat( removeNFCsFromChildArray({ name: tree.name, @@ -124,12 +127,12 @@ const getReactTree = () => { // console.log("Parsed Child Array", parsedChildArray); return parsedChildArray; }; - + //removes all nodes w/NFC from tree const removeAllNFCs = (tree: TreeNode) => { //ASSUMING THAT THE ROOT NODE OF TREE IS NOT A NFC const immediateChildren = removeNFCsFromChildArray(tree) || []; - const actualChildren:any[] = immediateChildren.map((child) => { + const actualChildren: any[] = immediateChildren.map(child => { return { name: child.name, actualDuration: child.actualDuration, @@ -139,10 +142,15 @@ const getReactTree = () => { }); return actualChildren; }; - + //create final, transformed tree structure - type FinalType = (tree: TreeNode) => {name: string, actualDuration: number, selfBaseDuration: number, children: any[]}; - const final: FinalType = (tree) => { + type FinalType = (tree: TreeNode) => { + name: string; + actualDuration: number; + selfBaseDuration: number; + children: any[]; + }; + const final: FinalType = tree => { return { name: tree.name, actualDuration: tree.actualDuration, @@ -150,46 +158,51 @@ const getReactTree = () => { children: removeAllNFCs(tree), }; }; - + //event listener logs message from content script, resets eventList array - document.addEventListener("CustomEventFromContentScript", function (event) { - // console.log("Message from content script:", event.detail.message); - eventList = []; - }); - - //create customized oncommitfiber root function, + document.addEventListener( + 'CustomEventFromContentScript', + function (event) { + // console.log("Message from content script:", event.detail.message); + eventList = []; + } + ); + + //create customized oncommitfiber root function, type CustomOnCommitFiberRootType = (onCommitFiberRoot: any) => any; - const customOnCommitFiberRoot: CustomOnCommitFiberRootType = (onCommitFiberRoot) => { - return (...args: any) => { - //extract fiberRoot from args - const fiberRoot = args[1]; - //log info about fiberRoot - // console.log( - // "INJECT.JS: FIBER ROOT FROM THE CUSTOM ONCOMMITFIBERROOT", - // fiberRoot - // ); - // console.log("this is the unparsed tree", fiberRoot.current); - //parse tree and add to eventList - eventList.push( - //@ts-ignore - final(parseTreeInTreeStructure(parseTree(fiberRoot.current))) - ); - //convert eventList to string - const eventListStr = JSON.stringify(eventList); - //send message w/eventList string - window.postMessage({ type: "tree", eventListStr }); - return onCommitFiberRoot(...args); + const customOnCommitFiberRoot: CustomOnCommitFiberRootType = + onCommitFiberRoot => { + return (...args: any) => { + //extract fiberRoot from args + const fiberRoot = args[1]; + //log info about fiberRoot + // console.log( + // "INJECT.JS: FIBER ROOT FROM THE CUSTOM ONCOMMITFIBERROOT", + // fiberRoot + // ); + // console.log("this is the unparsed tree", fiberRoot.current); + //parse tree and add to eventList + eventList.push( + //@ts-ignore + final(parseTreeInTreeStructure(parseTree(fiberRoot.current))) + ); + //convert eventList to string + const eventListStr = JSON.stringify(eventList); + //send message w/eventList string + window.postMessage({ type: 'tree', eventListStr }); + return onCommitFiberRoot(...args); + }; }; - }; - + // create custom function to listen to changes - reactDevGlobalHook.onCommitFiberRoot = customOnCommitFiberRoot(reactDevGlobalHook.onCommitFiberRoot); - + reactDevGlobalHook.onCommitFiberRoot = customOnCommitFiberRoot( + reactDevGlobalHook.onCommitFiberRoot + ); } catch (error) { // console.error("Error rendering component Tree: ", error); } } -} +}; // execute function -getReactTree(); \ No newline at end of file +getReactTree(); diff --git a/extension/src/App.tsx b/extension/src/App.tsx index 9b48fa1..ac69595 100644 --- a/extension/src/App.tsx +++ b/extension/src/App.tsx @@ -34,14 +34,14 @@ function App() { // listents for messages from npm package port.onMessage.addListener(message => { - console.log('DEVTOOL: Recieved message from background.ts', message); + // console.log('DEVTOOL: Recieved message from background.ts', message); if (message.type === 'event') { setQueryEvents(queryEvents => [...queryEvents, message.payload]); } if (message.type === 'tree') { - console.log('APP.tsx: Recieved tree data', message); + // console.log('APP.tsx: Recieved tree data', message); setTreeData(message.data); } }); @@ -64,7 +64,7 @@ function App() { // adds event listener for when devToolsPort is disconnected devToolsPort?.onDisconnect.addListener(() => { - console.log('DevTools port disconnected, port: ', devToolsPort); + // console.log('DevTools port disconnected, port: ', devToolsPort); // setDevToolsPort(null); }); diff --git a/extension/src/containers/ParentTab.tsx b/extension/src/containers/ParentTab.tsx index 3d06a68..8c0a6c7 100644 --- a/extension/src/containers/ParentTab.tsx +++ b/extension/src/containers/ParentTab.tsx @@ -1,12 +1,12 @@ -import React, { useEffect, useState } from "react"; -import Tabs from "@mui/material/Tabs"; -import Tab from "@mui/material/Tab"; -import Box from "@mui/material/Box"; -import { ParentTabsProps } from "../types"; -import CustomTabPanel from "../components/CustomTabPanel"; -import a11yProps from "../functions/a11yProps"; -import TreeTab from "./TreeTab"; -import QueriesTab from "./QueriesTab"; +import React, { useEffect, useState } from 'react'; +import Tabs from '@mui/material/Tabs'; +import Tab from '@mui/material/Tab'; +import Box from '@mui/material/Box'; +import { ParentTabsProps } from '../types'; +import CustomTabPanel from '../components/CustomTabPanel'; +import a11yProps from '../functions/a11yProps'; +import TreeTab from './TreeTab'; +import QueriesTab from './QueriesTab'; const ParentTab = ({ queryEvents, @@ -28,13 +28,13 @@ const ParentTab = ({ // only send message if devToolsPort is available and profiling is enabled if (devToolsPort && profilingEnabled) { devToolsPort.postMessage({ - type: "profiling-status", + type: 'profiling-status', payload: profilingEnabled, }); } } const toggleProfiling = () => { - console.log("toggleProfiling clicked"); + // console.log("toggleProfiling clicked"); const newProfilingStatus = !profilingStatus; setProfilingStatus(newProfilingStatus); sendMessageToContentScript(newProfilingStatus); @@ -43,13 +43,13 @@ const ParentTab = ({ return ( - + = ({treeData, toggleProfiling, profilingStatus}) => { - console.log('Update tree tab'); +const TreeTab: React.FC = ({ + treeData, + toggleProfiling, + profilingStatus, +}) => { + // console.log('Update tree tab'); return ( - - - {profilingStatus ? 'Stop Profiling' : 'Start Profiling'} - -
- { profilingStatus && ( - - )} + + + {profilingStatus ? 'Stop Profiling' : 'Start Profiling'} + +
+ {profilingStatus && ( + + )}
); }; diff --git a/extension/src/functions/treeHelperFuncs.tsx b/extension/src/functions/treeHelperFuncs.tsx index 3eb9904..1bae042 100644 --- a/extension/src/functions/treeHelperFuncs.tsx +++ b/extension/src/functions/treeHelperFuncs.tsx @@ -22,7 +22,7 @@ export const customStringify = (v: any): string => { export const saveJSON = (data: any, saveAs: string): void => { let stringified = JSON.stringify(data, null, 2); - let blob = new Blob([stringified], { type: "application/json" }); + let blob = new Blob([stringified], { type: 'application/json' }); let url = URL.createObjectURL(blob); let a = document.createElement('a'); @@ -35,23 +35,21 @@ export const saveJSON = (data: any, saveAs: string): void => { }; export const sendData = (stringifiedResult: string): void => { - console.log("clicked on send data and this is what will be sent", stringifiedResult); - fetch("http://localhost:3000/saveData", { + // console.log("clicked on send data and this is what will be sent", stringifiedResult); + fetch('http://localhost:3000/saveData', { method: 'POST', headers: { - 'Accept': 'application/json', - 'Content-Type': 'application/json' + Accept: 'application/json', + 'Content-Type': 'application/json', }, - body: stringifiedResult - }).then((response) => { + body: stringifiedResult, + }).then(response => { // check the response object for result - console.log('response from backend', response); + // console.log('response from backend', response); // ... }); }; - - // export const customStringify = (v) => { // const cache = new Set(); // return JSON.stringify(v, function (key, value) { @@ -75,10 +73,10 @@ export const sendData = (stringifiedResult: string): void => { // }; // export const saveJSON = (data, saveAs) => { -// let stringified = JSON.stringify(data, null, 2); +// let stringified = JSON.stringify(data, null, 2); // let blob = new Blob([stringified], {type: "application/json"}); // let url = URL.createObjectURL(blob); - + // let a = document.createElement('a'); // a.download = saveAs + '.json'; // a.href = url; @@ -86,7 +84,7 @@ export const sendData = (stringifiedResult: string): void => { // document.body.appendChild(a); // a.click(); // document.querySelector('#' + a.id).remove(); -// } +// } // export const sendData = (stringifiedResult) =>{ // console.log("clicked on send data and this is what will be sent", stringifiedResult) @@ -103,4 +101,3 @@ export const sendData = (stringifiedResult: string): void => { // // ... // }); // } - \ No newline at end of file diff --git a/extension/tsconfig.json b/extension/tsconfig.json index 695c36e..5dd9d1d 100644 --- a/extension/tsconfig.json +++ b/extension/tsconfig.json @@ -21,7 +21,9 @@ "src/**/*.tsx", "content_scripts/**/*.ts", "content_scripts/types.d.ts", - "__test__" + "__test__", + "background.ts" ], - "exclude": ["node_modules"] + "exclude": ["node_modules"], + "types": ["chrome"] } diff --git a/package-react/example/client/src/link/index.tsx b/package-react/example/client/src/link/index.tsx index a0bc1af..63e355c 100644 --- a/package-react/example/client/src/link/index.tsx +++ b/package-react/example/client/src/link/index.tsx @@ -29,7 +29,7 @@ function ReactQueryRewind() { const handleContentMessages = (message: MessageEvent) => { if (message.data?.type === 'content-script-ready') { - console.log('APP: Content.ts connected'); + // console.log('APP: Content.ts connected'); contentConnectedRef.current = true; window.postMessage({ type: 'app-connected' }, '*'); sendContentMessageQueue(); @@ -41,7 +41,7 @@ function ReactQueryRewind() { }; useEffect(() => { - console.log('APP: Mounting Event Listeners'); + // console.log('APP: Mounting Event Listeners'); window.addEventListener('message', handleContentMessages); return () => { @@ -50,7 +50,7 @@ function ReactQueryRewind() { }, []); useEffect(() => { - console.log('timeTravel', timeTravel); + // console.log('timeTravel', timeTravel); }, [timeTravel]); return ( diff --git a/package-react/example/server/server.ts b/package-react/example/server/server.ts index 19932c9..0d2dd17 100644 --- a/package-react/example/server/server.ts +++ b/package-react/example/server/server.ts @@ -15,7 +15,7 @@ app.use('*', (req, res) => { }); app.listen(PORT, () => { - console.log(`Server is listening on port ${PORT}`); + // console.log(`Server is listening on port ${PORT}`); }); export default express; diff --git a/package-react/src/index.tsx b/package-react/src/index.tsx index a0bc1af..69a7055 100644 --- a/package-react/src/index.tsx +++ b/package-react/src/index.tsx @@ -29,7 +29,7 @@ function ReactQueryRewind() { const handleContentMessages = (message: MessageEvent) => { if (message.data?.type === 'content-script-ready') { - console.log('APP: Content.ts connected'); + // console.log('APP: Content.ts connected'); contentConnectedRef.current = true; window.postMessage({ type: 'app-connected' }, '*'); sendContentMessageQueue(); @@ -41,7 +41,7 @@ function ReactQueryRewind() { }; useEffect(() => { - console.log('APP: Mounting Event Listeners'); + // console.log('APP: Mounting Event Listeners'); window.addEventListener('message', handleContentMessages); return () => { @@ -49,10 +49,6 @@ function ReactQueryRewind() { }; }, []); - useEffect(() => { - console.log('timeTravel', timeTravel); - }, [timeTravel]); - return (
{timeTravel ? ( diff --git a/package-svelte/example/client/src/components/PostsOne.svelte b/package-svelte/example/client/src/components/PostsOne.svelte index 62bb2d8..9bd1b16 100644 --- a/package-svelte/example/client/src/components/PostsOne.svelte +++ b/package-svelte/example/client/src/components/PostsOne.svelte @@ -185,7 +185,6 @@ } const updatedPostsArray = await response.json(); - console.log(); return updatedPostsArray; } catch (error) { console.error("Creating post failed:", error); diff --git a/package-svelte/example/client/src/components/PostsThree.svelte b/package-svelte/example/client/src/components/PostsThree.svelte index 0d812d5..98e447e 100644 --- a/package-svelte/example/client/src/components/PostsThree.svelte +++ b/package-svelte/example/client/src/components/PostsThree.svelte @@ -185,7 +185,6 @@ } const updatedPostsArray = await response.json(); - console.log(); return updatedPostsArray; } catch (error) { console.error("Creating post failed:", error); diff --git a/package-svelte/example/client/src/components/PostsTwo.svelte b/package-svelte/example/client/src/components/PostsTwo.svelte index b594669..4ab30b9 100644 --- a/package-svelte/example/client/src/components/PostsTwo.svelte +++ b/package-svelte/example/client/src/components/PostsTwo.svelte @@ -185,7 +185,6 @@ } const updatedPostsArray = await response.json(); - console.log(); return updatedPostsArray; } catch (error) { console.error("Creating post failed:", error); diff --git a/package-svelte/example/client/src/link/TimeTravel.svelte b/package-svelte/example/client/src/link/TimeTravel.svelte index e525ed5..6083292 100644 --- a/package-svelte/example/client/src/link/TimeTravel.svelte +++ b/package-svelte/example/client/src/link/TimeTravel.svelte @@ -6,7 +6,7 @@ const queryClient = useQueryClient(); onMount(() => { - console.log("TIME TRAVEL MOUNTED"); + // console.log("TIME TRAVEL MOUNTED"); const updateUi = (event: any) => { const currentQuery: QueryDisplay[] = event.detail; diff --git a/package-svelte/example/server/server.ts b/package-svelte/example/server/server.ts index 19932c9..0d2dd17 100644 --- a/package-svelte/example/server/server.ts +++ b/package-svelte/example/server/server.ts @@ -15,7 +15,7 @@ app.use('*', (req, res) => { }); app.listen(PORT, () => { - console.log(`Server is listening on port ${PORT}`); + // console.log(`Server is listening on port ${PORT}`); }); export default express; diff --git a/package-vue/example/client/src/link/index.vue b/package-vue/example/client/src/link/index.vue index ffe1416..bcea7f7 100644 --- a/package-vue/example/client/src/link/index.vue +++ b/package-vue/example/client/src/link/index.vue @@ -13,7 +13,7 @@ const contentConnected = ref(false); const handleContentMessages = (message: any) => { if (message.data?.type === 'content-script-ready') { - console.log('APP: Connected to content.ts'); + // console.log('APP: Connected to content.ts'); contentConnected.value = true; window.postMessage({ type: 'app-connected' }, '*'); } @@ -24,7 +24,7 @@ const handleContentMessages = (message: any) => { }; onMounted(() => { - console.log('APP: Mounting Event Listeners'); + // console.log('APP: Mounting Event Listeners'); window.addEventListener('message', handleContentMessages); }); diff --git a/package-vue/example/server/server.ts b/package-vue/example/server/server.ts index 19932c9..0d2dd17 100644 --- a/package-vue/example/server/server.ts +++ b/package-vue/example/server/server.ts @@ -15,7 +15,7 @@ app.use('*', (req, res) => { }); app.listen(PORT, () => { - console.log(`Server is listening on port ${PORT}`); + // console.log(`Server is listening on port ${PORT}`); }); export default express;