Skip to content

Commit ad08026

Browse files
authored
Merge branch 'staging' into diffview
2 parents 6ad56b3 + 12edde8 commit ad08026

38 files changed

+1571
-669
lines changed

.eslintrc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
22
"extends": ["airbnb", "plugin:jest/recommended"],
33
"root": true,
4-
"plugins": ["jest", "react"],
4+
"plugins": ["jest", "react", "react-hooks"],
55
"rules": {
66
"arrow-parens": [2, "as-needed"],
77
"import/no-unresolved": "off",
8-
"import/extensions": "off"
8+
"import/extensions": "off",
9+
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
10+
"react-hooks/exhaustive-deps": "warn" // Checks effect dependencies
911
},
1012
"env": {
1113
"es6": true,

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ src/extension/build.crx
1010
src/extension/build.pem
1111
bower_components
1212
sandboxes/manual-tests/NextJS/.next
13+
.vscode

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"eslint.enable": true
3+
}

dev-reactime/astParser.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ const JSXParser = acorn.Parser.extend(jsx());
88
// Helper function to grab the getters/setters from `elementType`
99
module.exports = elementType => {
1010
// Initialize empty object to store the setters and getter
11+
console.log('entered ast parser');
12+
//console.log('elementType: ', elementType);
1113
let ast = JSXParser.parse(elementType);
14+
//console.log('ast:', ast);
1215
const hookState = {};
1316

1417
while (Object.hasOwnProperty.call(ast, 'body')) {

dev-reactime/index.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@
44
*/
55
import 'core-js';
66
import 'regenerator-runtime/runtime';
7+
import { exist } from 'acorn-jsx/xhtml';
78

89
// * State snapshot object initialized here
9-
const snapShot = { tree: null };
10+
const snapShot = {
11+
tree: null,
12+
unfilteredTree: null
13+
};
14+
1015

1116
const mode = {
1217
jumping: false,
@@ -15,16 +20,18 @@ const mode = {
1520
};
1621

1722
const linkFiber = require('./linkFiber')(snapShot, mode);
23+
console.log('import timeJump in index.js:', JSON.parse(JSON.stringify(snapShot)));
1824
const timeJump = require('./timeJump')(snapShot, mode);
1925

26+
2027
function getRouteURL(node) {
2128
if (node.name === 'Router') {
2229
return node.state.location.pathname;
2330
}
2431
if (node.children && node.children.length >= 1) {
2532
const tempNode = node.children;
2633
for (let index = 0; index < tempNode.length; index += 1) {
27-
return getRouteURL(tempNode[index]);
34+
return getRouteURL(tempNode[index]); // Carlos: ???
2835
}
2936
}
3037
}
@@ -33,9 +40,12 @@ function getRouteURL(node) {
3340
window.addEventListener('message', ({ data: { action, payload } }) => {
3441
switch (action) {
3542
case 'jumpToSnap':
43+
console.log('payload in jumpToSnap', payload);
3644
timeJump(payload); // * This sets state with given payload
3745
// Get the pathname from payload and add new entry to browser history
3846
// MORE: https://developer.mozilla.org/en-US/docs/Web/API/History/pushState
47+
48+
// try to modify workInProgress tree from here
3949
window.history.pushState('', '', getRouteURL(payload));
4050
break;
4151
case 'setLock':
@@ -49,5 +59,5 @@ window.addEventListener('message', ({ data: { action, payload } }) => {
4959
}
5060
});
5161

52-
//module.exports = linkFiber;
62+
// module.exports = linkFiber;
5363
export default linkFiber;

0 commit comments

Comments
 (0)