2024.4.0 HOOPS Communicator ESM Support

Hello developers,

We are excited to announce that the commercial launch of ESM for HOOPS version 2024.3.0 is on the horizon! We urge users to transition to this version as soon as possible. This upgrade aligns with modern development best practices and enhances maintainability, dependency management, and compatibility with the latest JavaScript environments. Leveraging ESM enables the creation of single-page applications, facilitating the development of more dynamic, responsive, and effective web applications with an exceptional user experience.

The HOOPS Communicator documentation has been updated to reflect the changes. Check out our Migration Guide if you’d like to migrate.

Frequently asked questions:

Will any of the previous versions be depreciated?

Yes, the following changes will be made:

  • Version 2024.4.0: The legacy IIFE version of the webViewer will be deprecated.
  • Version 2025.1.0: The legacy IIFE version will be removed.

What are the benefits of migrating?

  1. Improved Maintainability: ESM provides a standardized way of organizing and importing/exporting modules, making the codebase more organized and easier to maintain. With ESM, you can clearly define dependencies between modules and manage them using import/export statements. This leads to cleaner and more modular code, reducing the chances of errors and making it easier for developers to understand and work with the codebase.
  2. Better Compatibility: As ESM is part of the ECMAScript standard, it is supported natively in modern JavaScript environments, including browsers and Node.js. By migrating to ESM, you ensure better compatibility with the latest JavaScript features and tools. Additionally, ESM allows for static analysis of imports, which can help optimize the bundle size and improve performance.
  3. Enhanced Dependency Management: ESM provides a more flexible and powerful mechanism for managing dependencies than IIFE. With ESM, you can easily import modules from external sources, such as npm packages, without additional bundling tools. This simplifies the development workflow and reduces the complexity of the build process. Additionally, ESM supports dynamic imports, allowing you to load modules asynchronously when needed, which can improve the performance of your application by reducing initial load times.

What is the difference between the monolithic and non-monolithic versions? Why use one over the other?

The two versions, monolithic and non-monolithic, are identical functionally. Physically, one is composed of only one file, and the second is composed of multiple smaller files. Both versions have advantages and disadvantages.

Monolithic Version:

  • Only one file needs to be set up in your development environment
  • The file is 5MB and needs to be downloaded for the web page to run

Non-monolithic Version:

  • Multiple smaller files
  • Faster to download because of load balancing

My existing integration is IIFE, and I don’t want to migrate it yet. What should I do?

If you don’t want to migrate, you would need to modify the path to the HOOPS WebViewer files. Refer to the example below for guidance.

Original file path:

"/HOOPS_Communicator_latest/web_viewer/src/js/hoops_web_viewer.js"

New file path:

"/HOOPS_Communicator_latest/web_viewer/deprecated/src/js/hoops_web_viewer.js"

its wonderful quite helpful for the developers

1 Like