Skip to content

Commit fad441f

Browse files
Merge branch 'master' into sandbox
2 parents 5d9ed2d + c292448 commit fad441f

File tree

7 files changed

+9915
-8999
lines changed

7 files changed

+9915
-8999
lines changed

src/app/containers/ActionContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function ActionContainer(props) {
5858
};
5959
// the hierarchy gets set on the first click in the page
6060
// when page in refreshed we may not have a hierarchy so we need to check if hierarchy was initialized
61-
// if true involk displayArray to display the hierarchy
61+
// if true invoke displayArray to display the hierarchy
6262
if (hierarchy) displayArray(hierarchy);
6363

6464
// handles keyboard presses, function passes an event and index of each action-component

src/app/containers/MainContainer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const mixpanel = require('mixpanel').init('12fa2800ccbf44a5c36c37bc9776e4c0', {
2020

2121
function MainContainer(): any {
2222
const [store, dispatch] = useStoreContext();
23+
console.log("storecont:", useStoreContext());
2324
const { tabs, currentTab, port: currentPort } = store;
2425
const [actionView, setActionView] = useState(true);
2526
//this function handles Time Jump sidebar view

src/app/reducers/mainReducer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ import * as types from '../constants/actionTypes.ts';
44

55
export default (state, action) =>
66
produce(state, (draft) => {
7+
console.log("export state", state)
78
const { port, currentTab, tabs } = draft;
9+
console.log("currentTab Reducer:", currentTab)
10+
console.log("reducer action:", action)
811
const { hierarchy, snapshots, mode, intervalId, viewIndex, sliderIndex } =
912
tabs[currentTab] || {};
1013

@@ -154,6 +157,7 @@ export default (state, action) =>
154157
}
155158
case types.EMPTY: {
156159
port.postMessage({ action: 'emptySnap', tabId: currentTab });
160+
console.log("mainreducer line 159")
157161
tabs[currentTab].sliderIndex = 0;
158162
tabs[currentTab].viewIndex = -1;
159163
tabs[currentTab].playing = false;

src/backend/linkFiber.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ function getRecoilState(): any {
8282
* Middleware: Gets a copy of the current snap.tree and posts a recordSnap message to the window
8383
*/
8484
function sendSnapshot(snap: Snapshot, mode: Mode): void {
85+
console.log('This is sendSnapshot!')
8586
// Don't send messages while jumping or while paused
8687
if (mode.jumping || mode.paused) return;
8788
// If there is no current tree creates a new one
@@ -94,6 +95,7 @@ function sendSnapshot(snap: Snapshot, mode: Mode): void {
9495
const payload = snap.tree.cleanTreeCopy();
9596
// if it's Recoil - run different actions?
9697
if (isRecoil) {
98+
console.log('This is recoil and we\'re in sendSnapshot!')
9799
// getRecoilState()
98100
payload.atomsComponents = atomsComponents;
99101
payload.atomSelectors = atomsSelectors;
@@ -125,6 +127,7 @@ function sendSnapshot(snap: Snapshot, mode: Mode): void {
125127

126128
//updating tree depending on current mode on the panel (pause, etc)
127129
function updateSnapShotTree(snap: Snapshot, mode: Mode): void {
130+
console.log('This is updateSnapShotTree!')
128131
// this is the currently active root fiber(the mutable root of the tree)
129132
if (fiberRoot) {
130133
const { current } = fiberRoot;
@@ -151,6 +154,7 @@ function traverseRecoilHooks(
151154
//Props of the fiber that were used to create the output during the previous render.
152155
memoizedProps: any
153156
): HookStates {
157+
console.log('This is traverseRecoilHooks!')
154158
const hooksStates: HookStates = [];
155159
while (memoizedState && memoizedState.queue) {
156160
if (
@@ -181,6 +185,7 @@ function traverseRecoilHooks(
181185
* every time a hooks component changes state
182186
*/
183187
function traverseHooks(memoizedState: any): HookStates {
188+
console.log('This is traverseHooks!')
184189
const hooksStates: HookStates = [];
185190
while (memoizedState && memoizedState.queue) {
186191
if (memoizedState.memoizedState) {
@@ -217,7 +222,7 @@ function createTree(
217222
tree: Tree = new Tree('root', 'root'),
218223
fromSibling = false
219224
) {
220-
225+
221226
// Base case: child or sibling pointed to null
222227
if (!currentFiber) return null;
223228
if (!tree) return tree;
@@ -351,6 +356,7 @@ function createTree(
351356
(tag === 0 || tag === 1 || tag === 2 || tag === 10) &&
352357
isRecoil === false
353358
) {
359+
console.log("Node uses regular react hooks")
354360
if (memoizedState.queue) {
355361
// Hooks states are stored as a linked list using memoizedState.next,
356362
// so we must traverse through the list and get the states.
@@ -496,6 +502,7 @@ export default (snap: Snapshot, mode: Mode): (() => void) => {
496502
doWork = !document.hidden;
497503
}
498504
return () => {
505+
console.log("exporting LinkFiber!")
499506
// react devtools global hook is a global object that was injected by the React Devtools content script, allows access to fiber nodes and react version
500507
const devTools = window.__REACT_DEVTOOLS_GLOBAL_HOOK__;
501508
// nathan test

src/extension/background.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const metrics = {};
1212

1313
// This function will create the first instance of the test app's tabs object
1414
// which will hold test app's snapshots, link fiber tree info, chrome tab info, etc.
15+
//console.log("hello from background.js");
1516
function createTabObj(title) {
1617
// update tabsObj
1718
return {
@@ -247,6 +248,7 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
247248
const script = document.createElement('script');
248249
script.setAttribute('type', 'text/javascript');
249250
script.setAttribute('src', file);
251+
document.title=${tabId} + '-' + document.title
250252
htmlBody.appendChild(script);
251253
};
252254
injectScript(chrome.runtime.getURL('bundles/backend.bundle.js'), 'body');
@@ -341,12 +343,13 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
341343
tabsObj[tabId],
342344
new Node(request.payload, tabsObj[tabId])
343345
);
344-
} else {
345-
sendToHierarchy(
346-
tabsObj[tabId],
347-
new NewNode(request.payload, tabsObj[tabId])
348-
);
349346
}
347+
// else {
348+
// sendToHierarchy(
349+
// tabsObj[tabId],
350+
// new NewNode(request.payload, tabsObj[tabId])
351+
// );
352+
// }
350353
}
351354
// sends new tabs obj to devtools
352355
if (portsArr.length > 0) {

src/extension/build/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "ReactimeVnpr",
2+
"name": "ReactimeX",
33
"version": "8.0.0",
44
"devtools_page": "devtools.html",
55
"description": "A Chrome extension that helps debug React applications by memorizing the state of components with every render.",

0 commit comments

Comments
 (0)