Skip to content

Commit 7cd7eaa

Browse files
committed
before pull
1 parent 90d6780 commit 7cd7eaa

File tree

6 files changed

+50
-80
lines changed

6 files changed

+50
-80
lines changed

src/app/components/Action.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ interface ActionProps {
3939
const Action = (props: ActionProps): unknown => {
4040
const {
4141
selected, last, index, sliderIndex, dispatch, displayName, componentName,
42-
componentData, state, viewIndex, handleOnkeyDown, key,
42+
componentData, viewIndex, handleOnkeyDown,
4343
} = props;
4444

4545
/**

src/app/components/Diff.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ function Diff(props: DiffProps) {
3939
if (newObj.state === 'stateless') {
4040
delete newObj.state;
4141
}
42-
if (newObj.state.hooksState) {
43-
newObj.state.hooksState.forEach(s => {
44-
delete s.componentData;
45-
});
46-
}
4742
if (newObj.stateSnaphot) {
4843
newObj.stateSnaphot = statelessCleanning(obj.stateSnaphot);
4944
}

src/app/containers/MainContainer.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,6 @@ function MainContainer(): any {
9696
if (newObj.state === 'stateless') {
9797
delete newObj.state;
9898
}
99-
if (newObj.state.hooksState) {
100-
newObj.state.hooksState.forEach(s => {
101-
delete s.componentData;
102-
});
103-
}
104-
10599
if (newObj.stateSnaphot) {
106100
newObj.stateSnaphot = statelessCleanning(obj.stateSnaphot);
107101
}

src/backend/linkFiber.ts

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
2+
/* eslint-disable max-len */
13
import 'core-js';
24
/* eslint-disable indent */
35
/* eslint-disable brace-style */
@@ -111,21 +113,8 @@ export default (snap: Snapshot, mode: Mode): ()=>void => {
111113
treeBaseDuration,
112114
} = currentFiber;
113115

114-
<<<<<<< HEAD
115-
let newState: any = {};
116+
let newState: any | {hooksState?: any[]} = {};
116117
let componentData: ComponentData = {};
117-
=======
118-
let newState: any;
119-
let componentData: ComponentData = {};
120-
/* = {
121-
index: -1,
122-
actualDuration: 0,
123-
actualStartTime: 0,
124-
selfBaseDuration: 0,
125-
treeBaseDuration: 0,
126-
};
127-
*/
128-
>>>>>>> master
129118
let componentFound = false;
130119

131120
// Check if node is a stateful setState component
@@ -182,10 +171,6 @@ export default (snap: Snapshot, mode: Mode): ()=>void => {
182171

183172
let newNode = null;
184173
// We want to add this fiber node to the snapshot
185-
<<<<<<< HEAD
186-
=======
187-
// const snapshotState = newState.state || newState.hooksState;
188-
>>>>>>> master
189174
if (componentFound || newState === 'stateless') {
190175
if (fromSibling) {
191176
newNode = tree.addSibling(newState,
@@ -196,7 +181,6 @@ export default (snap: Snapshot, mode: Mode): ()=>void => {
196181
elementType ? elementType.name : 'nameless',
197182
componentData);
198183
}
199-
if (newState !== 'stateless') console.log('state updated:', newState);
200184
} else {
201185
newNode = tree;
202186
}
@@ -229,10 +213,6 @@ export default (snap: Snapshot, mode: Mode): ()=>void => {
229213

230214
function onVisibilityChange(): void {
231215
doWork = !document.hidden;
232-
<<<<<<< HEAD
233-
=======
234-
// console.log('doWork is:', doWork);
235-
>>>>>>> master
236216
}
237217

238218
return () => {
@@ -259,12 +239,9 @@ export default (snap: Snapshot, mode: Mode): ()=>void => {
259239
return function (...args) {
260240
// eslint-disable-next-line prefer-destructuring
261241
fiberRoot = args[1];
262-
console.log('in CFR committed fiber');
263242
if (doWork) {
264-
console.log('in CFR: updating snapshot');
265243
throttledUpdateSnapshot();
266244
}
267-
console.log('in CFR updated snapshot');
268245
return original(...args);
269246
};
270247
}(devTools.onCommitFiberRoot));

src/extension/background.js

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function changeCurrLocation(tabObj, rootNode, index, name) {
8989
return;
9090
// if not, recurse on each one of the children
9191
}
92-
92+
9393
if (rootNode.children) { // Carlos: remove if, redundant
9494
rootNode.children.forEach(child => {
9595
changeCurrLocation(tabObj, child, index, name);
@@ -244,7 +244,7 @@ chrome.runtime.onMessage.addListener((request, sender) => {
244244
tabsObj[tabId].snapshots.splice(1);
245245
// gabi :: reset hierarchy to page initial state
246246
if (tabsObj[tabId].hierarchy) {
247-
//test
247+
// test
248248
tabsObj[tabId].hierarchy.children = [];
249249
// gabi :: reset currParent plus current state
250250
tabsObj[tabId].currParent = 1;
@@ -343,13 +343,11 @@ chrome.tabs.onRemoved.addListener(tabId => {
343343
delete firstSnapshotReceived[tabId];
344344
});
345345

346-
// when a new url is loaded on the same tab, this remove the tabid from the tabsObj, recreate the tab and inject the script
346+
// when a new url is loaded on the same tab, this remove the tabid from the tabsObj, recreate the tab and inject the script
347347
chrome.tabs.onUpdated.addListener((tabId, changeInfo) => {
348-
349348
// check if the tab title changed to see if tab need to restart
350-
if (changeInfo && tabsObj[tabId]){
351-
if(changeInfo.title && changeInfo.title !== tabsObj[tabId].title){
352-
349+
if (changeInfo && tabsObj[tabId]) {
350+
if (changeInfo.title && changeInfo.title !== tabsObj[tabId].title) {
353351
// tell devtools which tab to delete
354352
if (portsArr.length > 0) {
355353
portsArr.forEach(bg =>
@@ -367,21 +365,6 @@ chrome.tabs.onUpdated.addListener((tabId, changeInfo) => {
367365

368366
// recreate the tab on the tabsObj
369367
tabsObj[tabId] = createTabObj(changeInfo.title);
370-
371-
// reinject the script to the tab
372-
chrome.tabs.executeScript(tabId, {
373-
code: `
374-
// Function will attach script to the dom
375-
const injectScript = (file, tag) => {
376-
const htmlBody = document.getElementsByTagName(tag)[0];
377-
const script = document.createElement('script');
378-
script.setAttribute('type', 'text/javascript');
379-
script.setAttribute('src', file);
380-
htmlBody.appendChild(script);
381-
};
382-
injectScript(chrome.runtime.getURL('bundles/backend.bundle.js'), 'body');
383-
`,
384-
});
385368
}
386369
}
387370
});
Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,50 @@
1-
.component-button {
2-
display: inline-flex;
3-
width: 25%;
4-
flex: 1 0 auto;
1+
html {
2+
height: 100%;
3+
font-size: 10px;
54
}
65

7-
.component-button.wide {
8-
width: 50%;
6+
body {
7+
background-color: black;
8+
margin: 0;
9+
padding: 0;
10+
font-family: sans-serif;
11+
height: 100%;
912
}
1013

11-
.component-button button {
12-
background: rgba(224,224,224,1);
13-
border: 0;
14-
border-radius: 10%;
15-
font-size: 1.5rem;
16-
margin: 0 1px 0 0;
17-
flex: 1 0 auto;
18-
padding: 0;
14+
#root {
15+
height: 100%;
16+
}
17+
18+
body .github-fork-ribbon:before {
19+
background-color: #333;
20+
}
21+
22+
@media screen and (max-width: 400px) {
23+
.github-fork-ribbon {
24+
display: none;
25+
}
26+
}
27+
28+
@media (min-width: 400px) and (min-height: 400px) {
29+
html {
30+
font-size: 20px;
31+
}
32+
}
33+
34+
@media (min-width: 500px) and (min-height: 500px) {
35+
html {
36+
font-size: 30px;
37+
}
1938
}
2039

21-
.component-button:last-child button {
22-
margin-right: 0;
40+
@media (min-width: 600px) and (min-height: 600px) {
41+
html {
42+
font-size: 40px;
43+
}
2344
}
2445

25-
.component-button.orange button {
26-
background: rgb(73, 119, 133);
27-
border-radius: 10%;
28-
color: white;
46+
@media (min-width: 800px) and (min-height: 800px) {
47+
html {
48+
font-size: 50px;
49+
}
2950
}

0 commit comments

Comments
 (0)