Automatic Migration from Synchronous to Asynchronous JavaScript APIs
summary
A static-analysis refactoring converts synchronous I/O to async/await where safe, implemented as Desynchronizer and applied automatically to 12 projects with 316 sync API calls; it flags 256 candidates, actually rewrites 244 without tests breaking and produces 12 detectable behavioral changes tied mostly to call-graph unsoundness. Rewrites add await and propagate async through callers, sometimes wrapping files in an IIFE; constructors and promise-returning functions are skipped.
AI-written summary · about
chapters (16)
- 0:00Start
- 0:16A bit of background...
- 0:47Asynchronous APIs
- 3:04Async/Await to the rescue
- 4:07Goal
- 4:213 Step Approach
- 5:08Identify Transformation Candidates
- 6:20Discard Unsupported Transformations
- 7:29Transform source code
- 8:45We built Desynchronizer!
- 10:15Evaluating Desynchronizer
- 10:50How many transformations are proposed by Desynchronizer?
- 11:47The technique is potentially unsound. How often does unsoundness manifest itself in practice?
- 12:38What is the impact of refactoring on the performance of applications?
- 13:32How long does it take to apply Desynchronizer to an application?
- 14:27Takeaways
related talks
14mThe Promised Path to Async, Awaits
43mAvoid the headaches – make your asynchronous code look synchronous!
48mAsynchronous JS without the cringe
26mRethink Async
58mOptimizing Synchronous Asynchrony
46mAsynchronous JS Without the Cringe
41mNext Generation Asynchronous Patterns in JavaScript
21mAutomating Front-End Refactoring
