Comments (5)
Got a huge win by using 'insertRule' in production, anywhere from 10-2000x.
from glamor.
Any ideas on recovering unused rules? I like to write css as a function of state like state => style({ color: state.color })
but this has potential to create a bunch of unused rules.
My idea is to keep track of what elements are actually using the rules and discard those rules if they aren't. We can do this with mutation observer, it would keep this library from being react specific which could be nice. But it may be pretty shitty for performance so needs some tests. I can look into it if you want to head in this direction?
from glamor.
There's an experimental keyed(key, style)
that reuses rules with the same key, that might help. That said, I thought a bunch about removing unused rules, and it didn't make much sense to me for css (and is really hard to implement right, especially when using in shared environments).
Some more thoughts here #1 (comment) and I'll be validating some of those theories here #13
from glamor.
perf is 'mostly solved' over the last few releases. closing.
from glamor.
@threepointone as a newcomer, I am really interested to see some info what to expect performance wise (compared to plain CSS). I see there is a placeholder for that in the docs but it appears to be empty. Some benchmarking would be even better.
As migrating existing project to Glamor is a big investment, it would be reassuring to know what to expect.
from glamor.
Related Issues (20)
- css.global doesn't support hover?
- Font Face Multiple Font Support HOT 1
- Promote css prop with react usage
- Deleting rules from the stylesheet
- Calling css({'data-css-nil': ''}) throws unexpected error HOT 1
- glamor-skeleton help
- psudeo element: scrollbar is not working
- Server-side rendering styles from a third-party library
- Values for the non-standard properties being set as numbers becomes as string with `px` concatenated in output HOT 4
- When NODE_ENV=production hydratation is broken
- Missing .d.ts for "glamor/server" HOT 1
- Outdated index.d.ts published HOT 1
- babel 7 support
- how to use -webkit-line-clamp HOT 1
- How to change src when the img hover ?
- Speedy mode is harmful for some production use cases (f.e. server-side rendering, prerendering, especially when glamor used in the library, etc)
- Generate inline style attribute text. HOT 3
- FBJS library causing vulnerability HOT 1
- className did not match
- update to a maintained `through`?
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 glamor.