Comments (4)
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.
@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.
Another suggestion for runtime performance: cache all styles for re-use and inject CSS using .insertRule()
from reshadow.
@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)
- TypeError: Cannot convert a Symbol value to a string when I run jest test some components HOT 2
- Hi. I make screenshot test for ReactComponent with @reshadow, but html element don't have style, but in browser everything ok. HOT 6
- Unable to customize css tagged template with string expressions HOT 1
- Selectors starting with colon can be handled incorrectly
- :focus-within doesn't work without :global
- [runtime] Support dynamic variables fallback
- [webpack] support 'module.css' postfix
- TypeError: Cannot convert a Symbol value to a string HOT 2
- Hi guys. Is this project being developed and supported? I really like your idea. HOT 2
- Error with Vue 3 and @vue/babel-plugin-jsx HOT 2
- @reshadow/core `create` function `use` variable name mistype
- reshadow/postcss: up settings HOT 1
- Release error
- support dot in attribute value
- Analysis: 100% of dependency updates in this repository can be merged. HOT 1
- "as" property conflict
- styled function signature for typescript-styled-plugin compatibility
- Typescript typings for reshadow/macro HOT 1
- [svelte] preprocesser overwrites `this` attribute in an `<svelte:component />`
- [svelte] preprocesser adds unnecessary classes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reshadow.