Kevin Tale
Kevin Tale
DDeno
Created by Kevin Tale on 11/25/2024 in #help
cannot publish package to jsr but it uses a shared file
thanks @NDH i'll join it and post there 🙂
3 replies
DDeno
Created by Kevin Tale on 11/22/2024 in #help
How to add a simple live reload?
so if I understand correctly your library allow to add hot reload functionality without having to manually add the websocket code to our index.html? It also recompile if src/ has change and simply reload the browser if the webapp per se changes (or just change the stylesheet if css files have change). Is that correct?
30 replies
DDeno
Created by Kevin Tale on 11/22/2024 in #help
How to add a simple live reload?
Did you made this package ?
30 replies
DDeno
Created by Kevin Tale on 11/22/2024 in #help
How to add a simple live reload?
Very interesting I'll give it a proper look, thanks!
30 replies
DDeno
Created by Kevin Tale on 11/22/2024 in #help
How to add a simple live reload?
ok perfect, I've managed to make it work 🙂 I've used websocket which is similar but we some differences on the syntax. Now I can build my hmr system! Thanks again @2saturdayscode !
30 replies
DDeno
Created by Kevin Tale on 11/22/2024 in #help
How to add a simple live reload?
Thanks I'll look at this tomorrow for sure and let you know 🙂
30 replies
DDeno
Created by Kevin Tale on 11/22/2024 in #help
How to add a simple live reload?
awesome, thanks man!
30 replies
DDeno
Created by Kevin Tale on 11/22/2024 in #help
How to add a simple live reload?
yeah it seems tricky. I thought about using websocket but couldn't fingure out how
30 replies
DDeno
Created by Kevin Tale on 11/22/2024 in #help
How to add a simple live reload?
The Math.random() will trigger again when I F5 my browser which is not what I want
30 replies
DDeno
Created by Kevin Tale on 11/22/2024 in #help
How to add a simple live reload?
thanks for the help. It kinda helped but I dont have the expected behavior yet. I've modified the code like so
export default {
async fetch() {
console.log(Math.random());
const content = Deno.readTextFileSync("./index.html");

return new Response(content, {
headers: { "Content-Type": "text/html" },
});
},
};
export default {
async fetch() {
console.log(Math.random());
const content = Deno.readTextFileSync("./index.html");

return new Response(content, {
headers: { "Content-Type": "text/html" },
});
},
};
And tried that deno serve -A -r --watch main.ts or that deno serve -A -r --watch=index.html main.ts And it seems that the Math.random() will only trigger the first time localhost:8000 is requested (so basically when my browser access this url). But on file change it wont reload it even though I can indeed see the message Watcher Restarting! File change detected: "C:\\Users\\33646\\Documents\\labs\\deno\\main.ts" in my console
30 replies