Live data from Hacker News

Rethinking DOM from first principles

acko.net

111–120 of 234 posts

Re: Rethinking DOM from first principles

#111
I'm sympathetic. But the problem with trying to get away from something where the base item has "350+ properties" is that it almost certainly has a competing number of stakeholders/usecases that it supports.

That is to say, you aren't necessarily simplifying things. You are throwing away some of the things that somebody needs for what they do.

It may, in fact, be time to do this. I can't say. Odds are very high that you should, instead of throwing out some stakeholders as you try to shift something, you should invite the stakeholders you think you can more effectively serve to a new thing.

Re: Rethinking DOM from first principles

#112
post #90

Earlier quoted context omitted.

We had multiple implementations of Java, but if still failed for that reason. Even if the concerns had been completely addressed MS did not only want to stop Oracle taking control, it wanted to establish control itself. Was Java any worse from a security point of view than what we have now?

Yes, significantly. The JVM just flat out does not provide a sandbox. Remember the bad old days of clicking on a suspicious link and getting pwnd? That's what we'd have if it weren't for modern JavaScript engines

I thought the JVM had permissions restrictions in the days of Java applets?

Re: Rethinking DOM from first principles

#113
post #84
post #82

Earlier quoted context omitted.

You can still do this if you want, table element still exists and works the same way.

Well yeah but no self-respecting developer has done this for 15 - 20 years... it's kind of a red flag these days!

I really wish this was true. Sadly the caniemail website - https://www.caniemail.com/ - says that Gmail still doesn't support CSS grid or flex, which leaves nested tables for layout as the only viable solution for HTML emails (which, however many times you plead with your marketing colleagues, is still their preferred way for contacting/stalking customers).

Re: Rethinking DOM from first principles

#114

I like the DOM. I think people keep forgetting all the small details, like being responsive (working on mobile and desktop) and many other issues related to privacy and usability. IMEs, dictionaries, spelling correction, etc... All of these happen in text areas. If you implement things yourself, say in canvas on a webpage, you can't provide these. For example if I misspel somethng the browser can lookup that word in…

> Also note that canvas based input is also why Google Docs has so much trouble with emoji and non-English input.

It's far from the only thing it has issues with; I've found obviously broken UI patterns within a couple clicks of opening Earth's map view:

- right click doesn't appear to work anywhere (except input boxes), even on elements that have direct equivalents in other Google sites (like the account switcher),

- when you click the account switcher, as long as its open, the rest of the site ignores the mouse events; attempting to drag the map screen doesn't close the switcher, hovering over buttons doesn't change the cursor etc.

Re: Rethinking DOM from first principles

#115
post #80

Devs have learned not to keep state in the document, because it's inadequate for it. Web devs have moved the state out of the document into JS variables and have been piling bloated, short-lived crap on top of those variables ever since. If you actually keep state in the document things become rather simple. Scripts themselves become stateless and do not require direct dependencies on one another. Data can be queried…

so do you stringify all your state?

Re: Rethinking DOM from first principles

#117
post #95

Earlier quoted context omitted.

Flutter is amazing exactly because it was a response to the problem of creating modern cross-platform apps for the modern zoo of hardware. The text typesetting engine from the 80s is clearly not a good foundation for it. It's probably safe to say that the majority of the dev workforce in the last 2 decades started their career with learning HTML/JS/CSS stack, and it's understandable why they like it. It doesn't make…

You had a great comment I had saved last time this topic came up: https://news.ycombinator.com/item?id=41981458 It's true, what people think of as native on the web are merely incidental from its history, not some ironclad law of how to make interfaces.

Text selection is such a great example precisely because it is incredibly useful to have in many unexpected situations (and a great many more that should be expected), but UI designers as a rule do not think about these situations!

It is so bad that one of the most impressive operating system features to be added in recent years is the ability to select and copy arbitrary text from app UIs, using either accessibility APIs or (more recently) straight-up OCR (because of course accessibility is another thing UI designers forget).

It's not like adding text selection in native apps is even hard; it's just not on the radar, and never has been. The number of old-school apps that added some form of "open log file" to either support instructions or as an actual function in the UI instead of making error messages selectable / copyable is depressing; I've seen programmers spend more time mocking end users for not knowing how to take proper screenshots than it would have taken to implement selectable UIs.

...and by historical accident, this problem is now solved in the vast majority of new applications. A small mercy!

Re: Rethinking DOM from first principles

#118
post #84

Earlier quoted context omitted.

Well yeah but no self-respecting developer has done this for 15 - 20 years... it's kind of a red flag these days!

I really wish this was true. Sadly the caniemail website - https://www.caniemail.com/ - says that Gmail still doesn't support CSS grid or flex, which leaves nested tables for layout as the only viable solution for HTML emails (which, however many times you plead with your marketing colleagues, is still their preferred way for contacting/stalking customers).

[deleted]

Re: Rethinking DOM from first principles

#120
post #99
post #83

Earlier quoted context omitted.

Flex is great but tables are also a natural solution for anything grid-based, which of course layouts almost always are. The whole internet used to do stuff like this before the structural flow of content became important: header sidebar content

GP is also wrong anyway, CSS Flex is the wrong thing for creating layouts like this. We now have CSS Grid, which is the actual replacement for table-based layouts (which were used more recently than people like to admit because of Flex not working for two-dimensional layouts).

Sorry, I often conflate flex and grid, they occupy the same spot in my mind as “1 dimensional” and “2 dimensional” versions of the same underlying thing. I am wrong.
Post reply on HN