Migration guide for @uploadcare/blocks v0.32.0
BREAKING CHANGES
- Global events are removed, i.e.
window.addEventListener('LR_UPLOAD_FINISH', ...)will not work anymore. Now you need to uselr-upload-ctx-providerblock to subscribe to the events. See the Events page for more details. - All existing events and their payloads are changed. See the Events page for more details.
lr-data-outputblock is removed.- To handle HTML forms you need to use
lr-form-inputblock. See the HTML Forms page for more details. - Groups output moved to the
lr-upload-ctx-providerevents. See the Events page for more details. - Console debugging output now enabled with the
debugattribute onlr-config. See the Options page for more details.
- To handle HTML forms you need to use
lr-message-boxblock is removed.
How to migrate
Global events
Before:
After:
Events names
LR_UPLOAD_STARTandupload-start->file-upload-startLR_REMOVEandremove->file-removedLR_UPLOAD_PROGRESSandupload-progress->common-upload-progressLR_UPLOAD_FINISHandupload-finish->common-upload-successLR_UPLOAD_ERRORandupload-error->file-upload-failedLR_VALIDATION_ERRORandvalidation-error->file-upload-failedLR_CLOUD_MODIFICATIONandcloud-modification->file-url-changedLR_DATA_OUTPUTanddata-output->changeLR_DONE_FLOWanddone-flow->modal-closeLR_INIT_FLOWandinit-flow->modal-open
Events upload-error and validation-error are merged into one event
file-upload-failed. The event payload OutputFileEntry contains the errors
property that contains both the uploading and validation errors.
Event payloads
All the event payloads are changed a lot. See the Events page for more details.
lr-data-output block
If you used lr-data-output block to handle HTML forms,
now you need to use lr-form-input block.
See the HTML Forms page for more details.
If you used lr-data-output block to handle groups,
now you need to use lr-upload-ctx-provider events.
See the Events page for more details.
If you used lr-data-output block to handle console debugging output,
now you need to use debug attribute on lr-config.
See the Options page for more details.
lr-message-box block
This block is removed.
Now validation errors are shown inside the File Uploader UI.
If you used lr-message-box block inside your custom templates -
you need to remove it.