Opened 6 years ago
Closed 5 years ago
#18564 closed defect (patchwelcome)
dojox/date/timezone causes synchronous XMLHttpRequest warning
Reported by: | tupton | Owned by: | Adam Peller |
---|---|---|---|
Priority: | undecided | Milestone: | 1.13 |
Component: | Dojox | Version: | 1.10.4 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
This is somewhat related to #18468, but I wanted to be a bit more specific.
If you load dojox/date/timzone
in your app, even with async: true
in your dojoConfig
, the timezone data files are still loaded with a synchronous request.
See the code here.
I put a conditional breakpoint in the relevant code in request/xhr
to break when async
is false. It was false when loading timezone config files, and the stack trace pointed to the request in dojox/date/timezone
above.
NB I reproduced this is in an "unbuilt" app; that is, only the dojo base is loaded with the page and everything else is loaded dynamically.
You can actually see this with this simple jsfiddle that loads dojo, sets async: false
in the fiddle options, and loads dojox/date/timezone
. The console will be full of errors about loading the actual timezone files, but if you scroll up to the top of the console output, you can see the warning about synchronous requests.
Change History (5)
comment:1 Changed 6 years ago by
comment:2 Changed 6 years ago by
Your description makes sense to me. It looks like it would be a lot of work to fix though, and perhaps would require changing the API. I checked those data files and they are pretty big, so I understand why they are loaded on demand.
comment:3 Changed 6 years ago by
I understand why they are loaded on demand.
I do, too. I don't know why they have to be forced to be loaded synchronously though. Wouldn't they still be able to be loaded on demand and asynchronously? Apologies if I misunderstand what you are saying.
comment:4 Changed 6 years ago by
Oh, because if they were loaded on-demand but asynchronously, then you couldn't have API's like dojox.date.timezone.getTzInfo() that synchronously return info about a given timezone.
comment:5 Changed 5 years ago by
Milestone: | tbd → 1.12 |
---|---|
Resolution: | → patchwelcome |
Status: | new → closed |
Given that no one has shown interest in creating a patch in more than a year, I'm closing this as patchwelcome. Please let us know if you would like to get involved in helping make this change to Dojo!
I just built the app and the same issue arises, so it looks like that has no bearing on the issue.