Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded Zapps in Zupass #1899

Merged
merged 6 commits into from
Sep 26, 2024
Merged

Embedded Zapps in Zupass #1899

merged 6 commits into from
Sep 26, 2024

Conversation

robknight
Copy link
Member

This adds functionality for Zapps to be embedded in Zupass.

This can be enabled by configuring the EMBEDDED_ZAPPS environment variable for passport-client. This is a stringified JavaScript object, of the form:

{ "Zapp name": "http://zapp-url.com" }

A folder will appear in Zupass using the given name, and clicking on the folder will take the user to the Zapp.

Zapps will require some minimal changes to be able to support embedding, which are shown in the test-zapp example code.

Copy link
Collaborator

@rrrliu rrrliu left a comment

Choose a reason for hiding this comment

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

The code looks good to me, once the nits are addressed. Can you move staging-rob to the tip of this branch so that I can test it as well?


function App(): JSX.Element {
useBackgroundJobs();
useZappServer();
// useZappServer();
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove?

return (
<>
<ZappModal />
<iframe
Copy link
Collaborator

Choose a reason for hiding this comment

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

if it doesn't already, can we have this preload the webpage in the background so that it shows up quickly, if not immediately, once the button is pressed?

https://stackoverflow.com/questions/32547844/how-to-preload-iframes

Copy link
Member Author

Choose a reason for hiding this comment

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

The recommended answer in that thread has a few people saying that it doesn't work, and MDN doesn't list "document" as a supported "as" attribute for . Probably the only reliable option is to load the iframe in the background, but this means that it's sitting there consuming resources, running scripts, making network requests, and so on, even if the user never interacts with it.

Copy link
Member Author

Choose a reason for hiding this comment

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

We could make the loading process visually smoother by hiding the iframe until the Zapp is fully loaded, showing a nicer loading screen in the meantime?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've made a new Linear issue for this.

@robknight robknight added this pull request to the merge queue Sep 26, 2024
Merged via the queue into main with commit 0ac1827 Sep 26, 2024
1 check passed
@robknight robknight deleted the robknight/zapps-in-zupass branch September 26, 2024 11:28
rrrliu pushed a commit that referenced this pull request Sep 27, 2024
This adds functionality for Zapps to be embedded in Zupass.

This can be enabled by configuring the `EMBEDDED_ZAPPS` environment
variable for `passport-client`. This is a stringified JavaScript object,
of the form:
```json
{ "Zapp name": "http://zapp-url.com" }
```

A folder will appear in Zupass using the given name, and clicking on the
folder will take the user to the Zapp.

Zapps will require some minimal changes to be able to support embedding,
which are shown in the `test-zapp` example code.
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