🥳 CSS functions have arrived!!! 🥳
And they are *AWESOME*
Now, you can do things like this:
@function --alpha(--color, --opacity) {
result: rgb(from var(--color) r g b / var(--opacity));
}
div {
background: --alpha(red, 80%);
}
(*arrived = in the latest stable Chrome)
It was always more than about performance. I started Solid because I liked the mental model of Knockout more than React. Retained mode fit with the DOM better than this immediate mode abstration that React put out there. I needed to focus on performance initially to undo the damage caused by DOM slow, VDOM fast. A lot of benchmarks looked at diffing speeds when diffing wasn't what users primarily need to be doing.
This starts pre-React Hooks. React adopted this language later and honestly for some people on this side of things that was enough. But it became more obvious just how different these these things end up being.
The key difference is React conflates state with UI organization. On change of state the declared body (and descendants) need to re-run if things change. With Signals it is only the computations that need to re-run. It looks similar but it means that state runs through components rather than are the components.
I do think there is some preference here. I'm not saying everyone will find Signals better fit for their mental model. But we shouldn't be just suggesting it's a performance thing.
People will point to this run-once mentality being simpler to understand once there are multiple isolated states involved, but the real power is that you can describe more complicated states in a hoisted manner and have isolated updates. If something changes in a complex data structure in React it has no choice but to re-run all the way down that UI tree. Memoizationn can prune branches but it needs to run all the way from declaration to usage. Yes Signals need to run along their portion of the graph but that is scaled on the derivation of the data not the UI.
More so if your application is data dependency aware it opens up different sorts of problem space solutions. Granular partial Hydration/Resumability. I was hired at eBay because they recognized the importance of being able to separate the state from the UI which could stay on the server. My recent research has been into self healing graphs and granular derivation. These are areas where we will see tangible differences when it comes scaling of larger granular/incremental data systems. Things like sync engines.
I'm glad that @ryanflorence is asking these questions because these are common thoughts, and it provides an opportunity to refine education in these areas, because unlike React the communities here smaller and have had less time to really refine the message.
My read on the React alternatives is their primary selling point is better performance through alternative dependency tracking approaches
When I look at the APIs they look identical with mostly identical semantics
- state thing
- effect thing
- elements
What am I missing?
Firefox 126.0a1 does indeed support transitioning `@property` variables 🎉
funny, cuz just today I made an progressively enhancing @property example, and yep, works great in Firefox Nightly!
codepen.io/argyleink/pen/LYv…
Wake up, wake up, wake up!
@FirefoxNightly finally supports animating custom properties (registered via `@property`)! 🥳🎉
For the past 6-7 years, I have made ~200 such demos on @CodePen and they should now work in Firefox Nightly!
codepen.io/thebabydino/pens/…
ALT Screenshot of a bunch of such demos animating custom properties in my CodePen profile.
🚨🚨🚨🚨
Apple will NOT remove PWA support on iOS
🥳🥳🥳🥳
👉This is an official statement form Apple that replaced today the previous excuses published around the removal.
We did it, folks!
By the end of 2024, you’ll likely never need these APIs again:
• useMemo, useCallback, memo → React Compiler
• forwardRef → ref is a prop
• React.lazy → RSC, promise-as-child
• useContext → use(Context)
• throw promise → use(promise)
• <Context.Provider> → <Context>
🤯 Today I learned about the media scripting feature. It's about detecting JS support via a CSS media query.
Soon, we won't need the `.no-js` or `.js` classes once this is widely available. Currently supported in Chrome 120, Firefox 119, Safari 17.
@merittthomas Hi, I came across Epic Easing epiceasing.com/ and noticed it's adding needless prefixes.
Opera & Firefox unprefixed transitions back in 2012, over a decade ago.
Global usage for pre-Chromium Opera that needed the -o- prefix is now 0%.
🎉 Announcing MSW 2.0! 🎉
🌎 Migration guidelines: mswjs.io/docs/migrations/1.x…
📰 Release notes: github.com/mswjs/msw/release…
365 days in development, 200 commits, 40 contributors involved. The future of API mocking is here, and it has never been brighter.
Dupliquer le code d’un projet sur deuxième git ne fait que doubler le coût de développement et de maintenance du projet.
A l’inverse, travailler ensemble sur la même base de code tire le code, la qualité vers le haut et diminue le coût de développement du projet. 😘