discourse/docs/CHANGELOG-JAVASCRIPT-PLUGIN-API.md
Martin Brennan f70e6c302f
DEV: Switch to using uppy uploads in composer by default (#15058)
This is a big change to change over to using the uppy
upload mixin in the composer by default. This gets rid
of the temporary composer-editor-uppy component, as well
as removing the old ComposerUpload mixin and copying over
any missing functions that were not yet implemented by
ComposerUploadUppy. This has been working well on our
hosting for some time now and has led us to several
bug fixes.

This commit also deletes the old plugin API for adding
preprocessors for the uploads. The accepted method of doing
this now is via an uppy preprocessor plugin, which we have
several examples of in the core codebase.

Leaving the `enable_experimental_composer_uploader` site setting
intact for now because some plugins still rely on it, this
will be removed at a later date.

One step closer to ending the jQuery file uploader saga...
2021-11-30 08:33:06 +10:00

1.6 KiB

Changelog

All notable changes to the Discourse JavaScript plugin API located at
app/assets/javascripts/discourse/app/lib/plugin-api.js will be described
in this file..

The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.

[1.0.0] - 2021-11-25

Removed

  • Removes the addComposerUploadProcessor function, which is no longer used in
    favour of addComposerUploadPreProcessor. The former was used to add preprocessors
    for client side uploads via jQuery file uploader (described at
    https://github.com/blueimp/jQuery-File-Upload/wiki/Options#file-processing-options).
    The new addComposerUploadPreProcessor adds preprocessors for client side
    uploads in the form of an Uppy plugin. See https://uppy.io/docs/writing-plugins/
    for the Uppy documentation, but other examples of preprocessors in core can be found
    in the UppyMediaOptimization and UppyChecksum classes. This has been done because
    of the overarching move towards Uppy in the Discourse codebase rather than
    jQuery fileupload, which will eventually be removed altogether as a broader effort
    to remove jQuery from the codebase.

Changed

  • Changes addComposerUploadHandler's behaviour. Instead of being only usable
    for single files at a time, now multiple files are sent to the upload handler
    at once. These multiple files are sent based on the groups in which they are
    added (e.g. multiple files selected from the system upload dialog, or multiple
    files dropped in to the composer). Files will be sent in buckets to the handlers
    they match.