Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify react-devtools-inline for Replay integration #7

Closed
wants to merge 9 commits into from
Closed
12 changes: 12 additions & 0 deletions packages/react-devtools-inline/.release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"hooks": {
"after:bump": "yarn && git add -u"
},
"git": {
"commitMessage": "Release @replayio/react-devtools-inline ${version}",
"tagName": "@replayio/react-devtools-inline@${version}"
},
"npm": {
"versionArgs": ["--workspaces-update=false"]
}
}
10 changes: 7 additions & 3 deletions packages/react-devtools-inline/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"name": "react-devtools-inline",
"version": "4.28.3",
"name": "@replayio/react-devtools-inline",
"version": "4.28.6",
"description": "Embed react-devtools within a website",
"license": "MIT",
"private": false,
"publishConfig": {
"access": "public"
},
"main": "./dist/backend.js",
"repository": {
"type": "git",
"url": "https://github.com/facebook/react.git",
"url": "https://github.com/replayio/react.git",
"directory": "packages/react-devtools-inline"
},
"files": [
Expand Down
3 changes: 2 additions & 1 deletion packages/react-devtools-shared/src/backendAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ export function storeAsGlobal({
});
}

const TIMEOUT_DELAY = 5000;
// REPLAY Bumping this up from 5000 to allow evaluations time to complete.
const TIMEOUT_DELAY = 15000;

let requestCounter = 0;

Expand Down
1 change: 0 additions & 1 deletion packages/react-devtools-shared/src/devtools/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,6 @@ export default class Store extends EventEmitter<{
getElementByID(id: number): Element | null {
const element = this._idToElement.get(id);
if (element === undefined) {
console.warn(`No element found with id "${id}"`);
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,7 @@ export default function Tree(props: Props): React.Node {
const handleFocus = useCallback(() => {
setTreeFocused(true);

if (selectedElementIndex === null && numElements > 0) {
dispatch({
type: 'SELECT_ELEMENT_AT_INDEX',
payload: 0,
});
}
// REPLAY Removed auto-selection of index 0, as that creates annoying behavior in our UI
}, [dispatch, numElements, selectedElementIndex]);

const handleKeyPress = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import {Component, Suspense} from 'react';
import Store from 'react-devtools-shared/src/devtools/store';
import UnsupportedBridgeOperationView from './UnsupportedBridgeOperationView';
import ErrorView from './ErrorView';
import SearchingGitHubIssues from './SearchingGitHubIssues';
import SuspendingErrorView from './SuspendingErrorView';
import TimeoutView from './TimeoutView';
import CaughtErrorView from './CaughtErrorView';
import UnsupportedBridgeOperationError from 'react-devtools-shared/src/UnsupportedBridgeOperationError';
Expand Down Expand Up @@ -191,13 +189,19 @@ export default class ErrorBoundary extends Component<Props, State> {
canDismissProp || canDismissState ? this._dismissError : null
}
errorMessage={errorMessage}>
<Suspense fallback={<SearchingGitHubIssues />}>
<SuspendingErrorView
callStack={callStack}
componentStack={componentStack}
errorMessage={errorMessage}
/>
</Suspense>
We caught an error. Please report this to the Replay team via:
<ul>
<li>
Discord:{' '}
<a href="https://replay.io/discord">replay.io/discord</a>
</li>
<li>
Github:{' '}
<a href="https://github.com/replayio/devtools">
github.com/replayio/devtools
</a>
</li>
</ul>
</ErrorView>
);
}
Expand Down