Skip to content

Commit

Permalink
fix: debugger-ui name and reload button (react-native-community#844)
Browse files Browse the repository at this point in the history
  • Loading branch information
thymikee authored Nov 14, 2019
1 parent a3a70a1 commit 0b81877
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 14 deletions.
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"editor.formatOnSave": true,
"flow.useNPMPackagedFlow": true,
"javascript.validate.enable": false,
"prettier.eslintIntegration": true,
"eslint.validate": [
"javascript",
"javascriptreact",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"prebuild": "yarn build:ts",
"build": "node ./scripts/build.js && yarn build:debugger",
"build:ts": "node ./scripts/buildTs.js",
"build:debugger": "yarn workspace @react-native-community/debugger-ui build",
"build:debugger": "yarn workspace @react-native-community/cli-debugger-ui build",
"build-clean": "rm -rf ./packages/*/build",
"build-clean-all": "rm -rf ./packages/*/build ./packages/*/tsconfig.tsbuildinfo",
"watch": "node ./scripts/watch.js",
Expand All @@ -17,7 +17,7 @@
"lint": "eslint --ext .js,.ts . --cache --report-unused-disable-directives",
"test:ci:cocoapods": "ruby packages/platform-ios/native_modules.rb",
"postinstall": "yarn build",
"link-packages": "PACKAGES=('tools' 'platform-ios' 'platform-android' 'cli' 'cli-types' 'global-cli' 'debugger-ui') && cd packages && for PACKAGE in \"${PACKAGES[@]}\"; do cd $PACKAGE && yarn link && cd ..; done",
"link-packages": "PACKAGES=('tools' 'platform-ios' 'platform-android' 'cli' 'cli-types' 'debugger-ui') && cd packages && for PACKAGE in \"${PACKAGES[@]}\"; do cd $PACKAGE && yarn link && cd ..; done",
"publish": "yarn build-clean-all && yarn install && lerna publish"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@react-native-community/cli-platform-ios": "^3.0.0-alpha.7",
"@react-native-community/cli-tools": "^3.0.0-alpha.7",
"@react-native-community/cli-types": "^3.0.0-alpha.7",
"@react-native-community/debugger-ui": "^3.0.0-alpha.7",
"@react-native-community/cli-debugger-ui": "^3.0.0-alpha.7",
"@types/mkdirp": "^0.5.2",
"@types/node-notifier": "^5.4.0",
"@types/semver": "^6.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import connect from 'connect';
import errorhandler from 'errorhandler';
import {Server as WebSocketServer} from 'ws';
import serveStatic from 'serve-static';
import {debuggerUIMiddleware} from '@react-native-community/debugger-ui';
import {debuggerUIMiddleware} from '@react-native-community/cli-debugger-ui';

import indexPageMiddleware from './indexPage';
import copyToClipBoardMiddleware from './copyToClipBoardMiddleware';
Expand Down
2 changes: 1 addition & 1 deletion packages/debugger-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@react-native-community/debugger-ui",
"name": "@react-native-community/cli-debugger-ui",
"version": "3.0.0-alpha.7",
"license": "MIT",
"main": "./build/middleware",
Expand Down
9 changes: 1 addition & 8 deletions packages/debugger-ui/src/ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@
<meta charset="utf-8" />
<link rel="icon" href="data:;base64,iVBORw0KGgo=" />
<title>React Native Debugger</title>
<script>
function onReloadClicked() {
var xhr = new XMLHttpRequest();
xhr.open('GET', `${window.location.origin}/reload`, true);
xhr.send();
}
</script>
<script src="./index.js"></script>
</head>
<body>
Expand Down Expand Up @@ -52,7 +45,7 @@
to inspect the React component hierarchy, their props, and state.
</p>
<p>Status: <span id="status">Loading...</span></p>
<button class="reload-btn" onclick="onReloadClicked()">
<button class="reload-btn" onclick="window.onReloadClicked()">
Reload app
</button>
</div>
Expand Down
6 changes: 6 additions & 0 deletions packages/debugger-ui/src/ui/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ window.onload = function() {
Page.render();
};

window.onReloadClicked = function() {
var xhr = new XMLHttpRequest();
xhr.open('GET', `${window.location.origin}/reload`, true);
xhr.send();
};

const Page = (window.Page = {
state: {
isDark:
Expand Down

0 comments on commit 0b81877

Please sign in to comment.