Remix.run Logo
chrismorgan 8 months ago

I just tried the demo on my very capable laptop (ASUS Zephyrus G15 2021, Linux, Sway; Firefox, also tried Chromium).

Performance is execrable. Text rendering is awful. Input is simply broken (e.g. my Compose key just doesn’t work). Double clicking highlighted the entire canvas thing, as well as the word under the cursor. Right clicking did nothing. Scrolling isn’t captured. The first menu thing I happened to try in the full-UI https://zetaoffice.net/demos/simple-examples/rainbow_writer.... example (Format → Theme, maybe I just picked unfortunately) crashed the whole app (which means that it just stops working mysteriously, leaving the UI in the last state it was in).

And you can’t even get started until it’s downloaded 50MB. (Though I’m actually mildly impressed it’s only that size.)

Seriously, this is completely unusable. It’s “cool tech demo”, but I would hate to actually have to use it.

And I’m pretty sure, based on my rather accurate understanding of how all these things work (comprehensive on the web side, good on the native side, not so much specific about LibreOffice itself), that a lot of this is going to be completely unfixable—though a couple of the things I identified are fairly straightforward to fix, which is if anything a further indictment.

It’s going to be extremely hard to get even decent results without targeting real DOM instead of going pure-canvas, and you can’t get excellent results without doing so.

peutetre 8 months ago | parent | next [-]

> It’s going to be extremely hard to get even decent results without targeting real DOM instead of going pure-canvas, and you can’t get excellent results without doing so.

Sure you can. Google Docs switched to canvas three years ago: https://workspaceupdates.googleblog.com/2021/05/Google-Docs-...

This wasm application renders to canvas and works fine for me: https://bandysc.github.io/AvaloniaVisualBasic6/

This one too: https://flutterweb-wasm.web.app/

Flutter and Google Docs gave up on the DOM because they couldn't get it working well enough, consistently enough across browsers. When you draw to canvas you get more consistent results because you control all the drawing.

wiseowise 8 months ago | parent | next [-]

> Sure you can. Google Docs switched to canvas three years ago: https://workspaceupdates.g

You just need to be one of the critical projects for BigTech. Easy peasy, compared to <editor_command> index.html.

> This wasm application renders to canvas and works fine for me: https://bandysc.github.io/AvaloniaVisualBasic6/

Trying to select text on mobile Safari just selects whole canvas. Same for your Flutter example.

What a regression for web. Just so that a couple of snowflakes can use their fad of the day or can stay in their comfort zone.

RandomThoughts3 8 months ago | parent | next [-]

> Just so that a couple of snowflakes can use their fad of the day or can stay in their comfort zone.

Or because the DOM is a piece of technology designed for rendering documents and not web apps and with limitations which has been severely gimping proper rendering of web apps for the past decade despite a slew of libraries trying to fill the cracks with various amount of success. Whichever you prefer.

solarkraft 8 months ago | parent | next [-]

> Or because the DOM is a piece of technology designed for rendering documents and not web apps

IDK, it seems to have been pretty successful at it to me, being of the most popular GUI frameworks currently, probably the most popular by a wide margin.

Being designed for documents it should exceed at rendering documents.

The problem isn’t on the DOM itself, it’s in mapping other frameworks to it. Of course it‘d be hard to port LibreOffice‘s rendering to the web, it‘d be a crazy amount of work to reach parity.

And it’s fine to argue that it doesn’t make sense at all to use the DOM for non-web document editing: OnlyOffice doesn’t do it either, as far as I’m aware.

It’s just a bummer to me since documents are exactly what the web was made for.

wiseowise 8 months ago | parent | prev | next [-]

Java was made for TV controllers. Now it powers majority of enterprise.

JS was made to animate monkey on a screen, and now it powers internet.

Technologies start with one goal and evolve.

troyvit 8 months ago | parent | next [-]

> We build our computer systems the way we build our cities: over time, without a plan, on top of ruins.

-- Ellen Ullman

jhbadger 8 months ago | parent | prev [-]

The fact that there are so many alternative languages for the JVM or which transpile to Javascript suggests that (at least to many people) that neither were ideal choices for their current uses.

eitland 8 months ago | parent | prev | next [-]

Or because Google doesn't like open web technologies, standards and interoperability now that they are the king of the hill?

peutetre 8 months ago | parent [-]

How are WebAssembly and canvas not open web technologies?

CharlieDigital 8 months ago | parent | prev [-]

Is `HTMLDivElement` really that different from `class Rectangle`?

RandomThoughts3 8 months ago | parent [-]

Yes, extremely.

A div element is a node in a tree which will be rendered by a very opiniated rendering engine adhering to a fairly strict set of standards, and which can be manipulated using a limited subset of technologies which are themselves fairly opinionated.

A class Rectangle can be pretty much whatever you want.

peutetre 8 months ago | parent | prev [-]

> Trying to select text on mobile Safari just selects whole canvas. Same for your Flutter example.

Ah, so yet again Safari is the problem. The new Internet Explorer unfortunately.

wiseowise 8 months ago | parent [-]

It is the same on every browser.

And you can even control zoom/scale on desktop. Very accessible!

chrismorgan 8 months ago | parent | next [-]

> And you can’t even control zoom/scale on desktop.

I must note (in the interest of factual accuracy, though as you see I loathe the approach) that this is not a fundamental limitation, just something that Flutter and probably ZetaOffice have chosen not to support. You can block such things in a DOM world too, and it’s stupidly common for app-like things to try to do so.

wiseowise 8 months ago | parent | prev [-]

Can’t*

nox101 8 months ago | parent | prev | next [-]

> Google Docs switched to canvas three years ago:

And broke CJK and emoji input. They only fixed emoji input recently. CJK is still broken.

arcanemachiner 8 months ago | parent [-]

> CJK

"The shorthand collective name for the Chinese, Japanese, and Korean writing systems."?

jraph 8 months ago | parent [-]

Yep. This is a very widespread acronym, though I can understand that it feels like obscure jargon the first time you run into it.

otabdeveloper4 8 months ago | parent | prev | next [-]

> couldn't get it working well enough, consistently enough across browsers

Google Docs literally doesn't work in Firefox. (Garbled text.)

For Google not working consistently across browsers is a feature, not a bug.

zelphirkalt 8 months ago | parent | prev | next [-]

Google Docs' Writer (or whatever they call it) is a terrible child's toy, just like Word of Office 365. Functionality is severely limited compared to traditional word processors like LibreOffice.

> Flutter and Google Docs gave up on the DOM because they couldn't get it working well enough, consistently enough across browsers. When you draw to canvas you get more consistent results because you control all the drawing.

And as a side effect, of course if you require the canvas, you will also be able to abuse the canvas, to fingerprint users. It is strange, how those things seemingly always coincide when it comes to Google products.

rbanffy 8 months ago | parent | next [-]

> Google Docs' Writer (or whatever they call it) is a terrible child's toy, just like Word of Office 365

I'd believe the vast majority of the user base has never noticed anything off with these applications. I have noticed one or two things missing in the in-browser PowerPoint and that's about it. If you want to do precise publication layout, Word (and Writer) are not the appropriate tools - you'll need something like InDesign.

jfengel 8 months ago | parent | prev | next [-]

For the vast majority of what I do, a toy is all I need.

This is the nasty catch-22. It is preferable to have a single tool that handles both simple and complex cases. But sometimes, you just can't make one tool that does both well. If you optimize for the hard cases, then most users will use only a tiny minority of the features.

Microsoft tried to work around that with the "ribbon", which tried to learn which features each individual uses. Users hated it.

So I keep around LibreOffice for the hard stuff, which I write perhaps once a year. And I use Google Docs every day.

peutetre 8 months ago | parent | prev [-]

> Google Docs' Writer (or whatever they call it) is a terrible child's toy

It's a toy that's making Google a lot of money.

chrismorgan 8 months ago | parent | prev [-]

Google Docs isn’t pure-canvas: they only switched their document area to use it for layout. Text rendering is still browser (necessary to keep performance even close), and all the rest of the UI is still DOM. Having thought extensively about it, I cannot come up with any advantage to the approach they’ve taken—neither the performance¹ nor the consistency² angles make any sense, and the product is actively worse because of it³. I’ve written more about it on HN at times, skim https://hn.algolia.com/?query=chrismorgan%20google%20docs&ty... for more. Seriously, having thought about it very carefully and reviewed the matter several times over the years, I honestly believe that they lied in their justifications.

Flutter… ugh, Flutter on the web is awful awful awful awful awful AWFUL AWFUL and I will hate you if you decide with open eyes to use it when you’re deliberately targeting the web.⁴ I lack energy to express my vitriolic loathing. Just go through https://hn.algolia.com/?query=chrismorgan%20flutter&type=com..., there’s lots of detailed explanation of specifically what’s bad, if you need it.

Avalonia Visual Basic 6? It’s the kind of thing where the limitations will show least, because of how limited it is. And also because it’s imitating (not quite the right word, but close enough) ancient software which itself wouldn’t work fully properly if run on current machines. Its text handling is dodgy, doesn’t do composition properly, scrolling is non-native, context menus are non-native which stops some things from working properly… but honestly that’s kinda the vibe they’re going for, so it’s not particularly upsetting.

Pure-canvas is irredeemably bad. With difficulty you can make some things decent even with it, but excellence is impossible with pure canvas.

Flutter and Google Docs did not give up on DOM for the reasons you cite. Google Docs, I honestly don’t understand why they gave up on DOM, the reasons they cited publicly genuinely don’t make sense. Flutter, it was because they don’t actually care about the web, it’s a third-class target, and too much of the way they design their API doesn’t port to DOM directly, so that making DOM a first-class citizen would have required compromises in their APIs that they were unwilling to make. But it was emphatically not about cross-browser consistency.

—⁂—

¹ Seriously, Google Docs is slower than it used to be, especially with higher latency and jitter.

² The parts they replaced had no consistency problems in any realistic browsers. Seriously. Their layout requirements are, in practice, really basic. The area where consistency can actually be a problem is text shaping and rendering, but they haven’t replaced that since it would tank performance.

³ My favourite example is keyboard navigation. It doesn’t match platform conventions, and that’s really irritating. Since we’re in this thread, LibreOffice also flouts platform conventions in this area, and it’s really irritating.

⁴ If you’re focusing on mobile and make a mobile app with Flutter and also put it on the web with Flutter because why not, better than nothing, I won’t like you very much, but I’ll at least understand. But if you’re saying “we need a web thing, how about we use Flutter”… no.

peutetre 8 months ago | parent [-]

> But if you’re saying “we need a web thing, how about we use Flutter”… no.

If you're making an application, there's really nothing special about the DOM.

You might as well control your drawing. That way you don't need to figure out cross browser incompatibilities all day.

And here's what someone who used to work on Google Docs has to say about it:

https://news.ycombinator.com/item?id=27133929

chrismorgan 8 months ago | parent [-]

Please look over my comments on HN about Flutter and pure-canvas and such. There are big problems. There is plenty special about the DOM that you lose and cannot gain back if you go pure-canvas. Links. Scrolling. Text handling. Composition. And various more.

Use DOM. Please use DOM.

Use canvas for an actual drawing canvas, but for the UI and anything else that’s largely text, use DOM.

thorstenb 8 months ago | parent | prev | next [-]

> It’s going to be extremely hard to get even decent results without targeting real DOM instead of going pure-canvas, and you can’t get excellent results without doing so.

One of the ZetaOffice (and LibreOffice) hackers here - and I have to disagree.

For something like an office suite, the canvas is literally the only way to achieve the document layout fidelity that users expect. The DOM does not provide enough knobs & dials to get all of MSO (and OOo) bug-for-bug layout compatibility onto the screen (and it's not even close). Don't take my word for it, see e.g. here: https://news.ycombinator.com/item?id=42100660 (and that only deals with the text layout parts).

chrismorgan 8 months ago | parent [-]

Yours is a common sort of objection, but somewhere between largely and completely irrelevant and/or wrong. Somehow I fail to convey my point and what my objections are, and people assume I mean certain things that I don’t mean and didn’t think I necessarily implied.

When I say “targeting real DOM”, that doesn’t mean you have to be subject to the browser’s layout implementations, though preferably you would still use its text shaping. You can still do all the layout yourself, if you want, and position everything absolutely. In practice you’ll tend to want to do at least a little of that, if you want to be able to support editing large documents; and much more if you’re aiming for consistent-across-devices layout. (… which my sister, who actually uses Word for work, reports Microsoft has been hugely slipping on—and Word never was intended as a desktop publishing platform.)

View DOM as more a rendering target; I don’t mind at all. So long as you’re using real DOM for input and output, most of the problems I’m complaining about will go away. Selection, editing, context menus, text rendering, all these things will be done properly.

If you take this approach, it is possible for you to run into some incompatibilities in advanced shaping, if your layout/text shaping engine and the browser’s behave differently, but in practice that will practically never happen any more in shaping, and in other areas you can control it.

I would also clarify what I thought was clear enough from my initial comment’s context: when I speak of “decent results”, I refer to the editing experience, not document layout fidelity.

samiv 8 months ago | parent | prev | next [-]

"Release early, release often", isn't that the often touted wisdom?

Of course that has the problem is that you can make the "first impression" only once and when that said "first impression" is terrible it can be really hard to convince anyone to try the software again for the second time.

I guess releasing, almost like everything else, is a balancing game between two early or too late and both extremes have costs.

yunyu 8 months ago | parent | prev | next [-]

On the flip side, this is extremely fast and works pretty well on my M1 Pro Macbook running Chrome. The only downside is that it's a little blurry (as it's rendering at 1x pixel scale).

giamma 8 months ago | parent | prev | next [-]

OnlyOffice has decent performance and is pure canvas. However, they have (or had) issues with respect to accessibility, as screen readers don't read canvas.

tjoff 8 months ago | parent | prev | next [-]

Barely worse than Teams or your typical web app. Needs polish for sure but the bar for web apps aren't exactly high.

Canvas usually breaks text selections etc. and accessibility. But what they do seem to perform much better than trying to get the DOM to do something it wasn't designed for.

zelphirkalt 8 months ago | parent | next [-]

MS Teams is among the worst pieces of software, that people have to deal with on a daily basis, because it gets shoved down their throat at their jobs. If something is even worse than that, even if "barely", then it is a complete disaster. A little "polish" will not be able to make it right.

chrismorgan 8 months ago | parent | prev [-]

When you delve into badly-performing web apps, DOM is almost never the actual performance bottleneck. It’s other things they’re doing. And in the rare cases where DOM is the bottleneck, it’s always that they were abusing it.

As for this case, I have never encountered a web app with performance (throughput and latency) problems like this. Not anywhere near it.

tjoff 8 months ago | parent [-]

Similarly I don't think canvas is the bottleneck here.

Oh, and abuse is the name of the game. Almost exclusively the only thing the browser deals with is abuse. Logical consequence when the users are the one paying for it.

andrekandre 8 months ago | parent | prev | next [-]

interesting, on my 2019 ipad pro, after initial loading that took a bit of time, editing was quite quick and fast for me*

i wonder if there is some parts that remain unaccelerated or hitting performance bottlenecks on linux/firefox?

* admittedly a bit low-res/ugly and hard to use on touchscreen

thorstenb 8 months ago | parent [-]

Firefox is indeed a bit of a hit-and-miss these days (though we absolutely want to support it). Best experience currently is on Chrome(ium).

zelphirkalt 8 months ago | parent [-]

Any ideas why it is hit and miss?

Do you test as much on FF as on Chromium based browsers, during development, as well as in quality assurance steps? I could imagine, that some devs are looking at it in Chromium (or even Chrome shudder) all day, while implementing things, and then just having to tick a checkbox for FF "Yep, seems to work.". Which would of course lead to a Chromium-centric code.

kolAflash 8 months ago | parent | next [-]

Being one of the ZetaOffice (and LibreOffice) hackers, I use Firefox as my primary browser. And I really don't like using software only Google knows how to support (=> Chromium). Sometimes I even think about migrating to SeaMonkey

But for example, you unfortunately can't properly debug multi threaded WASM code in Firefox.

https://bugzilla.mozilla.org/show_bug.cgi?id=1589908

Have a look at the Firefox developer tools' debug tab with this page opened. And it will list the threads (web workers) named with some randomized UUID. Impossible as a daily development driver :-/

https://zetaoffice.net/demo2.html

Chromium's Sources tab properly shows each thread's name. So I can easily spot "em-pthread_1" which contains the LibreOffice main thread.

But have a look at this line and you'll spot some extra code I added for running in Firefox :-)

https://github.com/allotropia/zetajs/blob/8258649a7b98fd6af9...

If you have an idea for how to fix a Firefox specific problem, please file an issue and I promise to check if we can integrate the fix.

thorstenb 8 months ago | parent | prev [-]

Most devs here use FF as their daily driver - that said, if you need to debug an emscripten-compiled c++ WASM application in the browser, then it's either printf-debugging, or Chrome + the C/C++ DevTools extension. Additionally, the overall QoI for running WASM binaries appears quite a bit better for Chrome. Both issues tip the scales currently, in favour of Chrome (sadly).

curt15 8 months ago | parent | prev [-]

The UI in the home page screenshot also looks like 90s-era Windows.

exe34 8 months ago | parent | next [-]

Ooh that's great, I might give it a try.

rbanffy 8 months ago | parent [-]

I miss 1970's 3278 vibes. PROFs ftw!

johnisgood 8 months ago | parent | prev [-]

Seems like a feature. :D