Skip to content

Move up iiif viewer javascript loading#7538

Draft
maxkadel wants to merge 1 commit into
mainfrom
preload_iiif_viewer_js
Draft

Move up iiif viewer javascript loading#7538
maxkadel wants to merge 1 commit into
mainfrom
preload_iiif_viewer_js

Conversation

@maxkadel

Copy link
Copy Markdown
Contributor

IIIF viewer javascript is pre-loaded on work show pages, and no longer waits to start fetching it until after the javascript is fully executed

Fixes

There is a general perception that Hyrax and Hyku are slow, and some of this comes from IIIF viewers taking awhile to show images. By default, the viewers are "above the fold" on work pages, so if they take a long time to render an image, the impression it gives is that the overall application is slow, not just that the viewer is slow.

This frontloads getting the iiif viewer javascript, and not waiting for the whole application javascript to execute prior to trying to fetch the viewer javascript.

Tested on a staging environment for a Hyku knapsack and shaved 3 seconds off of loading time.

Summary

Present tense short summary (50 characters or less)

Guidance for testing, such as acceptance criteria or new user interface behaviors:

  • For a deployment using Universal Viewer, the uv.html will start loading before the application javascript has finished executing.

Type of change (for release notes)

Choose from:

  • notes-bugfix Bug Fixes

Changes proposed in this pull request:

  • Pre-load iiif viewer on work show pages when available
  • The browser does not have to load and evaluate the scripts before continuing to parse

@samvera/hyrax-code-reviewers

IIIF viewer javascript is pre-loaded on work show pages, and no longer waits to start fetching it until after the javascript is fully executed
@maxkadel maxkadel added the notes-bugfix Release Notes: Fixed a bug label Jul 13, 2026
@github-actions

Copy link
Copy Markdown

Test Results

    17 files  ±0      17 suites  ±0   3h 26m 33s ⏱️ - 3m 43s
 7 953 tests ±0   7 645 ✅  - 1  307 💤 ±0  1 ❌ +1 
27 174 runs  ±0  26 571 ✅  - 4  599 💤 ±0  4 ❌ +4 

For more details on these failures, see this check.

Results for commit 3b6b6c8. ± Comparison against base commit bff6ede.

This pull request removes 450 and adds 450 tests. Note that renamed tests count towards both.
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f1fffabe250>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f491b9bb688>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f61a7dde108>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007fa0a5456b98>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f200213d5c0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f491b9cd220>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f61a7dd3988>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007fa0aa61e250>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: dc75bd53-53c4-4e78-8461-77e0b33bdf79
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 29f5410e-7dba-458b-94a2-43c309ecb616
…
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f014a463348>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f0b36a7a510>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f22efac1f48>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f6139dbadc0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f014bce4110>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f0b36b85018>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f2306463d60>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f613d9adfd0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: 1330bee3-d08c-4448-b5f3-49ecf296a485
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 09cdcf4b-a47c-435d-bbff-50053d38f381
…

@maxkadel
maxkadel marked this pull request as draft July 14, 2026 13:04
@maxkadel

Copy link
Copy Markdown
Contributor Author

It looks like the tests uncovered a legitimate failure in spec/features/batch_create_spec.rb:36 - the title parameter is not sent when this code is in, at least in the context of the test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes-bugfix Release Notes: Fixed a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant