Giter VIP home page Giter VIP logo

Comments (4)

lttb avatar lttb commented on May 19, 2024 1

Hi @s0kil, thank you very much for the request!

Yeah, I think it's really important to extract styles also with svelte, and I don't see any problems with it at all (the same trick as with webpack should work out of the box)

So I think I'll have a chance to make it today/tomorrow

And thank you for the link to the nano-css, looks really interesting!

I also thought about insertRule and made some experiments with such implementation, but found the whole <style> insertion a bit more effective (as a separate tag, without previous changing, just because of the specific reshadow implementation we don't insert any rules during the runtime, only for the first time on initializing if styles were not extracted), and reshadow runtime also has quite effective caching by generated hash.

But I think about runtime mixins too and how they could be extracted and optimized, and mixins implementation probably should be with CSSOM

from reshadow.

lttb avatar lttb commented on May 19, 2024 1

@s0kil, I've made some benchmarks comparing with nano-css with styled-interface: https://xggtc.sse.codesandbox.io/public#nano-css-styled (production build)

and the difference on 100 boxes is quite big (ms):

reshadow reshadow-runtime reshadow-styled nano-css-styled
69 77 115 573
50 58 81 1457
22 38 56 2348
22 29 64 3418
21 36 58 4320

I think that there are some things that could be optimized in the example for nano-css, but the idea was to try the interface and solution as is

from reshadow.

s0kil avatar s0kil commented on May 19, 2024

Another suggestion for runtime performance: cache all styles for re-use and inject CSS using .insertRule()

from reshadow.

s0kil avatar s0kil commented on May 19, 2024

@lttb Looks great, but we still got to get them static styles out of the JavaScript bundle.
Not everyone can afford supercomputers to parse JavaScript bundles (:

from reshadow.

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.