Earlier quoted context omitted.
you are absolutely right. we should completely throw away the development of browser APIs over the years and develop sites with html 4.0
The web was a much better place 10 years ago.
Show HN: Speed up your site by running JavaScript when the browser is idle
81–90 of 95 posts
Re: Show HN: Speed up your site by running JavaScript when the browser is idle
#82What I’d really like to see on this page is more descriptive text. Mainly a description of what’s actually being done by the library. But also a section on when I should use idle-task over Partytown - https://partytown.builder.io/
I agree. The README file presents it like an alternative to `requestIdleCallback`, while, in fact, it is a convenience wrapper around `requestIdleCallback`. It is a nice idea, but the description makes it confusing.
That's right. I changed README to everyone to understand it.
Re: Show HN: Speed up your site by running JavaScript when the browser is idle
#83As other comments have pointed out, this behavior is enabled by `requestIdleCallback`. MDN has a good example and looks like this is not supported by Safari - https://developer.mozilla.org/en-US/docs/Web/API/Background_...
https://github.com/hiroki0525/idle-task/blob/main/src/index....
References - https://developer.chrome.com/blog/using-requestidlecallback/...
Re: Show HN: Speed up your site by running JavaScript when the browser is idle
#84Earlier quoted context omitted.
It's always Safari. I never figured out why.
The 3 biggest browser engines are Gecko, Webkit, and Blink. Gecko is the engine behind Firefox and is maintained by Mozilla, so it has a good number of open source contributors that help fix issues when they are found. It also has some issues occasionally but since it has only a ~3% usage these days you don't get as many complaints. Blink is used by Chromium (which includes Edge, Chrome, Opera, Brave, and Samsung bro…
Re: Show HN: Speed up your site by running JavaScript when the browser is idle
#85Re: Show HN: Speed up your site by running JavaScript when the browser is idle
#86There's lots of confusion what this is. Basically browser runs a giant eventloop. Whenever you call async function in javascript, it gets put into a queue, and called by the event loop (usually the next execution). This basically makes it so that the async call gets tagged with metadata that tells the event queue "Don't call me unless you have nothing else to call". So basically it keeps the async call at the end of…
Lol, thanks. This comment was better than the docs, as usual.
>this is a convenience wrapper around “requestIdleCallback” That's right. I changed README.
Re: Show HN: Speed up your site by running JavaScript when the browser is idle
#87Earlier quoted context omitted.
That's a fine personal choice but don't snarkpoop on other people's Show HN's. https://news.ycombinator.com/showhn.html
If other people's choice had no influence on me, I would totally agree with you.
Re: Show HN: Speed up your site by running JavaScript when the browser is idle
#88The code: https://github.com/hiroki0525/idle-task/blob/main/src/index.... Some initial impressions (based on https://github.com/hiroki0525/idle-task/blob/7e88c8b97c926cf... ): • The cancelIdleCallback fallback implementation will never be defined, so cancelAllIdleTasks will unexpectedly throw an exception in environments like Safari that depend on the polyfill. (Solution: delete lines 14–15.) • That the simple fallba…
Re: Show HN: Speed up your site by running JavaScript when the browser is idle
#89The logo made me think it's called "oldle Task"
Re: Show HN: Speed up your site by running JavaScript when the browser is idle
#90Earlier quoted context omitted.
If other people's choice had no influence on me, I would totally agree with you.
It's not a matter of agreement, it's just that this sort of comment is offtopic in Show HN's.
from the link you provided…