Better HN
topnewbestaskshowjobs
Log inSign up

Keithamus

353 karma · joined Oct 14, 2011 (15y ago) · 81 submissions

Want to get in touch? hello@keithcirkel.co.uk

--- [ my public key: https://keybase.io/keithamus; my proof: https://keybase.io/keithamus/sigs/ANmvpFaYU45kEF8zO7bWil0G3te6hCGL5z02YiSMaEQ ]

Submissions

comment 1w ago · link · parent

This is essentially what we're working on at Open UI (https://open-ui.org/). Many of the primitives this page uses (e.g. `popover`) were incubated in Open UI, and were designed to essentially extract & encode common problems in the web. Developers shouldn't have to spend months writing libraries or patterns for their UI.

comment 4mo ago · link · parent

It’s unfortunate that this name was used. There is a W3C community group called OpenUI (https://open-ui.org/) which has been around for close to a decade, working on improving UI standards for the web.

comment 8mo ago · link · parent

I will get around to fixing this. An oversight. Apologies.

comment 8mo ago · link · parent

Right. The average score is under different test conditions. Obviously this game is a little silly version with very little accuracy to the lab testing, but hopefully it gets people thinking about this stuff a bit more! Which given your investigations into this, I would say it has succeeded.

comment 8mo ago · link · parent

JND is an average. A lot of people will do a lot worse. The measure, as I understand it, is also under different test conditions, while this is a game where people are on their own and able to - for example - tilt their head trying to find the exact angle to see the difference.

6.

Too Much Color(keithcirkel.co.uk ↗)

10 points · by Keithamus · 8mo ago · 1 comment

7.

Show HN: What's my JND? – a colour guessing game(keithcirkel.co.uk ↗)

56 points · by Keithamus · 8mo ago · 58 comments

comment 1y ago · link · parent

It’s not executing JS. The names map to JS methods but both the HTML and JS call into C++ (or rust or swift whatever the browser is written in). Arbitrary JS code execution cannot occur. Of course if you’re ingesting user generated content you should not allow these attributes on buttons (but for proper security you should already have an allow-list of tags and attributes on any user generated content).

comment 1y ago · link · parent

Author here. I am not affiliated with Google. My current employer is GitHub, and this was incubated in the OpenUI working group. Open source & the open Web are still very much alive!

comment 1y ago · link · parent

BroadcastChannel is a better solution for a couple of reasons. Service Workers are better at intercepting network requests and returning items from a cache, there’s some amount of additional effort to do work outside of that. The other thing is they’re a little more difficult to set up. A broadcast channel can be handled in a couple lines of code, easily debuggable as they run on the main thread, and they’re more suited to the purpose.

comment 2y ago · link · parent

Thank you for providing the detail I was scant on.

comment 2y ago · link · parent

While it hasn't been expressly resolved by the HTML working group to not propose new attributes with dashes, and while I don't speak for everyone in the HTML working group, I would assert that many members would object to a proposed attribute that included a dash (including myself).

There is also a proposal in the works to allow web developers to define custom attributes - much like custom elements - which would likely follow the same or similar rules around dashes, at which point I imagine the HTML spec would guarantee that no dashes would be used in "built in" attributes.

New attributes have been proposed that reasonably _could_ have had a dash, for example `popovertargetaction`, but instead they were compounded to one word precisely to cave out this path.

comment 2y ago · link · parent

They key difference is that an attribute can only appear once on an element, and consequently only have one of its variants present. Classes can present multiple variants at once.

At a surface level `<div class="Card" data-size="big">` isn't really any better `<div class="Card big">`. But `<div class="Card" data-size="big" data-size="small">` is not valid HTML - the second attribute is discarded. While `<div class="Card big small">` has no such contract, and as such is valid HTML and the CSS is unlikely to account for it, perhaps doing surprising things.

comment 3y ago · link · parent

React 19 is likely to ship with Web Components support. https://github.com/facebook/react/issues/11347

comment 3y ago · link · parent

Thanks for the feedback! If you have the time, I'd love for you to contribute and improve the marketing copy: https://github.com/WebComponentsGuide/webcomponents.guide

comment 3y ago · link · parent

I’ve been working on https://webcomponents.guide/ with some fellow experts in order to improve the documentation side of things. Hoping to offer guidelines and best practices to limit the amount of searching and experimentation required. Please take a look and provide feedback if you can!

comment 3y ago · link · parent

That’s what CSS parts and slots are for. Your component can style its own boundaries, provide parts to allow customisation, and use slots to inject components that are styled from outside (be it another ShadowDOM or the light DOM)

comment 3y ago · link · parent

There's hope for React yet: https://github.com/facebook/react/issues/11347

19.

Web Components Guide(webcomponents.guide ↗)

50 points · by Keithamus · 3y ago · 7 comments

comment 4y ago · link · parent

Was a poor attempt at a joke that perhaps didn’t carry :p

comment 4y ago · link · parent

I don’t recall saying old technology is bad. I was more trying to say it served its purpose at the time but as websites have gotten more complex we’re still relying on this one single primitive.

It’s true that as systems scale often templating systems are introduced to alleviate writing html, but these systems are rarely complete which means developers - meeds unmet - need to “drop down a layer” and in that should be set up for success not failure. Having a design system that use brittle underlying primitives will not set developers up for success.

comment 4y ago · link · parent

For large applications with many thousands of pages, or many thousands of engineers working on the same system, name collisions happen. It’s not just throwing “random css” into the mix, it’s that many disjointed parts of the same application suddenly become connected and interdependent. Especially with “parameter names” like “size”. You really have three choices to solve this: invent elaborate tooling to catch overuse; prepend your classes in the hope that lowers conflicts; or over specify selectors and deal with the specificity issues that fall out from this.

Custom elements are very well supported today! I’d encourage you to spend more time with them!

comment 4y ago · link · parent

I felt the “considered harmful” style of titles have been overused that no one would reasonably consider it anything but click bait; and so used it as ironic-click-bait.

comment 4y ago · link · parent

Naming collisions are a pretty real problem when you get to building large systems. They’re a big enough problem for something like CSS Modules to exist (explained further down in the post).

comment 4y ago · link · parent

I considered exploring it but css selector performance just doesn’t matter with todays engines. There are far greater issues, and far better performance wins than “optimising your selectors”.

26.

CSS Classes Considered Harmful(keithcirkel.co.uk ↗)

12 points · by Keithamus · 4y ago · 24 comments

comment 4y ago · link · parent

Just to update everyone: the domain has been renewed and is being transferred over to my account (as the current lead maintainer). We’ll use some funds to ensure it stays active for a long time and this won’t happen again.

comment 4y ago · link · parent

Failed expectations always throw an AssertionError, and they always have a stack. It might be the test runner you have which is breaking or hiding the stack?

comment 4y ago · link · parent

Sorry to hear that Andrew. If you'd like to point me to issues or PRs where you've contributed and don't feel like you had a good response, I'd be happy to follow up on them.

comment 4y ago · link · parent

Hi, I'm the current lead maintainer of Chai.

We don't own the domain name, the previous maintainer/author does. It seems to have lapsed. There's not much I can do about that other than attempt to contact the previous maintainer, which I've done.

123