-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Currently this library basically consists of two parts:
- The API library (Uploader and Upload class) which provides framework agnostic functions to upload files to Nextcloud
- The Vue UploadPicker component which also includes files-app specific handling of the "new"-menu
This has the problem that the package is bound to that Vue version used for the upload picker.
Also the upload picker itself is very bound to the files app and only party reusable by other apps.
While you can disable the menu function in the upload picker to use it in your app without files specific functions, it does not make much sense to me that we share this in a library.
For me it would make more sense to implement those files specific functions directly in the files app.
So to make this library more lightweight and easier to maintain across Vue versions and other dependencies I was thinking about those some options:
We could remove the Vue related things all together, making this library a API only library similar to @nextcloud/dialogs. We still could provide the conflict dialog similar to the file picker as API only and without the Vue export. This way this library could use Vue 3 even in Vue 2 apps and we only need to maintain one version.
We could also move the upload picker to something like NcFilePicker in @nextcloud/vue making it pretty generic and reuse this one then in the files app by extending its menu with the "new"-menu entries.
This also has the benefit that the library becomes much more lightweight regarding its dependencies if you only have a small app or even a non-vue app.
Or we leave everything as is and maintain two different version for some time ;)
My personal opinion would be that the cleanest structure would be moving the file conflict dialog to nextcloud/dialogs similar to the filepicker. Then move the upload picker as a generic to nextcloud/vue and move the "new"-menu handling directly into the files app.
Meaning this package would only provide the API to upload files but not any UI.
What are your opinions? @skjnldsv @artonge and @ShGKme (especially as you are working on the Vue 3 branch).