saeho
A way to render code only if JS code can't be run
I noticed (at least in development), that when the app refreshes due to code change, and if I press back button to go to a previous version of the app which is no longer valid, the app doesn't work (rightfully so, because the previous iteration of the dev app no longer exists).
Interestingly, I noticed that the HTML code generated by previous version of the now non-existent app, stilll works.
But this previous version of the app is static HTML, and JS does not work until I refresh the app.
I'd like to know if it's possible to show a different code to ask the user to "refresh the page" if a user reaches this problem.
Note: I have not tested this in production, so I do not know if this is a problem in production.
2 replies
Which standard lib do I use?
I see the docs referencing https://deno.land/std/
But I thought JSR is the new shiny thing? And everythign is referencing jsr:@std.
So which stnardard lib do I use?
3 replies
Does preact useSignal() values need to be cleared for memory leak?
In react, I often had to do a
if (mounted.current) {...}
test to do something with reactive variables like states if I'm setting/using it after a Promise.
If I use useSignal() from Preact, do I still have to check for if (mounted.current) {...}
?1 replies
Deno Fresh: client side check dev or production
For my Deno Fresh app, I want to do a simple check from the client-side code to see whether it's in development mode or production deployed mode.
Use case is: I want to point my API to my localhost if it's in development, otherwise point the API to production server.
How can I do this in Deno Fresh?
2 replies
Deno is not defined
Is "Deno" supposed to be defined on the front-end client?
I'm trying to get a simple app working using Fresh framework, but even on a fresh install of Fresh app, Deno is not defined in client, which causes a LOT of necessary Deno modules to not work (for example, "graphql-request").
Is this a bug on Deno? Or is there another way I'm suppose to do this?
3 replies