Demo video here: https://share.extend.ai/kRmSGKRF
When we started, we tried every file viewer and document component library we could find. Unfortunately, none of them had all the functionality (and polish) that we wanted, so we ended up building our own for https://extend.ai/. It was only ever meant to be internal, but enough customers kept asking for it that we decided to open source it.
It's useful for building document processing agents, real-time user facing document intake flows, or all kinds of internal tooling.
We naively thought this would be a solved problem. Turns out, making PDF/XLSX/DOCX viewers that work at scale is not trivial...we use and maintain it for Extend ourselves, so we've fixed a lot of edge cases that came up while running millions of pages / day through our own system. Our hope is that with our resources + community support, it'll keep getting better over time.
- no caching for file previews
- no sorting by date in the file picker
- no sorting by size in the file picker
- no sorting by file type in the file picker
- no search in the file picker
- cant enter a folder in the detail view (only expand) in the file picker
- cant go to page (by page number) in the document viewer
- after clicking a button in the document viewer, focus is lost on the document and arrow keys, space, pgup/pgdown dont work until the document is clicked again
- cant select text in the document viewer, unless I search first, in which case it then works
This is after looking at the file picker and document viewer less than 3 minutes(!!!). I gave up after that. Getting 80% of a file picker is easy, getting the last 20% done, so that it's on par with existing software, is not.
Very very odd to have things look this polished, yet be this terrible functionality- and performance-wise. These are not random quirky new ideas I'm having, these have been basics that work in every single file picker and document viewer since the early days of UI, before the web.
What's more, even if state management should technically be easier with the amount of state libraries, you'll realise sooner or later that the established ones are cleverly immutable where you really just want them to be performant.
I am not saying that it's React at fault for the symptoms you see here, but I would expect any such library made in it to hit exactly these kind of edge cases.
Can you elaborate on that? What else would you recommend?
It has some rough edges as a result, but your suggestions are very valid. We’ll make those improvements (we’re also taking PRs!).
[r] Thread was about rewrite in rust, but it made me have a look at the purpose/claims made by the project - and fine-grained, automated memoization for speed seems central.
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...
None of the ones in the registry should have next as a dependency, please lmk if otherwise
Also, add either user interactive loading of components or lazy load the demos, the amount of demos murder performance on phones.
Thanks for releasing publicly.
[1] https://github.com/J-F-Liu/lopdf
We wrote (should say are writing) our own xlsx parser in Rust on IronCalc:
we hope this can be useful for people building in React though!
Is this a known issue?
could not have been easy
By quirk of fate i've spent the past 2 days prototyping some stuff on pdfjs. Just trying to figure out a game plan for handling bounding boxes in the face of page zooming, different resolutions etc. etc. I can't see it mentioned whether the components are virtualising pages (as in reusing dom elements as document pages scroll by). I guess i just learned what i'll be exploring tomorrow then...
the zoom should work with the bounding box highlights, we're working on adding rotation support
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 many hours, though I think today Fable + Codex makes it pretty quick
I could recreate these in lit as a fork, would be very useful to have the full set
I'm curious whether the primary users are AI-native document products or more traditional SaaS applications.
The document-app niche feels increasingly important with the rise of AI workflows.
i can't promise its visually 1:1 with Word/Excel but its pretty close on the corpus we tested with
We aren’t not trying to reinvent that engine, rather just provide a building block for people to plug in their design system to its controls
you are welcome to try it with your own documents and see, but its just one example we wanted to show. for the blocks that use the react-docx library, you can always copy the code and use a different method to render the docx file/thumbnails
the root page is a bit slow with all the viewers, in practice you probably wont have that many in your app on one page
On mobile Safari…
1. I saw it was React
2. Nothing loading, just a page full of spinners
I truly wish React could be launched into the sun.