conf
conf copied to clipboard
Async Migrations
Given that many other libraries are moving to providing async only APIs the fact that migrations cannot be (reliably) an async function (IMO) is detrimental since moving from sync -> async is a non-breaking change for the migrations type but there is no (sane) way to guarantee an async migration is run to completion before the rest of the application starts doing its work.
What kind of migrations are you doing that requires it to be async?
Specifically I want to use this library https://github.com/sindresorhus/file-type (which I literally just realized is also by you, thanks!!)
Namely, the conversion from a path to storing something within the store (along with its MIME type)
There's, unfortunately, no way to make the migration be async without making every single conf
method async too, which won't happen in the near term, if ever.
That being said, I made this for you: https://github.com/sindresorhus/make-synchronous
Thank you for the new package. I can completely understand the magnitude of converting conf
to async.
there is no (sane) way to guarantee an async migration is run to completion before the rest of the application starts doing its work
In a similar package to this, but for web extensions, make every get/set call await the migration promise. At least 80% sane IMHO?
In your case you could do the same, await the migrations before the app is "ready". A lot of apps do that, for example Apple Photos (Mac) and LINE Messages (iOS)