Open eliandoran opened 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.
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
@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.
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
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 throughnpm
.Most of these dependencies are loaded via
src/public/app/services/library_loader.js
, which already seems to support references tonode_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.