Skip to content

Commit e784f11

Browse files
authored
Release v1.1.2 (#5)
* rename: move hooks * remove: unused * doc: README * remove: unused * remove: unneed permissions * chore: update version * fix: permission * docs: add pr template * chore: run formattor
1 parent 432b3e5 commit e784f11

File tree

13 files changed

+52
-47
lines changed

13 files changed

+52
-47
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ VITE_TEST262_RAW_URL = "https://raw.githubusercontent.com/tc39/test262/3a7a72aef
22
VITE_TEST262_URL = "https://github.com/tc39/test262/blob/3a7a72aef5009eb22117231d40f9a5a66a9a595a/test/"
33
VITE_DOUBLE_DEBUGGER_URL = "https://es-meta.github.io/playground"
44
VITE_RESOURCE_URL = "https://raw.githubusercontent.com/es-meta/ecma-visualizer-resources/refs/heads/main/"
5-
VITE_EXTENSION_VERSION = "1.1.1"
5+
VITE_EXTENSION_VERSION = "1.1.2"
66
VITE_ESMETA_URL = "https://es-meta.github.io/"
77
VITE_ESMETA_GITHUB_URL = "https://github.com/es-meta/esmeta"
88
VITE_ENABLED_SPEC_URL = "https://tc39.es/ecma262/2024|https://262.ecma-international.org/15.0"

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## What's Changed
2+
3+
<!-- Add screenshots if needed -->
4+
5+
## Related Issues
6+
7+
## Message to Reviewers

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
**ECMAScript Visualizer** is a Chrome extension that provides example programs for each step of the ECMAScript/JavaScript specification [(ECMA-262)](https://tc39.es/ecma262), powered by [ESMeta](https://github.com/es-meta/esmeta).
66

7-
## Manual Installation Guide
7+
## Manual Installation Guide (Chrome)
88

99
Download the repository and enter the directory:
1010

@@ -15,14 +15,26 @@ cd ecma-visualizer
1515

1616
Then, run the following command to build the visualizer:
1717

18-
```
19-
npm install && npm run build
18+
```bash
19+
$ npm install && npm run build
2020
```
2121

2222
And follow the instructions below to install the visualizer extension:
2323

2424
1. Open the Chrome browser and enter `chrome://extensions/`.
2525
2. Turn on the Developer mode on the top right corner.
26-
3. Click the Load unpacked button and select the `ecma-visualizer/dist` directory.
26+
3. Click the Load unpacked button and select the `ecma-visualizer/.output/chrome-mv3` directory.
2727

2828
The chrome extension currently works on ES2024 web page: https://tc39.es/ecma262/2024/.
29+
30+
## Other Browsers
31+
32+
While other browsers like Firefox and Edge are not officially supported, the project includes polyfills and can be built targeting those browsers. You can try the following steps:
33+
34+
```bash
35+
$ npm install
36+
$ npx tsc -b && npx wxt build -b firefox # for Firefox
37+
$ npx tsc -b && npx wxt build -b edge # for Microsoft Edge
38+
```
39+
40+
The built extension will be located in the `.output` directory. To install the extension, refer to your browser’s documentation on loading unpacked extensions. Note that compatibility may vary.

entrypoints/background/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,19 @@ export default defineBackground(() => {
1212
targetWindowId: activeInfo.windowId,
1313
payload: {
1414
type: CUSTOM_IS_SUPPORTED,
15-
dataSupported: url.isSupportedSpec(tab.url ?? ""),
15+
dataSupported: tab.url ? url.isSupportedSpec(tab.url) : false,
1616
},
1717
} satisfies Message);
1818
});
19-
browser.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => {
19+
20+
browser.tabs.onUpdated.addListener(async (_tabId, changeInfo, tab) => {
2021
if (changeInfo.url) {
2122
browser.runtime.sendMessage({
2223
from: "background",
2324
targetWindowId: tab.windowId,
2425
payload: {
2526
type: CUSTOM_IS_SUPPORTED,
26-
dataSupported: url.isSupportedSpec(changeInfo.url ?? ""),
27+
dataSupported: tab.url ? url.isSupportedSpec(tab.url) : false,
2728
},
2829
} satisfies Message);
2930
}

entrypoints/sidepanel/features/callstack.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { ArrowUpIcon, LayersIcon, Trash2Icon } from "lucide-react";
2-
import { useAtom, useAtomValue } from "jotai";
32

43
import { callStackAtom, convertedToNameCallStackAtom } from "../atoms/app";
54
import { SuspenseBoundary } from "../components/suspense-boundary";

entrypoints/sidepanel/features/notify.tsx

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
1-
import { useAtomValue } from "jotai";
2-
import { jotaiStore } from "@/entrypoints/sidepanel/atoms/store";
3-
import { currentTabSupported } from "@/entrypoints/sidepanel/atoms/app";
1+
import { currentTabSupported } from "../atoms/app";
42

53
export function NotifyStrip() {
6-
const isSupported = useAtomValue(currentTabSupported);
4+
const [isSupported, setIsSupported] = useAtom(currentTabSupported);
75

8-
useEffect(() => {
6+
useEffect(() =>
97
fire(async () => {
10-
const windowId = (await browser.windows.getCurrent())?.id;
11-
if (windowId === undefined) {
12-
jotaiStore.set(currentTabSupported, true);
13-
return;
8+
const tabs = await browser.tabs.query({
9+
active: true,
10+
currentWindow: true,
11+
});
12+
const activeTab = tabs.at(0);
13+
if (activeTab) {
14+
setIsSupported(
15+
activeTab.url ? url.isSupportedSpec(activeTab.url) : false,
16+
);
1417
}
15-
const currentTab = (
16-
await browser.tabs.query({ windowId, active: true })
17-
).at(0);
18-
jotaiStore.set(
19-
currentTabSupported,
20-
url.isSupportedSpec(currentTab?.url ?? ""),
21-
);
22-
});
23-
});
18+
}),
19+
);
2420

2521
if (isSupported) {
2622
return null;
@@ -36,7 +32,7 @@ export function NotifyStrip() {
3632
)
3733
}
3834
>
39-
! Current tab is not supported
35+
⚠️ Current tab is not supported
4036
</button>
4137
</aside>
4238
);

entrypoints/sidepanel/features/program.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import CodeMirror, { EditorView } from "@uiw/react-codemirror";
22
import { javascript } from "@codemirror/lang-javascript";
33
import { Code, PlayIcon } from "lucide-react";
4-
import { usePreferredColorScheme } from "./hooks/use-preferred-color-scheme";
5-
import { atom, useAtom, useAtomValue } from "jotai";
4+
import { atom } from "jotai";
65
import { programAtom, selectionAtom } from "../atoms/app";
76
import { SuspenseBoundary } from "../components/suspense-boundary";
87
import { ErrorConsumer, KnownError } from "../components/ErrorConsumer";

entrypoints/sidepanel/features/test262.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
LoaderCircleIcon,
66
} from "lucide-react";
77
import { useVirtualizer, Virtualizer } from "@tanstack/react-virtual";
8-
import { useAtomValue } from "jotai";
98
import { selectionAtom, test262Atom } from "../atoms/app";
109
import { handleDownload, rawUrl } from "../util/download-file";
1110
import { Card, CardHeader } from "../components/card";

entrypoints/sidepanel/util/tab.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

hooks/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export { useAtomValue, useAtom, useSetAtom } from "jotai";
2+
export * from "./use-media-query";
3+
export * from "./use-preferred-color-scheme";

0 commit comments

Comments
 (0)