big question that's been popping through my head recently is:
-
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.
-
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?