Thanks for the criticism, @PMario. I do understand what you are saying; I've already begun to fix much of this. I intend to include the styles as a stylesheet (as opposed to inside the JS), and apply changes that way.
On Wednesday, August 25, 2021 at 12:16:13 PM UTC-4 PMario wrote: > Hi Finn, > I appreciate your enthusiasm. .. BUT .. The implementation of this plugin > is a hack from front to center. You use .innerHTML to change the DOM that > has been created by tiddlywiki, with a timer that runs every second. Not > only is .innerHTML a potential security risk > <https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML#security_considerations>, > > it ruins the TW refresh mechanism and adds a lot of unnecessary CPU load to > the browser. > > Everytime we click a button. TW redraws and restyles the different > elements that are changed. ONLY those elements are changed, to make the > mechanism fast. The browser has to do that, using the existing TW CSS and > apply the styles. > > Every second your plugin comes along and replaces the whole CSS with a > 400kByte CSS form a CDN. Hardcore replaces DOM elements the TW core has > drawn and restyles the complete page. (That's where the blinking of the > whole UI comes from. ) > > The most problematic thing is, that the whole thing completely breaks down > in offline mode, or if you have a bad internet connection. > There is an easy test: > > - Go to the dev-console on your page F12 > - Select the Network tab > - Search for the "No throttling" dropdown > - Select "slow 3G" > - Select Disable cache which is directly next to it. > - Then reload your page. > > It will need at least 10 seconds to load the page. .. Now guess, how long > it takes if you use the wiki _offline_ > > The core developers do everything to make the user experience fast. There > is a lot of internal caching going on, to keep the page redraw as fast as > possible. > The way it's done in the plugin won't work. It may be ok for empty.html, > but once the wiki gets bigger there will be a lot of problems. > > Try to download the whole wiki from tiddlywiki.com and drag & drop import > it into your wiki. ... See what happens. > > Sorry but theming TW has to be done in the TiddlyWiki way. > > I'm probably too harsh with my critiques, but please go to google and > search for ".innerHTML security" and read some of the articles that come up. > Also have a closer look at the "<styles>" element, how it works and what > it means for browser performance when a complete redraw is forced. > > -mario > > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/dfba4faa-da7f-4580-9baf-3a0f47c22990n%40googlegroups.com.

