Best way to bring in new Js libraries like DataTables and other libraries

What is the best way for developers to upgrade libraries such as DataTables? Right now Openemr501 has outdated versions of Datatables 10.13 but the newest versions are using 10.18.

image

I’m looking for the best practices to handle this. Right now LibreEHR is using an approach where there is a function called call_required_libraries(‘argument’) which has all the include files in one spot. instead of having to refactor through hundreds of files where the js/css includes are the same, you only have to make changes in one method.

Is this something that we should incorporate here as well if we haven’t already?

Hi @growlingflea ,

OpenEMR has a nice mechanism that Robert built out for this. Check out this class and grep for Header::setupHeader to see examples:
openemr/Header.php at master · openemr/openemr · GitHub

And here is the config that holds the places:
openemr/config.yaml at 7d5ed2d4566ce346702e4573a432b50b677c91d1 · openemr/openemr · GitHub

Note 5.0.2 basically builds all the third party packages now and does not store them in the main codebase:
https://www.open-emr.org/wiki/index.php/Composer_and_NPM#Usage

-brady