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

[Feature Request] Minimal Initial JavaScript Bundle for Authentication Redirect in OHIF Viewer #4596

Open
sedghi opened this issue Dec 12, 2024 · 1 comment
Assignees

Comments

@sedghi
Copy link
Member

sedghi commented Dec 12, 2024

What feature or change would you like to see made?

The OHIF Viewer currently initializes a large portion of its codebase, including extensions, modes, and services, before determining if user authentication is required. This results in a heavy initial JavaScript bundle and a slow initial load, even though the only immediate need is to redirect the user to the authentication provider. We propose creating a minimal initial JavaScript bundle that only includes the authentication service and a route handler for redirection. All other services, extensions, and modes should be lazily loaded after successful authentication, significantly improving initial load time, reducing bandwidth consumption, and providing a much snappier user experience. This requires refactoring the application's initialization logic and build process to implement code splitting and a two-phase loading approach.

Why should we prioritize this feature?

d

@sen-trenser
Copy link

sen-trenser commented Jan 1, 2025

@sedghi @IbrahimCSAE Could you please also consider an ability for extensions to provide a minimal js file to do any other document onload functionalities? This could be used for any consumer environment initialization/integration like logging, caching etc. services, custom configuration fetching, authentication etc. that needs to be done before OHIF app init..

Can webpack configured to bundle any onload.js script files from extension's public folder (when provided) and inject it in the platform app's index.html during build/publish?

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

No branches or pull requests

3 participants