Skip to content

Commit 0eeb744

Browse files
authored
Merge pull request #13961 from nextcloud/chore/33-breaking
chore: document breaking frontend changes of the Files app for Nextcloud 33
2 parents c4930a7 + 957a53d commit 0eeb744

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_33.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,38 @@ Upgrade to Nextcloud 33
55
Front-end changes
66
-----------------
77

8+
Files API
9+
^^^^^^^^^
10+
11+
Breaking changes in the Files API package
12+
"""""""""""""""""""""""""""""""""""""""""
13+
14+
The ``nextcloud/files`` library was updated to version v4.0.0 in Server.
15+
This release includes breaking API changes, so you’ll need to update your code in time for Server 33.
16+
17+
To improve developer experience, we’ve expanded the context object passed to file actions.
18+
It now includes additional fields such as the current folder and the current file list.
19+
Function signatures have also changed: Action handlers now use destructured parameters instead of positional array arguments.
20+
21+
You can find the full changelog and migration details in the repository: `nextcloud-files (4.0.0 beta) <https://github.com/nextcloud-libraries/nextcloud-files>`_.
22+
23+
Sidebar
24+
"""""""
25+
26+
The files API was changed in this release to use the Node API (available since Nextcloud 27) instead of the legacy ``FileInfo`` API.
27+
For this the way to register sidebar tabs and actions has changed.
28+
The ``OCA.Files.Sidebar`` API was removed and replaced with a new sidebar API available from the `@nextcloud/files <https://www.npmjs.com/package/@nextcloud/files>`_ package.
29+
30+
To register sidebar tabs you now have to use the new API which is based on web components,
31+
for more details please refer to the changelog of the ``@nextcloud/files`` package.
32+
33+
If you used the Files sidebar within your app you have to now use your own sidebar using the ``NcAppSidebar`` component from the `@nextcloud/vue <https://www.npmjs.com/package/@nextcloud/vue>`_ package.
34+
35+
Otherwise if you already use your own sidebar implementation in your app but rely on the Viewer app to open the sidebar using the ``OCA.Files.Sidebar`` API,
36+
you now have to listen to the ``viewer:sidebar:open`` event-bus event from the Viewer app to open your sidebar.
37+
So enable the **open sidebar** action within the viewer you have to set ``enabledSidebar``
38+
when opening the viewer to allow opening the sidebar from within the viewer and listen for the mentioned event.
39+
840
Added APIs
941
^^^^^^^^^^
1042

@@ -42,6 +74,10 @@ Removed APIs
4274
- To replace ``OC.getPort`` use ``window.location.port``.
4375
- To replace ``OC.getProtocol`` use ``window.location.protocol``.
4476

77+
- The ``OCA.Files.Sidebar`` API is removed.
78+
This was the last API using the legacy ``FileInfo`` API.
79+
It is now replaced with the new Node based sidebar API available from the `@nextcloud/files <https://www.npmjs.com/package/@nextcloud/files>`_ package.
80+
4581
- The ``OCA.Sharing.ExternalLinkActions`` API was deprecated in Nextcloud 23 and is now removed.
4682
It was replaced with ``OCA.Sharing.ExternalShareAction`` which now have a proper API by using ``registerSidebarAction`` from `@nextcloud/sharing <https://www.npmjs.com/package/@nextcloud/sharing>`_ instead.
4783

0 commit comments

Comments
 (0)