-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Synchronous XMLHttpRequest on the main thread is deprecated #2384
Comments
set the We will have to consider whether we change our default options. |
I think this is the only choice... :( But for me, the bad thing about this is the FOUC. I was wondering if there was a browser flag to re-enable it because both Firefox and IE are switching to async=true and it's terrible for developing... |
I don't know. I personally never use less in the browser - I use |
That's sad since I can't. |
I am also getting the same error. To change async is true, I am using ajax in javascript. Could you please suggest anything to avoid this error? |
The aysnc option we are talking about is the one in less see http://lesscss.org/usage/#using-less-in-the-browser-options |
There should be no reason Less needs to block the thread from loading additional assets. If it's done to prevent FOUS (flash of unstyled content), the less.js file can immediately inject a style declaration of |
@matthew-dean Good point. If we could avoid it and get a "Styles ready" event it would be ok. |
…tyles are done / The actual XHR requests are changed to async for a speed boost for "sync" loading of orders of magnitude
I've fixed this issue pretty much exactly the way I suggested. Just needs code review for merging. Btw, for me, changing the sync XHR to a "fake sync" (preventing FOUC) changed the render time for my stylesheets from 7-10 seconds to somewhere around a second. So, quite an improvement. |
Thanks! |
Where do you make async=true ? I am not using less. |
Fix for #2384 and caching enabled with modifyVars set
@matthew-dean any ETA for the release ? Thanks. |
@nitriques This is already released. "async" is no longer applied to the XHR request. Instead, it controls whether the page displays before or after the style sheet is created. |
When running less.js in Chrome Canary (39.0.2171.95) I get a warning in the console
We are running into the same problem in Firefox and IE: there is a big FOUC while less is downloading files.
Is there a way to prevent this ? I understand the rationale of the deprecation, but for devs, it's still needed...
The text was updated successfully, but these errors were encountered: