Open rashil2000 opened 3 years ago
Unfortunately I’m not able to reproduce this issue on OSX. (And also unable to debug because I don’t have a Windows PC.)
To be precise, the expected behavior is that when your Markdown file changes, the rendered page should update transparently without a refresh – note that this is different from how “Live Reload” works.
Yes, even the transparent update doesn't work unfortunately.
Is there something I can help you debug it?
Would you please point me towards the part of the code that does file-watching? I'll see if I can fix and send a PR. Thanks!
I have located the issue: the address 0.0.0.0 does not work on Windows (or maybe it's not configured to route to localhost by default)
Changing it here: https://github.com/yuanqing/rdd/blob/f85dc5dba860f41cc29ee04399e551c529df1097/src/js/serve.js#L87 and here: https://github.com/yuanqing/rdd/blob/f85dc5dba860f41cc29ee04399e551c529df1097/src/js/client.js#L5 to 127.0.0.1 works!
Would you like me to send a PR?
Is there a way to make a change that would work for both MacOS and Windows?
I believe the address 127.0.0.1 should work everywhere - Linux/Mac/Win.
Does it not work for you (I don't have a way to check on MacOS)?
@rashil2000 Are you able to verify if the fix in https://github.com/yuanqing/rdd/pull/3 fixes the issue on WIndows?
Hi @yuanqing
Yes, the address change fixes the live-reloading issue.
However, there are multiple other quirks in rdd that prevent it from building under, and running properly on Windows.
cat
command, which does not exist on Windows: https://github.com/yuanqing/rdd/blob/f85dc5dba860f41cc29ee04399e551c529df1097/package.json#L63globby
, that is being used to resolve markdown files, does not work with Windows-style paths. https://github.com/yuanqing/rdd/blob/f85dc5dba860f41cc29ee04399e551c529df1097/src/js/resolve-markdown-files.js#L22I have a fork of rdd, which is 2 commits ahead of upstream, and fixes these problems.
mkdirp
and rimraf
with the shx
library, which, in addition to providing mkdir
and rm
commands, also provides a cat
command. The commit is f5434da6e9ddae3220f2e8244bf79ec9f8baa943.globby
altogether (this may not be what you want), and letting Nodejs's core path
module handle the paths. The commit is e10cbbdc3f10b630ccc3be24f0990324cd19bc7b.
The browser page does not refresh whenever I edit and save the file.
[OS: Windows 10]