nextcloud-libraries / nextcloud-libraries/nextcloud-vue
Reorganize reference widget API to improve tree-shaking
Nobody has claimed this yet.
- Dominant language
- Vue
- Stars
- 246
- Forks
- 99
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 103
Description
Currently we export:
@nextcloud/vue/functions/reference:- hasInteractiveView
- isWidgetRegistered 🔴
- registerWidget 🟢
- renderWidget 🔵
- ⚠️ getLinkWithPicker 🟣
- anyLinkProviderId 🟤
- getProvider 🟡
- getProviders 🟠
- searchProvider 🟥
- sortProviders 🟧
- isCustomPickerElementRegistered 🟩
- ⚠️ NcCustomPickerRenderResult 🟦
- registerCustomPickerElement 🟪
- renderCustomPickerElement 🟫
@nextcloud/vue/functions/registerReference:- destroyWidget
- isWidgetRegistered 🔴
- registerWidget🟢
- renderWidget 🔵
@nextcloud/vue/components/NcRichText:- anyLinkProviderId 🟤
- ⚠️ getLinkWithPicker 🟣
- getProvider 🟡
- getProviders 🟠
- isCustomPickerElementRegistered 🟩
- isWidgetRegistered 🔴
- ⚠️ NcCustomPickerRenderResult 🟦
- ⚠️ NcReferenceList
- ⚠️ NcReferencePicker
- ⚠️ NcReferencePickerModal
- ⚠️ NcReferenceWidget
- ⚠️ NcSearch
- registerCustomPickerElement 🟪
- registerWidget🟢
- renderCustomPickerElement 🟫
- renderWidget 🔵
- searchProvider 🟥
- sortProviders 🟧
⚠️ = Side Effect. It means, importing anything from this export also imports the part with a side effect
Coloured circles and squares = duplicates.
Due to side effects, even importing a small getProvider function is 200kb.
Proposal
- Make sure all the exports are really needed. And if not -- remove
- Deprecate unneeded duplicates
- Reorganise existing functions to have side effect free exports
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the exports from @nextcloud/vue/functions/reference, @nextcloud/vue/functions/registerReference, and @nextcloud/vue/components/NcRichText, then identify which duplicates and side-effect imports are actually needed. The work is done when unnecessary exports are removed or deprecated and the remaining functions can be imported without pulling in unrelated side effects.
Written by the indexing model from the issue text.
Assessment
- Domain
- frontend, tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100