big question that's been popping through my head recently is:
-
@polotek I mean it’ll be a while until I have anything to show because it’s a real, full app, not a focused demo, but I’m looking forward to it.
And I think this is the kind of exercise that’s really necessary, rather than yet another todo list
But yeah it’s honestly gotten really far and it’s literally still less than 40kb of JS. Even things like setting up SSR for the web components in a non-JS server, turned out to be way easier than they seemed in my head. I have to learn a couple of new things every time but once I do, things just GO
-
Jan Lehnardt :couchdb:replied to Kat Marchán 🐈 last edited by
-
Marco Rogersreplied to Jan Lehnardt :couchdb: last edited by
-
-
@zkat @janl so I want to do a little frontend only tool. It's essentially savings rate calculator. There are a million of them. But I want one that allows me to change the values with little input sliders.
I got something basic set up. But then I kind of got bogged down in details. Mostly around how to represent the interest rate math.
But also I started to turn the sliders into little web components before realizing that was overkill right now.
-
-
@polotek @janl I just got linked to https://adactio.com/journal/20618 elsethread and it's very much along the lines of this kind of augmentation you're trying to do!
aka "use a regular
input type=range
, then wrap it in a component to do fancy progressive enhancement on it" -
@polotek @zkat @janl output elements can be clarifying https://developer.mozilla.org/en-US/docs/Web/HTML/Element/output
-
@KevinMarks @zkat @janl oh this is cool. Sounds like it doesn't help with implementation, but it does give you better accessibility support out of the box. Neat.
-
@polotek @KevinMarks @janl would you like my 2c on what I’ve found works well for what I would’ve traditionally used 2-way binding for?
-
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.