-
Notifications
You must be signed in to change notification settings - Fork 26
FileLoader now accepts Promise instead of a File instance #88
Conversation
All new promises in API docs can have the |
thanks for tip @ma2ciek |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use more of the Promise
features both in tests (mocha nicely play with them) and in the code. Using Promise.resolve()
will shorten the code a bit.
Also I've found some ugly stuff from the past (FileLoader
constructor docs) which would be nice to clean up also.
ps.: Shouldn't we also update CKFinder Uupload adapter?
Looking at this line: data.append( 'upload', this.loader.file ); I think we should 😄 Strangely, all unit tests are passing 🤔 |
I have rechecked ckeditor/ckeditor5-easy-image#22 and ckeditor/ckeditor5-image#258 branches after refactor and updated |
Suggested merge commit message (convention)
Fix:
FileLoader
now acceptsPromise
instead of aFile
instance. Closes ckeditor/ckeditor5#2839.BREAKING CHANGE: The
FileLoader.file
property was changed to a getter which returns a nativePromise
instance instead of aFile
instance. The returned promise resolves to aFile
instance.Additional information
See ckeditor/ckeditor5#2839 for technical explanations what was changed.
This change also required some updates in
ckeditor5-image
andckeditor5-easy-image
plugins (because of a change in howloader.file
works and it's async nature):ckeditor5-image
PR: Tests: Adjusted tests to changes in upload plugin ckeditor5-image#258.ckeditor5-easy-image
PR: Small adjustments for changes inupload
plugin ckeditor5-easy-image#22.ckeditor5-adapter-ckfinder
PR: Small adjustments for changes inupload
plugin ckeditor5-adapter-ckfinder#13.