Live data from Hacker News

Show HN: Extend UI – open-source UI kit for modern document apps

extend.ai

61–70 of 88 posts

Re: Show HN: Extend UI – open-source UI kit for modern document apps

#61
post #51

Why doesn't it mention anywhere that they are React components?

Not just React, but it apparently also depends on Next.js Dependency in package.json: - https://github.com/extend-hq/ui/blob/main/apps/v4/package.js... Dependencies in some components: - https://github.com/extend-hq/ui/blob/main/apps/v4/components... - https://github.com/extend-hq/ui/blob/main/apps/v4/components...

React (vs web components) might be questionable, but Next.js as a hard dependency, for a component library, is just weird.

Re: Show HN: Extend UI – open-source UI kit for modern document apps

#64

Earlier quoted context omitted.

Yeah, it also seems it's made in React & Next. From experience, you'll have a hard time choosing a worse technology for low-level, interaction-heavy UI. You need direct control over focus, keyboard handling, scrolling and so on. You also need to leverage hardware accelerated rendering too, which is clunky with 3rd party React libraries. What's more, even if state management should technically be easier with the amoun…

> From experience, you'll have a hard time choosing a worse technology for low-level, interaction-heavy UI. Can you elaborate on that? What else would you recommend?

Yes! First, you need to get the DOM-level behaviour right (dragging, resizing, cursor focus). That could mean you may use or build primitives like with interact.js, CodeMirror/Monaco (realistically just use, not build), Fancytree. I really like Muuri for layouts. Usually there's also subtle interaction physics going on when building such libs in unexpected places (such as resizing and drag N drop speed curves), which you should tweak to your taste.

For framework, React wants to own and mediate the DOM via virtual tree, which is a major bottleneck when you need direct control over focus/selection/keyboard routing or hardware accelerated canvases. Instead, look at Svelte or Solid.js, as they integrate nicely with imperative DOM-oriented JS libraries and don't require heavy wrappers or indirect references for the 'unfriendlier' DOM nodes like canvases, scroll containers and so on.

If you're building an OS-like UI, you should also care about state and be sure you have direct control over where your data lives. For example, I usually build with Solid.js and a mix of custom object and lifetime code plus Solid stores for reactive surface state.

I usually end up managing object lifetimes because I end up needing to handle messy edge cases around reference vs value semantics and state merging (e.g. keep cursor position sane after a file sync or track focus across multiple windows, especially after refresh)

For text editing, if you use Monaco, it has so many internal lifecycle hooks you want to be aware of and interact with directly, that you'll see that most of implementation will end up outside classic frontend lib fast and I'd rather build the thing instead of bridges and wrappers to talk with a high-level framework.

All in all, you probably want to own a lot of state and behaviour yourself, and add a cooperating framework on top instead of an all-encompassing one.

Re: Show HN: Extend UI – open-source UI kit for modern document apps

#65
post #51

Why doesn't it mention anywhere that they are React components?

Not just React, but it apparently also depends on Next.js Dependency in package.json: - https://github.com/extend-hq/ui/blob/main/apps/v4/package.js... Dependencies in some components: - https://github.com/extend-hq/ui/blob/main/apps/v4/components... - https://github.com/extend-hq/ui/blob/main/apps/v4/components...

Hey! Those components are used for the demo site, and shouldn’t ship or get installed when you install the components in the registry.

None of the ones in the registry should have next as a dependency, please lmk if otherwise

Re: Show HN: Extend UI – open-source UI kit for modern document apps

#67
post #52

Experienced the same nightmare a few times over with citations. React/next is limiting, we have rebuilt this for angular and now redid it again using lit for better compatibility. Our old one is very similar to this. Loading citations for each field across 1000s of pages, colliding citations for all the messy formats, zoom, rotate etc. what a mess! Great that you took the time to MIT this as it would have saved us ma…

Someone requested web components earlier so let me know if you make that happen!
Post reply on HN