-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Reducing JS dependency for Presentation #5173
Comments
Moved this to 1.4 since we're going to tackle bigger CSS and HTML changes there. |
not sure if i fully understand this, but i strongly support it ;-) despite the really sexy UI, the overall performance hit makes jQM an irresistible hooker you barely can afford. there seems to be a contradiction: the heavy use of javascript to serve older hardware not only slows down older hardware tremendously, it also makes current hardware unresponsive, this will fade away in some years, when the performance of mobiles quadrupled. in google chrome for desktop the responsiveness is perfect. but until then: please drop the use of javascript for page-init and initial decoration AS MUCH AS POSSIBLE. browser css styling seems to be much faster than cycling the dom with JS, applying classes - when the browser would already be finished. |
a real world example: the site, basically a listview with 30 entries and a menu on top. samsung H1 running megoo linux. top notch hardware 2 years ago. on this hardware the site is a bit laggy but still usable. on a iphone 3gs it's fast and responsive. than a change to jQM. looks much, much better. much easier markup for much hotter widgets than before. great! thanx a lot guys! the downside: on the samsung phone everything still looks good, but it's so slow that it's almost not usable anymore. on the iphone you suddenly have to wait for everything. i changed to lab.js which loads .js files in parallel with html. now i have the " flash of unstyled content". what's interesting, you can see how fast the browser is and how slow jQM. no matter if only the small login form or the long list-view: -the page, styled with css gradients and box-shadows and everything css can offer, appears very quickly. -then jQM kicks in, the page goes blank and you WAIT WAIT WAIT WAIT and finally you see the page. and when you start scrolling immediately you realize that jQM is still working. it just doesn't feel good. the point: the iphone browser can display complex css styled content very quickly, but styling with JS makes it look old and poor. so yeah, go for Reducing JS dependency for Presentation |
I complety agree with pillex. This is not necessary, Bootstrap works very well and its way more speedy. Though I really like the project (listviews, truncation, panels, etc), and the possibilities I would only recommend using JQM for simple sites, unless this is solved. |
Here is an update. Reducing the markup has been tackled in branch "next" which we will merge into master soon. Especially There are still some widgets that need a wrapper that also has the classes for presentation. We will work on an option that allows users to not have the framework generate the wrapper so users can add the wrapper including classes in their markup. We discussed styling against data- attributes, but that isn't possible because we support namespacing. Wrapping our CSS in a media query instead of running a support test sounds like a good plan. This would also resolve this problem: #6057 (comment) |
Because we need to test pseudo class support and support IE8 as A-grade we can't use a media query at the moment. Closing this ticket as fixed. |
In the first (and current) version of the framework, we used a combination of data attributes and JS feature testing to ensure enhancements – both JS and CSS – were not applied in unqualified environments. This allowed us to leave C-Grade environments un-enhanced, and usable, both visually and behaviorally. The gist of it was we'd apply a data attribute to an element, say
data-role=listview
, and in JS, we'd run our baseline feature qualification of CSS3 Media Query support, and in supporting environments, we'd add classes to that element that the CSS would style (and also add behavior with JS at that point too).Fortunately, we've found better ways to qualify CSS application since then. One simple way is to just qualify the CSS itself by ensuring it is always wrapped in an inline media query (or a
media
attribute on thelink
element).@media only all
is a media query we can use to say, "if media queries are supported," within CSS itself:or...
If we take that further, we would ideally have styles that are written against markup attributes that are already present when the markup is delivered, rather than having to wait for them to be added through JS. This is typical of custom web development patterns, but has been harder for us to do in a framework setting due to the complexity of some of the markup our components use.
This should be addressed in a couple of ways: both by simplifying the markup for our components so that they're easier to serve directly from the server-side, and considering choosing either classes or data attributes as our mechanism for configuring widgets - but not both. And then styling against one or the other from the start.
The text was updated successfully, but these errors were encountered: