Skip to content

Make uv.html available for embed - NOREF#552

Open
sarangj wants to merge 3 commits into
qafrom
enable_embed
Open

Make uv.html available for embed - NOREF#552
sarangj wants to merge 3 commits into
qafrom
enable_embed

Conversation

@sarangj

@sarangj sarangj commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Ticket:

NOREF

This PR does the following:

The UV package comes with a uv.html file that is handy to serve for
embed links. Use a webpack extension to copy the file into /_next/static
so it can be served publicly on DC.

Note - the embed link in the UV component refers to the /uv.html route.
While I should be able to override this using the ShareDialogue's
embedPath config option, that seems to not be working.

The alternative is to copy the uv files to the public/ dir at build
time, but the webpack extension doesn't seem to do this properly - I
could bake something into the build that directly copies to the repo's
public/ dir, but I'm going to try to avoid that for now - this is mostly
a proof of concept to try to use UV in the archives portal embed link

Second commit also consolidates the uv config into one place for clarity

Open questions

I put the uvConfig into the public/ folder to make it available for archives to reference - however, it might make sense to just have archives supply its own uv config (do we need / want to show download options and such, idk).

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

update my local archives portal to pull point at a DC uv.html on this vercel preview and see that the embed link loads

Screen.Recording.2026-04-10.at.3.16.42.PM.mov

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.

@vercel

vercel Bot commented Apr 10, 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 11, 2026 1:30am

Request Review

sarangj added 2 commits April 10, 2026 15:08
The UV package comes with a uv.html file that is handy to serve for
embed links. Use a webpack extension to copy the file into /_next/static
so it can be served publicly on DC.

Note - the embed link in the UV component refers to the /uv.html route.
While I *should* be able to override this using the ShareDialogue's
`embedPath` config option, that seems to not be working.

The alternative is to copy the uv files to the public/ dir at build
time, but the webpack extension doesn't seem to do this properly - I
could bake something into the build that directly copies to the repo's
public/ dir, but I'm going to try to avoid that for now - this is mostly
a proof of concept to try to use UV in the archives portal embed link
We pass a config object as a prop to the UV component, as well as to the
'configure' event. Let's make sure it's the same object.

I also stuck the config object into public/ so that archives portal
could pass a 'config' param to the iframe src so that we can use the
same config from archives.
@sarangj sarangj changed the title embed Make uv.html available for embed Apr 10, 2026
@sarangj sarangj changed the title Make uv.html available for embed Make uv.html available for embed - NOREF Apr 10, 2026
@sarangj sarangj marked this pull request as ready for review April 10, 2026 19:18
Comment thread package.json
"@types/newrelic": "9.14.3",
"@types/node": "^24.2.1",
"@types/ua-parser-js": "0.7.39",
"copy-webpack-plugin": "^14.0.0",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i should remove the '^'

To reduce the amount of implementation details archives / another client
might need to embed an item, just make a route that redirects to the
uv.html static page, constructing the necessary client side params on
behalf of the client. This way, the client doesn't need to know where
the default uv config is / how to construct a manifest.

I also forward any other params to uv.html in case the client *does*
have opinions on how to render the item.
config: "/uvConfig.json",
...searchParams,
}).toString();
console.log(queryString);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

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.

1 participant