I just created an extension using a JS library sortable.js.
I installed it using node in the extension, I assume there is a way to link to the CDN for the back office but I am sure that is not good practice.
If there are 6 packages installed in a site all using sortable.js this is not good practice either.
Am I missing something?
Dean Leigh
06/06/2024, 6:25 AM
Is there a way to install JS libraries and other dependencies globally for use in the back-office? Would this cause issues with different versions of said library in different packages?
j
Jacob Overgaard
06/06/2024, 6:44 AM
Yes, that could cause version conflicts if there were. It's perfectly reasonable to depend on Sortable directly and then use a bundler with tree-shaking (Vite, for example), so you only bring what you need. The overhead shouldn't be too large.
Jacob Overgaard
06/06/2024, 6:45 AM
Or you could try the UmbSorterController if that fits your needs