v3.0.0
- π¦ Packosphere
@3.0.0 - βοΈ AtmosphereJS
@3.0.0 - β¨ Refactored files.veliov.com demo app and its π¦ source code
Summary
- β¨ Refactor: Hook options:
protected,onBeforeRemove,onAfterRemove,onInitiateUpload,onAfterUpload,namingFunctionare now async - π€ Refactor: Compatibility with
meteor@3and other modern packages - βοΈ Refactor: Match
FilesCollectionAPIs with new*Asyncmethods ofMongo.Collection; Deprecate callback APIs on the Server - π¨βπ» Refactor: Utilize node's async APIs where suitable
- π¨βπ» Refactor: Improve pause/resume logic on connection interruption/reconnect
- π Docs: Updated and refactored docs with better examples
- π Docs: Refactored JSDoc matching definitions in TypeScript
- π€ Dev: Improved TypeScript support
- π·ββοΈ Dev: Improved debugging logs
- π¨βπ¬ Tests: Improved test-suite
- π·ββοΈ Git: CI GitHub Action Workflows for lint and build tests
Contributors
Special thanks to: @bratelefant @harryadel @jankapunkt @StorytellerCZ @make-github-pseudonymous-again an other contributors who helped to build and pushed v3 release forward
Major changes
FilesCollection:
β οΈ FilesCollection#remove()β deprecated on server, useFilesCollection#removeAsyncinsteadβ οΈ FilesCollection#findOne()β deprecated on server, useFilesCollection#findOneAsyncinsteadβ οΈ FilesCollection#unlink()β deprecated on server, useFilesCollection#unlinkAsyncinsteadβ οΈ FilesCollection#write()β deprecated on server, useFilesCollection#writeAsyncinsteadβ οΈ FilesCollection#load()β deprecated on server, useFilesCollection#loadAsyncinstead
FileCursor:
β οΈ FileCursor#remove()β deprecated on server, useFileCursor#removeAsyncinstead
FilesCursor:
β οΈ FilesCursor#remove()β deprecated on server, useFilesCursor#removeAsyncinsteadβ οΈ FilesCursor#hasNext()- deprecated, useFilesCursor#hasNextAsyncinsteadβ οΈ FilesCursor#count()- deprecated, useFilesCursor#countDocumentsinsteadβ οΈ FilesCursor#countAsync()- deprecated, useFilesCursor#countDocumentsinstead
FileUpload:
β οΈ FileUpload#start()is now async!- β¨ New
FileUpload#remainingTime{ReactiveVar} with upload remaining time in human-readable format
Callbacks and hooks:
β οΈ Anywhere:this.user()is deprecated, usethis.userAsync()insteadβ οΈ Client:FileUploadnow always triggersendeven in the case of successful and failed uploads; Before:endevent wasn't called under certain conditionsβ οΈ Client: All errors appeared during upload in all hooks and events ofFileUploadare now instance ofMeteor.Error; Before: Errors had mixed type or were simply textβ οΈ Client: Errors are the same now (type, code, text, reason, details) within DDP and HTTP protocols; Before: DDP and HTTP protocols had different errorsβ οΈ Client: The next private events were removed fromUploadInstanceClass:upload,sendEOF,prepare,sendChunk,proceedChunk
New methods
FilesCollection:
- β¨ Client:
FilesCollection#insertAsync() - β¨ Anywhere:
FilesCollection#updateAsync() - β¨ Anywhere:
FilesCollection#removeAsync() - β¨ Anywhere:
FilesCollection#findOneAsync() - β¨ Anywhere:
FilesCollection#countDocuments() - β¨ Anywhere:
FilesCollection#estimatedDocumentCount() - β¨ Server:
FilesCollection#unlinkAsync() - β¨ Server:
FilesCollection#writeAsync() - β¨ Server:
FilesCollection#loadAsync()
FileUpload:
- β¨ New
FileUpload#remainingTime{ReactiveVar} with upload remaining time in human-readable format
FileCursor:
- β¨ Anywhere:
FileCursor#removeAsync() - β¨ Anywhere:
FileCursor#fetchAsync() - β¨ Anywhere:
FileCursor#withAsync()
FilesCursor:
- β¨ Anywhere:
FilesCursor#getAsync() - β¨ Anywhere:
FilesCursor#hasNextAsync() - β¨ Anywhere:
FilesCursor#nextAsync() - β¨ Anywhere:
FilesCursor#hasPreviousAsync() - β¨ Anywhere:
FilesCursor#previousAsync() - β¨ Anywhere:
FilesCursor#removeAsync() - β¨ Anywhere:
FilesCursor#fetchAsync() - β¨ Anywhere:
FilesCursor#firstAsync() - β¨ Anywhere:
FilesCursor#lastAsync() - β¨ Anywhere:
FilesCursor#countDocuments() - β¨ Anywhere:
FilesCursor#forEachAsync() - β¨ Anywhere:
FilesCursor#eachAsync() - β¨ Anywhere:
FilesCursor#mapAsync() - β¨ Anywhere:
FilesCursor#currentAsync() - β¨ Anywhere:
FilesCursor#observeAsync() - β¨ Anywhere:
FilesCursor#observeChangesAsync()
New features
- β¨ Client:
FileUpload#remainingTimeReactiveVar β returns remaining upload time inhh:mm:ssformat;
Other changes
- π Bug: Fixed #885 β Upload empty file now
endupload with error - π Bug: Fixed #901 β Caused by #894
- π§ Security: Fixed #894 β now
x_mtokcookie is set withsecureandhttpOnlyflags - π§ Refactor: Fixed
FileCursor#withimplementation - β¨ Refactor:
FileUpload#abortis nowasync - β¨ Server:
FilesCollection#addFileis now async - β¨ Server:
FilesCollection#downloadis now async - β¨ Server:
WriteStreamClass is now available for import - βοΈ Client:
disableUploadoption processed on the client and returns error in theend/errorevents, andonErrorhooks. Before β throws an error upon calling.insert()method
Dependencies
release:
eventemitter3@5.0.1, was4.0.7- removed:
abort-controller, now using nativeAbortController - removed:
fs-extra, now using nativefs
dev:
- added:
chai@4.5.0 - added:
sinon@7.5.0