CSS Houdini
developer.mozilla.org
developer.mozilla.org
Prediction: that “but...” is going to be ignored way too much.
https://drafts.csswg.org/css-grid-3/
https://github.com/w3c/csswg-drafts/issues/4650
(Think Pinterest layout with ltr ordering, which is extremely problematic in pure CSS)
Slowly integrating flexbox and grid in my work but I'm not in a hurry.
https://css-tricks.com/snippets/css/complete-guide-grid/ https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_La...
More seriously, this looks really cool, and I do actually wonder if it could ease some of the problems Google is looking to solve by using canvas-based rendering, although I'm not super familiar with the challenges of rich-text editing. It would be much more preferable for me (and I think for most developers and users) if web apps still used the DOM to render text boxes, and you could hook into the rendering and layout engine for more complex operations. The layout and painting hooks offered by Houdini seem very useful for this.
The one issue is I'm not sure how text selection works here - the order of elements in selection is already kind of obtuse for more complicated layouts, and this adds even more configurations. I don't know if the APIs offer some sort of ability to control the order of selection or if that's somehow a feature of the box model.
CSS Houdini is a way to get performance out of complex and custom layout or animations.
It's still possible to make the DOM complicated enough that moving to canvas has performance advantages. I don't know the details, but I'm guessing that is achieved by skipping updates the browser would usually make.
CSS Houdini Experiments - https://news.ycombinator.com/item?id=21628921 - Nov 2019 (14 comments)
CSS Houdini Interactive Introduction - https://news.ycombinator.com/item?id=20548183 - July 2019 (28 comments)
Houdini: Maybe the Most Exciting Development in CSS - https://news.ycombinator.com/item?id=11357794 - March 2016 (62 comments)
Houdini and the Extensible Web - https://news.ycombinator.com/item?id=9533423 - May 2015 (1 comment)
Is that the underlying tech being new and slow, or the specific implementations using it on the gallery?
https://github.com/ConradSollitt/css-houdini-fractals
It's similar to rendering with canvas. houdini.how is a Chrome Labs Site from Google and allows authors to submit demos. I would recommend creating a demo on it for any developer that wants to try Houdini.
> Note: With great power comes great responsibility! With Houdini you could invent your own masonry, grid, or regions implementation, but doing so is not necessarily the best idea. The CSS Working group does a lot of work to ensure every feature is performant, handles all edge cases, and considers security, privacy, and accessibility.
Sounds like a lot of work to display a bloody list.
UI is complex? Who knew!
It's more expected that you'll use things that use Houdini under the hood as an implementation detail.
A new layout mode (like CSS Grid) isn't available yet? This allows someone to write a polyfill for it. That's neat!
this was my first thought, too. We have polyfills for js features that don't yet exist in a lot of browsers, but polyfills for css are either very complicated or just don't exist in some cases.
Seems there is for parts of it already
Hopefully this won't be used as an excuse for new standards proposals to never move forward and/or browser teams to slow-roll implementing new standards natively..
It's 2021 and people still do div and javascript hell to implement these things.
There's even a color picker in native html now.
What about spinners, pull to refresh and other things ... would be nice to standardize all of these such that they display with your system's native widgets. The code for those CSS spinners is horrifying spaghetti code whereas I should be able to just do <spinner> and get an Android native spinner on Android and an iOS native spinner on iOS.
I think I get the point you're trying to make, and I find it difficult that someone could make a list of all the things that "should be in by default" vs providing the building blocks.
tl;dr they'll get it in the next patch
[0]https://lion-web.netlify.app/components/interaction/switch/o...
"npm i --save @lion/input-amount"
This isn't directed at you, but I shouldn't have to use npm to build a webpage. Also, building web components out of css/div hell severely impacts performance when you have a long scrollable list of them.
And most of these web components might look nice but they don't support native touch/swipe gestures in exactly the same way that the OS does.
I tried the Lion tabs component on my phone and I can't swipe between tabs. Probably the most utterly basic UI gesture. Fail.
And? That's what all the "native" web inputs are as well.
Web components is one way to add re-usable functionality naked into modern browsers. There is also a slew of new elements nobody seems to use for no good reason like: picture, figure, section, article, main, header, footer, the new input types, details and I’m sure I’m missing more.
Why does this industry think it’s okay to just be well educated with JS but doesn’t care that developers also know CSS and HTML just as well, I’ll never know
I wouldn't hold my breath though.
I personally can’t wait for the Layout API, which will allow alternative solutions to compete with the CSS layout mechanisms, without the performance penalty.
Not knowing anything about the velocity of the effort, I look at that and can imagine this being years from general availability.
From my point of view I can start thinking about putting ChromeOS developer instead of Web developer on my skill list.
Used to implement things like CSS3 rounded corners and other decorations https://github.com/lojjic/PIE
It is not the main targeted use case of Houdini though! (And I'm gonna go out on a limb and say the Houdini devs would say it's a bad idea as more than a cool toy!)
Still waiting to use it on a commercial project.
https://mattperry.is/writing-code/animation-worklet-4-missin...
Houdini seems mostly abandoned. The feature page [1] lists multiple sub-proposals that have "No signal" even from the Chrome team. All mentions of Houdini I can find on developers.google.com are from 2018. I can't find anything about Houdini integration with WebAssembly, which is what I'd expect if development was ongoing.
Overall, I'm seeing everything I would expect to see in the timeline where Mozilla has no intention of ever implementing Houdini, and Google has decided it's not worth pursuing beyond what's already implemented.
What I really don’t understand is why they still insist on global namespace polluting APIs. It was ok-ish with CSS Animations’ names, it broke any real project with custom elements (want to have 2 different versions of the same element? Good luck) and then this…
They really don’t care about actual folks trying to incrementally upgrade applications or developing composite applications. All of this requires a level of coordination that is prohibitive to have in enough complex projects…
Odi ed amo…
> Ōdī et amō. Quārē id faciam fortasse requīris.
> Nesciŏ, sed fierī sentiō et excrucior.
> I hate and I love. Why I do this, perhaps you ask.
> I know not, but I feel it happening and I am tortured.
Things that we could only really do in Flash, like cool animations with transitions could become even more possible and easier to build with Houdini.
The table rounding is a really cool idea. I could see us combining a bunch of concepts to build really fast and performant designs that are cutting edge.
You could always do this with Javascript, and some people have been. See: https://philipwalton.github.io/polyfill/
But this lets you do it in a less hacky, and especially, more performant way.
The author of that JS CSS polyfill library above actually wrote in 2016 how that approach was proving a bad idea, and the right way to do this was the houdini API... I guess we've been waiting for it since 2016? This is the first I had heard of it. https://philipwalton.com/articles/the-dark-side-of-polyfilli...
Enabling JS devs to experiment with things up front before they go to the standards track and the effort of full browser implementations will have a lot of cool advantages, I hope.
It's extremely unlikely that most developers will use this directly.
I'd love to try the platform from a consumer standpoint, though - maybe add a demo page? I'm not a creator, so not sure about signing up for that free trial.
Do the transcripts go well with (instrumental) music? It'd be great to have this for the online bass lessons I just started. :D
especially in situations like this where both are vaguely graphics related
Nevermind that humanity has experienced a quantum leap in productivity and e-commerce that has given generations of entrepreneurs wealth and every consumer on the planet unprecedented quality of life thanks to the Web, and that Web being made possible precisely because the developer-friendly, move fast and break things route that Javascript has taken from day one.
But because there is a new Javascript framework coming out every day (I'm surprised competition is seen in a negative light, on HN out of all places), because it's easy to learn (and we all like to gatekeep a bit, don't we?) and because it's not a "real" language (since you cannot shoot yourself in the foot with a use-after-free), Javascript has become the prime target of ivory tower grumbling.
Of all programming languages now and past, javascript as it is used today (as opposed plain language) would not be my first choice for "easy to learn". I feel there's huge effective gatekeeping with it but that's just an outsiders perspective :-/
Regarding React, I consider the "hooks" coding style to be INCREDIBLY ergonomic and have been wondering sometimes if React-like "hooks" could be used elsewhere, esp in other programming languages. Or does that only make sense with UIs?
React Hooks are equivalent to React class components all of whose state management is done through setState, but with the difference you describe. Personally, I find hooks more natural than classes whose state management is done exclusively through setState, but that’s obviously a big YMMV.
The Javascript ecosystem is dismal. It's very disparate and there's a million ways to do one simple task, compounding that is that things that sound like simple tasks, like rendering a page, are actually not.
If you want a place to start, where the ecosystem is fairly beginner friendly and consolidated, checkout Vue and Nuxt.js. I recently explored every possible frontend for Go that I could find: desktop, web, or otherwise. The fact is that HTML, JS, and CSS still produce the best experience for the end user. Vue and Nuxt made it really easy to produce a hybrid Server Side Rendered and Client Side Rendered (aka Universal) app with still a significant amount of effort, but with that effort directly improving my UI rather than my build environment or configuration.
It’s fine to do so, but knowing the core primitives of the language and the DOM can get you very far without having to reach into a bucket of libraries from npm.
As for bundling, there was and will always be tools, people like to think it was just throwing script tags onto a page before npm and the modern packaging ecosystem happened but that’s not really true. At the heigh of jQuerys popularity there were (and are) entire CDNs devoted to serving it and its plugins (which many evolved to serve all kinds of different pre-packed JS bundles) as was a myriad of concatenation tools that even pre-existed before nodejs
I remember namespacing and dynamic loading tools too. I can’t remember their names anymore but this is not a new thing.
It’s always been volume and choice. It’s much bigger today than it was back then but it’s always been this way as far as I can remember
Now, go tell this newcomer that you don't actually need a server to serve multiple web pages, it can just serve one! Client side rendering with a client side router is a pretty far departure from what even experienced programmers know about the world.
Now, go tell this newcomer that you can absolutely still render components from the server without redrawing the whole page. They'll enjoy this until they run into the limits and constructs of SSR. Again, a pretty far departure from send a whole page.
Now, go tell this newcomer you can do both at once, and that often it's beneficial to do so. You have taken what was a very simple task and made it quite complex.
Of all languages I've had to learn in my professional career, Python has been the hardest. Not because it's a hard language, but because I have to hunt for what to actually learn.
And the ecosystem even more so.
I'm asking about the bad parts.
Note that I personally use 100% Typescript.
And if the Web's application layer is not HTML, CSS or Javascript, then what is it?
To that I say: Houdini isn’t the enemy here. Some gripes about performance will be had for bad implementations but at the core CSS is still the foundation.
My core problem is that progressive enhancement or graceful degradation[0]
This of course is a symptom of bad industry practice and bad developer habits, that’s where I have a serious issue with our industry.
Houdini though? It’s the right technology for the job IMO
[0]: https://www.w3.org/wiki/Graceful_degradation_versus_progress...
I hope in the future something like Gemini takes off, so we can stop stepping on each other's feet.
People will just not visit sites with a bad experience if they have alternatives. Market forces and all that.
This will likely be a headache for developers more than a problem for end users..
Hahahahaha, good one!
<script>.element{color:red}</script> <style>
textarea {
--checkerboard-spacing: 10;
--checkerboard-size: 32;
background-image: paint(checkerboard);
}
</style>
<script>
CSS.paintWorklet.addModule('checkerboard.js');
</script>
// checkerboard.js
class CheckerboardPainter {
paint(ctx, geom, properties) {
const size = parseInt(properties.get('--checkerboard-size').toString());
}
}
registerPaint('checkerboard', CheckerboardPainter);
More escape acts here: https://developers.google.com/web/updates/2018/01/paintapi#p...Realistically these are things that can make look nice by utility functions.
The value of being able to paint using Canvas APIs off the main thread for super custom components is really high. In all other platforms like iOS and Qt you can take over painting if you want to. It's nice that we will be able to do this in web too.