Login Register

custom Dijits seem slow

Dijits strike me as being really slow, I always get a flash of misformed content before the javascript in the dijit code has finished executing or I get a flash of a page with no content if I'm using dijit templates and then suddenly the dijit(s) appear. Even with custom dijits that have very little code. It always takes a visible moment before everything has rendered correctly and it looks ugly during that moment. I am using dojo.addOnLoad to start execution, and I am also using a custom build.

the flash of unstyled

the flash of unstyled content is because of the template replacement stuff going on ... I think you showed me a link to the page in question in #dojo just now as well, and my advice would be to use pure dom stuff in this limited case on the initial load, and do all of your behavior stuff manually. eg: put an [input] in the DOM rather than a [div dojoType], which eventually gets turned into an [input] (that's the "flash") ... then, unknown to the user, do some templating stuff hidden so when they interact with the input (which is rendered from the get-go), use your widgets there.

you're hovering right on the line of progressive and widgeted behavior, and it sounds like you should be doing more 'manually' than relying on the templating to be there on page start. I would fall back to the progressive in this case. The full widgeted solution involves using some kind of preloader to hide the page in it's entirely until rendered, but that seems overkill for a single input.

hope this helps.

Regards-
Peter Higgins