Skip to content

Commit

Permalink
[infoview] Port to React
Browse files Browse the repository at this point in the history
This is prerequisite to implement / fix effectively #143 and #216 for
example; the current Info View rendering using strings doesn't scale
anymore to the kind of DOM manipulation we need.

Why React? That was a careful choice for many reasons, in particular
seems like the best fit for our use case (so far); moreover, 3rd party
package support is the best.
  • Loading branch information
ejgallego committed Jan 27, 2023
1 parent 6c85ee5 commit 8197680
Show file tree
Hide file tree
Showing 12 changed files with 460 additions and 189 deletions.
2 changes: 1 addition & 1 deletion editor/code/esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ function viewBuild(file) {
.catch(() => process.exit(1));
}

var infoView = viewBuild("./views/info/index.ts");
var infoView = viewBuild("./views/info/index.tsx");

await Promise.all[(client, infoView)];
6 changes: 4 additions & 2 deletions editor/code/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { VersionedTextDocumentIdentifier } from "vscode-languageclient";
import { Position } from "vscode";
import {
VersionedTextDocumentIdentifier,
Position,
} from "vscode-languageserver-types";

export interface Hyp<Pp> {
names: Pp;
Expand Down
168 changes: 167 additions & 1 deletion editor/code/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions editor/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,21 @@
},
"devDependencies": {
"@types/node": "^16.11.7",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@types/throttle-debounce": "^5.0.0",
"@types/vscode-webview": "^1.57.1",
"@types/vscode": "^1.73.0",
"@types/vscode-webview": "^1.57.1",
"esbuild": "^0.16.13",
"prettier": "^2.8.1",
"typescript": "^4.9.4"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"throttle-debounce": "^5.0.0",
"vscode-languageclient": "^8.0.2"
"vscode-languageclient": "^8.0.2",
"vscode-languageserver-types": "^3.17.2"
},
"main": "./out/src/client.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion editor/code/src/goals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class InfoPanel {
<title>Coq's info panel</title>
</head>
<body>
<div id="coq-info-body">
<div id="root">
</div>
</body>
</html>`;
Expand Down
Loading

0 comments on commit 8197680

Please sign in to comment.