grammarkdown icon indicating copy to clipboard operation
grammarkdown copied to clipboard

Investigate dropping synchronous API

Open rbuckton opened this issue 4 years ago • 4 comments

To simplify the internals of grammarkdown, I'm considering dropping the synchronous APIs such as SyncHost, parseSync, bindSync, checkSync, etc. However, doing so would have a significant impact on tools such as ecmarkup.

@bakkot: If I were to make this change, ecmarkup would need to make the walk and lint functions asynchronous. If necessary, I can create a PR against ecmarkup that does this in advance of this change. The walk function shouldn't be too much trouble because its only called by itself and Spec.prototype.build (which is already async), though I haven't investigated the impact it would have on lint.

If there are scenarios that you believe would be a blocker for me removing the synchronous APIs, please let me know. If there are no blockers, I would plan to ship this change with a semver-major bump to 3.0.0.

rbuckton avatar Sep 21 '20 20:09 rbuckton

I think the change to ecmarkup would be straightforward, and I don't have other use-cases in mind which would require it to be synchronous. Go for it.

bakkot avatar Sep 21 '20 21:09 bakkot

I've shipped 3.0.0-beta.0 which has the async-only API, plus cleans up a number of other obsolete methods.

rbuckton avatar Sep 22 '20 02:09 rbuckton

This seems to be done now, though I note that the docs still talk exclusively about bindSync and friends.

bakkot avatar Nov 19 '20 00:11 bakkot

I have a few outstanding things to clean up before I close this, but yes its mostly done.

rbuckton avatar Nov 19 '20 06:11 rbuckton