News for hackers. Stuff that matters.

no_way

I am using this api for music player[0] in the browser. Biggest share of my users are using Chromebooks, where besides Android apps are not much alternatives. If this API was not available closest thing would be to make an Electron app, which has much more broad system access to users device than a website using showDirectoryPicker.

Regarding security I think Chrome got right balance on this: you always need to select folder, sensitive ones are excluded, on repeat visits if you try to access a file, it asks you permission again, you can't get full filename paths and so on.

[0] https://github.com/minht11/local-music-pwa

Re:Ask HN: Best Tools for Monorepo? on Wednesday July 31, 2024 @05:33PM (#41123689)
In our projects we use Moon https://moonrepo.dev/moon extensively, it supports multiple languages and quite a few features.

For me personally I like that it updates Typescript references automatically and makes docker image setup far easier.

I agree somewhat, but what about poorer regions of the world like parts of Africa or Asia, what is the solution for them? Most of the people there would not or could not pay for every website to use. It would be unfortunate if the web is inaccessible for most people.
Maximising profits and being sustainable are 2 different things. Museums do not need to make money because they are funded externally. It is like saying artists do not need to make money. You seem to go to the very extremes.
Web needs to make money. Giving tools to advertisers while making sure user privacy is preserved is better than free reign of tracking we have before, no?

I myself do not like ads or tracking, but we need to be realistic and there needs a way to make web sustainable.

How to do that and making sure that monopolies like Google are in check is a valid concern though, but in these conversations is the only point I hear. Ironically Google does not even need these apis because it already has so much data on users, it is primarily for smaller companies.

Every one of my phones before was rooted with custom os flashed, but now I feel exactly the same a as you, it's just not worth it. Kinda sad how stuff is being more and mored locked down.
Re:Are We Modules Yet? on Wednesday May 01, 2024 @01:57PM (#40226819)
There quite a few in javascript/browser world: - Browser Houdini effort https://ishoudinireadyyet.com/ - Service workers https://jakearchibald.github.io/isserviceworkerready/ - Svelte 5 new version https://svelte-5-preview.vercel.app/status - Turbo bundler rust rewrite https://areweturboyet.com/

And prob much more

Just go to home page https://wpt.fyi/ see chart "Browser-specific failures are the number of WPT tests which fail in exactly one browser." Safari leads by a longshot with over 3800 tests failing only in Safari. Firefox has 1700 and Chrome less which kinda correlates to my own personal development experience.
Re:JSR: The JavaScript Registry on Friday March 01, 2024 @10:47AM (#39562843)
> The "web standard" part is meaningless considering that most production websites will bundle the files together as part of their build/optimization process for size and loading speed, leaving only a giant chunk(s) that resembles nothing like the original ES modules.

I mean code itself will be non readable, but in modern build ouput chunks are using regular esm modules, at least for Vite, Rollup, Parcel and so on. Webpack might be different story, but still.

Re:Firefox finally outperforming Google Chrome in SunSpider on Tuesday August 15, 2023 @03:26PM (#37138206)
Semi related, I was suprised just how many bugs Safari has with animation timing while using Web Animation API. You can't possibly feature detect that, Motion one lib even disables GPU acceleration for them in Safari. In that case parsing user agent is the only option.

https://motion.dev/guides/waapi-improvements#webkit-bugfixes

Re:Firefox finally outperforming Google Chrome in SunSpider on Tuesday August 15, 2023 @03:18PM (#37138087)
From my experience, if things work in Chrome, they will likely work with Firefox too, excluding very new apis, it isn't much of maitenance burden. With Safari every project I work o I discover new Safari quirk or bug. If you can make it work in Safari you can make it Firefox too.
Re:Twitter has fewer than 550 full time engineers on Saturday January 21, 2023 @06:53AM (#34465796)
WhatsApp always comes up in comparison to Twitter, but they are fundamentally different. WhatsApp is mostly one on one interaction, while Twitter potentially allows every user to interact with every other user, it's unbelievably more complex to do that at scale compared to WhatsApp, not even talking about all the extra features Twitter has. Search probably being best example of complexity differences.
Chat apps are mostly one on one interaction, it is much harder run an open platform where every user can potentially interact with every other user, not even talking about search and how complex it gets. If Twitter is bloated or not is a valid discussion, but comparison it to WhatsApp is not.
You clearly never looked into how much tracking mobile apps have. There are a lot of tracking SDKs which literally track every click. At least on the web you can block things where mobile is black box.
Re:Atom Was Archived Today on Friday December 16, 2022 @03:30AM (#34012210)
I like JSX too, it allows multiple composable components in the same file, but Sveltekit support for typescript has been amazing so far, the whole framework has been written with typescript in mind and it shows.
Re:JavaScript APIs You Don’t Know About on Thursday December 15, 2022 @06:02AM (#33997748)
It was very slow before, but browsers improved performance a lot, multiple frameworks use proxies for their reactive primitives under the hood, Vue, Mobx and so on. SolidJS is one of the fastests frameworks out there and is built mainly on proxies, so proxies themselves can't be that slow.

Granted in very very tight loop regular object get/set will be faster, but performance is more than good enough today. If you have an use case for it, use it.

Re:jQuery 3.6.2 Released on Wednesday December 14, 2022 @02:27PM (#33988787)
You can use fetch polyfill which woyld be better choice since its easier to remove polyfill than refactor your whole site once you don't need to support those old browsers anymore.
Re:SvelteKit 1.0 on Wednesday December 14, 2022 @01:34PM (#33987755)
I had exact same experience with it "it just worked", I started playing with few days ago and compared with other frameworks where I had to fight my to do what I wanted to do, from libraries to non oblivious behaviours. In SvelteKit it just works and it's refreshing. Especially love the builtin animation stuff.
Re:WebKit on GitHub on Wednesday August 31, 2022 @04:36PM (#32668014)
It is a fork, but that was really long time ago, most parts of both engines were completely rewritten so for all intents and purposes these are completely different engines.
Re:TypeScript is terrible for library developers on Tuesday August 23, 2022 @03:21PM (#32569986)
Writing new library and expecting people to actually use it without providing types is not realistic. You can write library in JS, but you will still need to provide types, since that's what ecosystem is right now.
Re:Using: Has() as a CSS Parent Selector and much more on Saturday August 20, 2022 @05:47AM (#32530750)
They are first but it's not like other browsers are far behind, Chrome is already shipping :has, being first for one feature doesn't mean much while you are years behind implementing non controversial features already in other browsers, not even talking about Safari bugs..
Ironically that's kinda similar what Google FLoC was supposed to be.
Re:New WebKit Features in Safari 15.5 on Monday May 16, 2022 @03:24PM (#31402125)
I am still insanely upset that there are a lot of years spanning bugs which aren't fixed in Safari or even acknowledged in their bug tracker, but the situation is getting a lot better with the release frequency and new features so at least there is hope for things to get better from here.
Yeah, zoom changes page scale factor you can see it's computed value window.devicePixelRatio and that in return changes everything. Font-size can be also be changed independently of zoom inside browser settings.

https://developer.mozilla.org/en-US/docs/Web/API/Window/devi...

The text drawing code isn't using WinUI tho, they embed terminal canvas into something called "islands", so in this case it's not an UI frameworks fault. Besides I have used it on relatively old laptop and it was fine for me, but others experiences might differ.
If you are building cross platform app, there isn't much reasons to lock yourself in into platform specific framework, but just look at new Windows Terminal, it's great and it is using WinUI 3.
Re:Vue 3 as the New Default on Tuesday February 08, 2022 @01:47AM (#30255601)
I would pick Vue 3 over React just for performance alone. With React you do not have much breathing room and without specific optimizations like memo specific components, being aware what rerenders what: don't even try to use context api in large app for often changing data. Vue is much more forgiving and new composition api is nice. Both frameworks ecosystem and developer experience are pretty similar at this point.
To render content based on device screen scaling. window.devicePixelRatio provides page zoom level combined with OS DPI setting. Things like canvas do not use scaling by default, so to render content appropriately you need to know by how much you have to scale it. Other use cases exit too.
Re:Parcel CSS: A new CSS parser, compiler, and minifier on Wednesday January 12, 2022 @05:43PM (#29913793)
I have done manual configs from scratch in Rollup, even wrote bunch of plugins for stuff like custom css class minifying and web worker support, so no I don't need handholding :) Setting it all up was even fun, everything was well documented and clear, with Webpack on the other hand, you only have fun if you like pain.

Older »