Closed arnabsen1729 closed 2 years ago
Wohooo!!! Amazing fixes! Love the speed and quality 😃
One thing, we should try not to club different independent changes into one PR. Reason:
Yeah, makes more sense to keep them independent. Will keep it in mind next time.
Fixes: #443
1. Detached Preview Fix
The iframe in the case of Files Mode has src set to
http://localhost:7888/index.html
. When we click on detached preview, it opens a new window and checks for two cases, one for the normal mode and the other for the Files Mode. In the latter it had the condition;but as we mentioned before the src ends with
index.html
. So replacing thepreview
withindex
fixed the issue.https://user-images.githubusercontent.com/51032928/158008382-549db3ae-6390-4ad0-906b-eb03845a8164.mp4
2. Small fix in
src/components/Modal.jsx
.Currently, in the
v5
branch we see this error in the "files mode".The fix was to remove the
this
from thethis.onKeyDownHandler
. We have shifted to functional components inModal.jsx
inv5
.3. Added a new dev dependency
concurrently
When we are dealing with Files Mode in development. We need to have a separate server serving the
preview.html
. We do that usinggulp
. Runninggulp start-preview-server
achieves this:So we have to keep this running in the background and then run the
npm run dev
in another terminal which is a lot of hassle. For that, we use this tool concurrently.Now, we can just run
npm run start
and it will start the gulp preview server and the application together. We are using the flag--kill-others
so that it kills other processes if one exits (when we press Ctrl + C) or dies.