5 ms·
Please do not use this. This will block incremental rendering in a browser. http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/#Global_and_increme
by TeeWEE 12y ago
Please do not use this. This will block incremental rendering in a browser. http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/#Global_and_incremental_layout http://www.html5rocks.com/en/tutorials/internals/howbrowsers...
The way TopLevel works, is by getting the complete HTML content, putting it trough a javascript parser, and then rewriting it using document.write.
So this requires all content to be downloaded first, and the toplevel.js to be loaded, before a page can be displayed properly. This breaks all the improvements made in browser, and would significantly slowdown page use.
Also, its completely non standard, and a mis-use of js.
Nice hack however ;-)
- kristopolous 12y agoLet me respond paragraph-by-paragraph: --- 1. Blocks incremental rendering? Indeed ... for people not TeeWEE, "incremental rendering" means say a 2MB HTML file will be partially rendered prior to the entire payload being transferred. That is no longer the case here. 100% true. As an aside, I'll think hard about how to overcome this. --- 2. The description of how it works? Correct. Very succinct. Good Job! --- 3. Significantly slow down a page? This depends on the page. If it's a small-footprint HTML page which leverages templating, then the base page will be quite small. If the design previously loaded unneeded dependencies which were only applicable to a subset of users, then this provides a very easy way out without requiring lots of technical knowledge - and probably a good speedup to boot. As far as actual tests, I've refactored a number of personal projects with this library, and the time to where the spinner stops (if I load the two versions side by side) isn't noticeable through my eyes. I can't honestly tell which one is which. --- 4. A "mis-use of JS"? It's certainly non-canonical - but I'd argue that many "standard" common practices got their start being just as heretical and then were later replaced by standardized ceremonial ways of doing things.
- EdSharkey 12y agoYou silly creature, I love you!
- thathert 12y agoRe: 1. Have you considered something like an isomorphic approach to optionally preprocess the HTML on the server side?
- swalsh 12y ago4. A "mis-use of JS"? It's certainly non-canonical - but I'd argue that many "standard" common practices got their start being just as heretical and then were later replaced by standardized ceremonial ways of doing thing ---------------------------------------- I can't tell you how many hours of time I've wasted on non standard "Standard" things simply because it saved some other guy 20 minutes in time somewhere else. It's a nice hack, but let's leave it at that.... try to improve your resume with other methods.
- ericclemmons 12y agoThat was uncalled for.
- kristopolous 12y agohey, that hurt my feelings. :-(
- pron 12y agoI think pretty much everything you're saying could be said about Angular, too.