TriliumNext / Notes

Build your personal knowledge base with TriliumNext Notes
GNU Affero General Public License v3.0
562 stars 30 forks source link

Remove hard-coded libraries #224

Open eliandoran opened 1 month ago

eliandoran commented 1 month ago

This is quite a big task, so most likely it will need to be split into multiple PRs.

The goal is to remove all the dependencies that are stored in the repository, in the libraries directory, as they are hard to maintain and update. Everything should be managed through npm.

Most of these dependencies are loaded via src/public/app/services/library_loader.js , which already seems to support references to node_modules.

In order to avoid any regressions, the version imported must be exactly the same. It can then be updated to a newer version if needed, in a separate iteration.

eliandoran commented 1 month ago

@zadam , are there any constraints or obstacles that prevented the libraries from being imported from node_modules and instead are part of the repository?

I imagine that for some of them, such as ckeditor it was done in order to make modifications easier if needed.

rauenzi commented 1 month ago

CKEditor had custom Trilium changes made by Zadam so it cannot be easily converted to a node_module dependency, and if I recall correctly there were one or two others that were similar (perhaps CodeMirror and FacnyTree?). I remember zadam making those comments about CKEditor when I had proposed moving it to a node_module dependency

eliandoran commented 1 month ago

@rauenzi , we would need to dig a bit to see what changes were made to the CKEditor. Theoretically we could repack the CKEditor as a fork of the npm package which would be cleaner but a bit more difficult to maintain.

rauenzi commented 1 month ago

Yeah I don't remember all the changes off the top of my head but I can look through and see if I find any old comments. Yeah we can fork it and just install it with npm via GitHub directly, or use git submodules