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

Migrate to SolidJS #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .editorconfig

This file was deleted.

24 changes: 0 additions & 24 deletions .eslintrc

This file was deleted.

6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
node_modules/
dist/
.DS_Store
extension.zip
node_modules
dist
29 changes: 8 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
# Apollo Tracing Developer Tools Extension
# GraphQL Monitor with Tracing

This is a chrome dev tool extension that I wrote in a couple of hours to help me visualize the GraphQL tracing data from my requests.
It probably have some bugs but I'll fix them as soon as I can.
![Interface Example](docs/interface-example.png)

Also, this project was quickly done while I was learning how to create an extension, so as you can see it's not very organized. That means that before adding any new feature I need to organize it and create a build structure. Please feel free to contribute if you think you can help.
## How to run

![](docs/interface-example.png)
### `npm start`

## Todo list
Runs the app in the development mode. Once the app is running it will update the `dist` on every change.
Open the [chrome://extensions](chrome://extensions) and click `load unpacked` to add the local extension, once the prompt opens select the `dist` folder.

### Basic structure
- [x] Pack extension on prod build
- [x] Add webpack (or other tool)
- [x] Uglify
- [x] Add babel and JSX support
- [x] Add SASS/Styled components
- [ ] Add Jest and write unit tests
- [x] Split component files
- [x] Create a better layout
- [ ] Find a designer to create an actual good layout
### `npm run build`

### Features
- [ ] Save request for later
- [ ] Compare requests
- [x] Hide items slammer than 1ms
- [x] Display requests made before extension opens
Builds the app for production to the `dist` folder.
Binary file added assets/icon-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 0 additions & 9 deletions babel.config.json

This file was deleted.

3 changes: 3 additions & 0 deletions devtools/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
6 changes: 6 additions & 0 deletions devtools/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!DOCTYPE html>
<html>
<head>
<script type="module" src="./index.tsx"></script>
</head>
</html>
9 changes: 9 additions & 0 deletions devtools/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
chrome.devtools.panels.create(
"Apollo Tracing",
"assets/icon-16.png",
"devtools/panel.html",
(panel) => {
if (chrome.runtime.lastError) console.error(chrome.runtime.lastError);
console.log("panel", panel);
}
);
12 changes: 12 additions & 0 deletions devtools/panel.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>GraphQL Monitor</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="./panel.tsx"></script>
</body>
</html>
16 changes: 16 additions & 0 deletions devtools/panel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { render, MountableElement } from "solid-js/web";
import { onCleanup, createSignal } from "solid-js";

import "./global.css";

const CountingComponent = () => {
const [count, setCount] = createSignal(0);
const interval = setInterval(() => setCount((count) => count + 1), 1000);
onCleanup(() => clearInterval(interval));
return <div class="text-gray-500">Count value is {count()}</div>;
};

render(
() => <CountingComponent />,
document.getElementById("root") as MountableElement
);
Loading