Hacker News new | ask | show | jobs
by anowell 94 days ago
Agreed. We've almost eradicated our usage of JS Date - fixing plenty of bugs along the way, and then I extracted thousands of lines of conversions and formatting from our production app (scheduling focused) into a temporal-fun package to make it Temporal more ergonomic for lots of common cases.

npmjs.com/package/temporal-fun

2 comments

Word of warning Temporal relies on the Intl API for formatting, and support in Chrome is very limited due to their binary size constraints. As a result, you'll need to polyfill unsupported languages using format.js

  $ du -sh '/Applications/Google Chrome.app'
   1.3G    /Applications/Google Chrome.app
There are numerous reports on this being an issue e.g. https://issues.chromium.org/issues/40624456
Thanks for the heads up. Will think on this and will probably just document the polyfill.
That's complete crazy.
Format.js polyfills a lot of stuff that's already supported in modern browsers, and seems to prefer its own polyfills to the native APIs.

Is there any way to force it to only use (and bundle) the polyfills that are needed assuming 2025+ era browsers?

That looks neat although your package is missing a link to the source repository.
Good catch. Will get that added today.

github.com/howie-code/temporal-fun