Rothamsted / knetminer

KnetMiner - webapp to search and visualize genome-scale knowledge graphs
https://knetminer.com
MIT License
25 stars 16 forks source link

Converting Js type text/javascript to ESM modules #785

Open lawal-olaotan opened 1 year ago

lawal-olaotan commented 1 year ago

This ticket is related to #766

Having explored how to incorporate unit and integration testing to the current knetminer client-side architecture using Vitest, which is almost similar to Jest. It was discovered the file type text/javascript attributed to Knetminer Js files is currently outdated and discouraged by HTML5 specification as discussed in this SO thread making it impossible to use assertion libraries as most are compatible with CommonJs and ESM JS module system.

As a result, I propose that knetminer's Javascript files be converted to type modules using ESM specification so that it units can be imported to where it's needed and the issue specified in #766 can be resolved. Also, ESM modules are currently supported across web browsers as specified by MDN javascript module guides making it the best approach to incorporate unit testing to knetminer client-side js files.