GithubHelp home page GithubHelp logo

Performance about jss HOT 10 CLOSED

cssinjs avatar cssinjs commented on April 27, 2024
Performance

from jss.

Comments (10)

kof avatar kof commented on April 27, 2024

Browser needs to check less css rules when adding elements to the dom.

from jss.

trusktr avatar trusktr commented on April 27, 2024

@kof But you lose the styles you detached? What am I missing? Do you reattach after adding elements?

from jss.

kof avatar kof commented on April 27, 2024

if you elements need your styles they need to be attached of course, don't understand the confusion.

from jss.

trusktr avatar trusktr commented on April 27, 2024

@kof I thought maybe there was something I was missing. It's like saying "Don't add any DOM elements to your page and it will perform better." :P

from jss.

kof avatar kof commented on April 27, 2024

Its about having styles for dom elements which use them. Not more not less. And yess less dom elements results in better performance.

from jss.

trusktr avatar trusktr commented on April 27, 2024

Ah I see the use case: when you have an html component, attach a stylesheet when the component has been added to the DOM, remove the associated stylesheet when the component is removed from the dom, so your styles morph in sync with your DOM structure. This is unlike the current approaches where all styles simply exist at all times regardless of what the DOM looks like. +1 I get it now. I think you're imagining something like that. :D

from jss.

trusktr avatar trusktr commented on April 27, 2024

This is interesting. See what type of problems the w3c spec has gotten us into? Cascading stylesheets seem to be a source of poor performance. At my job, in one of the older apps, the stylesheet is monolithic, with various routes of the app relying on overrides/cascades, and or just ignoring the existing classes and using all new ones for completely separate styles that exist in the same monolithic stylesheet.

And why does traditional HTML/CSS/JavaScript make it so difficult to make apps that feel "native"?

This why things like Famo.us and your awesome jss come into existence: to avoid the pitfalls of traditional HTML5/CSS/JavaScript. Instead of just creating components using traditional HTML from the get go, we are rethinking the whole way that things should work in the first place to get around the pitfalls of traditional HTML.

Thinking in more of a bigger picture, the actual redesign needs to happen in the underlying implementation of the browser, but that's a huge undertaking. I wish I could just snap my fingers and have QML-like performance in HTML. (try QML at least once if you haven't, it's free, and compare it to HTML. You might be amazed!)

from jss.

trusktr avatar trusktr commented on April 27, 2024

A little off topic, but maybe not in the grand scheme of things: A browser that would allow users to browse both QML-based and HTML-based sites might be revolutionary.

from jss.

kof avatar kof commented on April 27, 2024

Neither html nor css is designed for applications. I am pretty sure any of systems are better for this than what we use. However with right abstractions it can deliver good performance.

from jss.

kof avatar kof commented on April 27, 2024

I would be glad to see your findings about jss written down in a blogpost :)

from jss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.