Re: [whatwg/xhr] Abandon hope of removing sync XHR from the web platform? (#20)

I have heard the arguments, some religious, and up until a few months ago, I would have agreed that there really isn't a need for `async: false`.   But then in the process of removing the last entanglement requiring server rendering of the base DOM and layout by PHP for the app I work on, I happened upon a very real use case.  

During my app's initialization it uses an XMLHttpRequest with async:false to pause all scripts from loading while it fetches application options and current user context information.   This information was previously bootstrapped into the page by the php layout and much of the UI code uses information in the context data in static initializers or other ways that assume it is available at time of script load.  

I've tried reworking the code to make the api call to get the context information async and then dynamically generate script tags to load the remaining scripts that depend on this data being set.   The result was much slower page load times stemming mostly from the browser not caching the scripts loaded via dynamically generated script tags.  :(

I sure hope that it's just an idle threat to remove async:false.   

BTW, I also think it's just a little pretentious to assume that you understand my user's experience needs better than I do.  Just a little.   



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/xhr/issues/20#issuecomment-318703369

Received on Friday, 28 July 2017 16:42:27 UTC