big question that's been popping through my head recently is:
-
Jan Lehnardt :couchdb:replied to Kat Marchán 🐈 last edited by
@zkat @polotek @KevinMarks obvs
-
Kat Marchán 🐈replied to Jan Lehnardt :couchdb: last edited by
@janl @polotek @KevinMarks I was asking Marco I don’t want to give advice when it’s not requested
-
Jan Lehnardt :couchdb:replied to Kat Marchán 🐈 last edited by
@zkat @polotek @KevinMarks I was rudely answering for Marco ;D — I think he’s collecting perspectives, so I assume yours is valuable.
-
-
Marco Rogersreplied to Jan Lehnardt :couchdb: last edited by
@janl @zkat @KevinMarks you're both doing great. thanks
-
@polotek @janl @KevinMarks so the Lit docs make a really interesting point about "native" data propagation in html, and how it models its data system based on that, and I agree with it and it works really well.
The general idea is: data moves down through attributes/bodies, data moves up through events.
So if you want to do something that you would traditionally use two-way binding for, a really solid strategy (and the one I've been using to much success!) is to create a "mediator" component further up the DOM tree that that listens for change events and mediates a shared model between all the other components. You can make that even easier by using the Context API to provide a shared model that the leaves can interact with directly (the Context API is also event-based!)
-
@zkat @janl @KevinMarks yeah this sounds right at a high level. But I also understand the many ways that is frameworks have started here and then gone way off the rails. I'm gonna check out lit and give it more thought.
For the record, I think there's a point when what you're doing is designing a data model. And I think that needs to be an intentional process. But I don't know how you help people transition from getting started with something simple to thinking about a data model.
-
@polotek @janl @KevinMarks feels like we’re thinking back to the days of Backbone doesn’t it
-
@zkat @janl @KevinMarks just based on my own experience and comfort level with data models, I found myself wanting it pretty quickly in my little project last night. But I'm still trying to keep perspective and resist the urge to overcomplicate.
-
@zkat @janl @KevinMarks backbone was good actually. I will fight about that.
-
Tuxedo Wa-Kamenreplied to Kat Marchán 🐈 last edited by
I would argue that there are some "intuitively uncomfortable" parts in web development.
Like the fact that you have to copy/paste your basic HTML structure across all files, instead of e.g. importing it like one would do in any programming language.
So the next "obvious" step for a developer is likely to look at some tooling, maybe just an SSG.
At which point the whole HTML stuff becomes a build-time asset (so to speak).
And looking at three different "languages" (HTML, CSS, JS/TS), the obvious (developer) question would be: Why can't we simply have one syntax instead of three?
-
Mx. Aria Stewartreplied to Marco Rogers last edited by
@polotek @zkat @janl @KevinMarks I keep thinking that the inability for the form data model to represent the basic JSON types and have any nesting at all short of naming conventions has always been the achilles heel. So much impedance mismatch in having things become flat lists. Anything involving client-driven repetition ends up frustrating.
-
Marco Rogersreplied to Mx. Aria Stewart last edited by
@aredridel @zkat @janl @KevinMarks yeah it's pretty weird considering that you get logical nesting for free in html. I can see it both ways though. Lots of room to shoot yourself in the foot.
-
@polotek @aredridel @janl @KevinMarks relevant: @slightlyoff just linked me to https://github.com/toolkitchen/mdv and ooooooh aaaaahhhh
-
@zkat We assume that because someone is a competent developer that they are also a competent teacher.
Unfortunately, bootcamps killed that concept dead. Teaching is seen as a step to getting famous in the field.
There is so much behind teaching well, backed by a hundred years of research in learning. But the web community has ignored all of these best practices, never thinking to apply them to make effective learning experiences. We are expected to struggle. It doesn't have to be this way.
-
@zkat @aredridel @janl @KevinMarks @slightlyoff this certainly enters framework territory. But it takes an html-first approach, which is what we want I guess.
This sort of gets away from progressive enhancement though. Without js, you don't see anything rendered. You'd have to combine this approach with some others.
-
@zkat @aredridel @janl @KevinMarks @slightlyoff I don't know. Another thing I'm still chewing on is the difference between data-binding and explicitly rerendering the UI. Sometimes you want to control when rendering will happen rather than it being automatic.
But maybe that's out scope of the discussion for now.
-
@wakame @zkat 'Why can't we simply have one syntax instead of three?' On the one hand: because W3C compartmentalizes and at the same time builds things on top of things to make a 'stack'. But on the other hand: ' I just kinda have a bunch of lego blocks that got dumped in front of me;' it is not really a 'stack' at all, more like a disingenuous pile.