Skip to content

Rework UV to avoid 500s without dynamic loading - NOREF#550

Merged
sarangj merged 7 commits into
qafrom
ugh
Apr 8, 2026
Merged

Rework UV to avoid 500s without dynamic loading - NOREF#550
sarangj merged 7 commits into
qafrom
ugh

Conversation

@sarangj

@sarangj sarangj commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Ticket:

  • NOREF

This PR does the following:

Reverts my previous 'fix' - it seems like dynamic loading still breaks the events system for some reason.

So instead, just do the simpler fix of not referencing the universalviewer library at the top level at all, opting for our own constants in the universalviewer component.

I also made the download dialogue pruning a bit more robust, to have it respond to the showOverlay event, so that the pruning fires every time a download overlay is rendered.

Open questions

How has this been tested? How should a reviewer test this?

Accessibility concerns or updates

Checklist:

  • I have added relevant accessibility documentation for this pull request.
  • All new and existing tests passed.
  • I have updated the CHANGELOG.md.

This reverts commit 5288d9a, reversing
changes made to 1694f53.
@vercel

vercel Bot commented Apr 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
digital-collections Ready Ready Preview, Comment Apr 8, 2026 7:20pm

Request Review

@sarangj sarangj force-pushed the ugh branch 2 times, most recently from 4d40c20 to 59f5659 Compare April 8, 2026 17:48
sarangj added 3 commits April 8, 2026 15:00
This ensures we aren't relying on `window` on the server side.
Make the UV custom hook only load the uv library on the client side, as
the import triggers calls to the window API.
Looks like the options only get pruned on the initial page render.
Reading some UV code, I realized we could do this more simply by
listening for the showOverlay event, which gets fired whenever an
overlay is shown (of which the download dialogue is one). However, there
is a small delay between the event being fired and the ui elements
actually rendering, so I still need to attach a mutation observer here.
@sarangj sarangj changed the title Ugh Rework UV to avoid 500s without dynamic loading Apr 8, 2026
@sarangj sarangj changed the title Rework UV to avoid 500s without dynamic loading Rework UV to avoid 500s without dynamic loading - NOREF Apr 8, 2026
@sarangj sarangj marked this pull request as ready for review April 8, 2026 19:05
Comment thread app/src/components/items/uv/universalViewer.tsx Outdated
Comment thread app/src/components/items/uv/universalViewer.tsx Outdated
Comment thread app/src/components/items/uv/universalViewer.tsx Outdated
sarangj added 2 commits April 8, 2026 15:06
Add something explicit that spells out why we're not using the constants
from the library.
Comment thread app/src/components/items/uv/universalViewer.tsx Outdated
@sarangj sarangj merged commit 3d5e749 into qa Apr 8, 2026
9 checks passed
@sarangj sarangj deleted the ugh branch April 8, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants