Open iShafayet opened 6 years ago
It'll be a bad decision if other parts are disabled until the conversion is complete. So, I'm adding parallel support for both the legacy callback based workflow, as well as the new async workflow.
For this, I've added the 'legacy' prefix to all callback based APIs and Collections. The Router and server will now support both the legacy apis and async based apis in perfect harmony.
I will of course, have to rewrite all the collections as the async approach is from root to leaves. However, the server will continue to work even before all (or any or some) of the APIs have been converted to async. That way, code duplication will be kept minimal.
All the collections have been rewritten as Async.
All the components have been rewritten as Async.
Pending are the APIs and Api Base Class.
After a lot of experimenting, I have come to realize that using async, our workflow can be made much more simpler and smoother.
I'll update this thread with progress on the conversion.
Additional features to implement (alongside the conversion) -
Api.mixin(...)
)id
instead ofuserId
orsessionId
when referring to the id of own documents in a collection.onInsert
,onUpdate
andonDelete
hooks for collections to maintain database integrity.~ (Will not be handled in this task)Collection#checkIntegrity
method that can be called to ensure all the documents comply to thejoiSchema
(i.e. from server using a command line parameter)Inventory#productList.productId
toProductCategory
and so on)