From 4437069580a24ad493bf427e63b7cbf228892d03 Mon Sep 17 00:00:00 2001 From: Arnab Sen Date: Sat, 12 Mar 2022 11:17:24 +0530 Subject: [PATCH 1/3] fix: remove this on onKeyDownHandler --- src/components/Modal.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Modal.jsx b/src/components/Modal.jsx index 24af499..5bf2087 100644 --- a/src/components/Modal.jsx +++ b/src/components/Modal.jsx @@ -31,7 +31,7 @@ const Modal = ({ useEffect(() => { window.addEventListener('keydown', onKeyDownHandler); return () => { - window.removeEventListener('keydown', this.onKeyDownHandler.bind(this)); + window.removeEventListener('keydown', onKeyDownHandler.bind(this)); if (focusGrabberRef.current) { focusGrabberRef.current.remove(); focusGrabberRef.current = null; From d97430880af040b2c2cb37e390a438fabfc4e067 Mon Sep 17 00:00:00 2001 From: Arnab Sen Date: Sat, 12 Mar 2022 12:00:56 +0530 Subject: [PATCH 2/3] Package concurrently added to run gulp and preact Previously we had to run two separate commands to start the gulp preview server and the actual preact app. This new dev package will run those commands concurrently under the hood. We just have to use npm run start. --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6d3671d..a6d7b54 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "4.2.0", "description": "A blazing fast & offline web playground", "scripts": { - "start": "npm run -s dev", + "start": "concurrently --kill-others \"gulp start-preview-server\" \"npm run -s dev\"", "build": "preact build --template src/index.html --prerender false", "dev": "preact watch --template src/index.html", "serve-website": "cd packages/website; npm start", @@ -41,6 +41,7 @@ "babel-eslint": "^7.2.3", "babel-minify": "^0.2.0", "babel-plugin-macros": "^2.6.1", + "concurrently": "^7.0.0", "eslint": "^4.9.0", "eslint-config-prettier": "^2.3.0", "eslint-config-synacor": "^2.0.2", From d13e7981e008bf1b40539d1e1e43021e83a3a0d4 Mon Sep 17 00:00:00 2001 From: Arnab Sen Date: Sat, 12 Mar 2022 12:26:23 +0530 Subject: [PATCH 3/3] Replace preview with index in the check The iframe where the output is displayed in case of Files Mode has the url http(s):///index.html and not preview.html. --- src/detached-window.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/detached-window.js b/src/detached-window.js index 1253967..c2d21f5 100644 --- a/src/detached-window.js +++ b/src/detached-window.js @@ -9,7 +9,7 @@ window.addEventListener('message', e => { frame.contentDocument.close(); }, 10); } - if (e.data && e.data.url && e.data.url.match(/preview\.html/)) { + if (e.data && e.data.url && e.data.url.match(/index\.html/)) { document.querySelector('iframe').src = e.data.url; }