Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
nymanjon
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
31.
▲
by
nymanjon
1y ago
I could see it used for something like that. But it is more general as it can act upon any HTML element. So, you could use it for masking an input element or any other local state based element. Granted, it doesn't need to be limited t
32.
▲
by
nymanjon
1y ago
So, what use case would you see with ShadowDOM? I see this more as a way to progressively enhance an element. But in my own use of web components I haven't seen a need for ShadowDOM, but I'm usually just progressively enhancing my
33.
▲
HTML Traits
(github.com)
17 points
by
nymanjon
1y ago
|
4 comments
34.
▲
by
nymanjon
1y ago
I built a simple lib for JS/HTML called html-traits[1]. It's similar to built-in web components but instead of using the `is` attribute you use the `traits` attribute. So, it is specifically meant for progressive enhancement. Let&
35.
▲
by
nymanjon
2y ago
Here's some hypermedia apps that I've made (caveat I use HTMF -- html-form on npm -- that is similar to HTMX but is simpler and stays closer to the native HTML): An offline first MPA: https://github.com/jon49/
36.
▲
by
nymanjon
2y ago
You might like Yohn's PicoCSS. It encourages semantic HTML everything is ready for you out of the box and he added some features that give it a little Bootstrap utility feel. https://yohn.github.io/PicoCSS/ The &q
37.
▲
by
nymanjon
2y ago
> Lower latency for interaction. Unless you are optimistic in your approach, that isn't true, both have to talk to the back end. > Lower server costs. Not necessarily. It depends on what language on the back end you're using
38.
▲
by
nymanjon
3y ago
A commenter above mentioned that when you target an `iframe` it sends back the header `Sec-Fetch-Dest: iframe`, so if it doesn't have that then you know it requires the full page and not the snippet. So, yes, easy no JS fall back by dy
39.
▲
by
nymanjon
3y ago
I would think you could add a cookie with JS. Then you know JS is being used. So, that does seem viable.
40.
▲
by
nymanjon
3y ago
Playing with the code it doesn't fit my use case. It seems like it would be really cool if you have a very narrow use case and that use case doesn't grow. Having your browser parse any scripts you have twice doesn't make much
41.
▲
by
nymanjon
3y ago
This is fantastic. Right now in my PWA I'm using a little library I created called `html-form` (HTMF) and I need to implement it as a SPA to avoid service worker fetching on every page change. So, I used a similar attribute to `hx-sele
42.
▲
by
nymanjon
3y ago
I build HTMX-like offline-first SPA service worker apps for myself. It's actually quite nice :-).
43.
▲
by
nymanjon
3y ago
Here you go! https://hyperview.org/
44.
▲
by
nymanjon
3y ago
I've done this. HTMX offline-first is an elegant way to build apps.
45.
▲
by
nymanjon
3y ago
Yes, I've done this and the code is really simple to understand compared to a SPA. https://github.com/jon49/Soccer
46.
▲
by
nymanjon
3y ago
I made an app doing this with an HTMX-like library with a total of 100 kB minified/zipped code. Not bloated at all. The code to make it work is about 10 kB. The rest is the code for the actual app.
47.
▲
by
nymanjon
3y ago
Yes, here is one. https://github.com/jon49/htmx-todomvc I use this pattern for all my personal apps. I use my own little htmx-like library though. But wouldn't be that hard to swap in HTMX.
48.
▲
by
nymanjon
3y ago
That's not entirely correct. It takes a day to pick up and a week to master :-). Well, it does take a little longer to learn all the nuances. Also, I've used this pattern in my personal apps (and for one app at work) and sometimes
49.
▲
by
nymanjon
3y ago
It's more about their back end skills as you would be hiring a back end dev who can do a little front end. No need to worry about having HTMX on their resume, just something like <Whatever back end language you like> and JavaScri
50.
▲
by
nymanjon
3y ago
You could use a Service Worker to do this and then have multiple pages in a different tab to be able to navigate around. It would be too difficult to do that. Then you could just use native JavaScript or whatever the user wants for the page
51.
▲
by
nymanjon
3y ago
A soccer tracking app for who is playing and who isn't and what positions.[^1] A weight tracking application.[^2] A time tracker for how many hours my daughter was driving.[^3] An app to help my wife randomly pick meals for the upcomin
52.
▲
by
nymanjon
3y ago
I'm excited to take a look at this. I learned F# early on in my career and really enjoyed it. These days I'm into ultimate simplicity. I really like V-lang. It has the simplicity of Go but adds some ergonomics that Go has been mis
53.
▲
by
nymanjon
3y ago
I've successfully used this pattern (HTMX hypermedia style) to create an offline-first web app SPA[^1]. One of the pages is pretty dynamic and I wasn't sure if I would need a traditional front end library to work with it. But, nop
54.
▲
by
nymanjon
3y ago
This still seems like capitalism. Not all the workers own the company. Just the ones deemed worthy and will to put up capital. It's a fine business model for at least this use case, it appears. That's the great thing about capital
55.
▲
by
nymanjon
3y ago
Yeah, for my personal apps I just write offline-first apps. I need to make it so I can build apps as efficient as I can as I don't have a lot of free time. So, I wrote a little library under 1kB that just finds where I left off and re-
56.
▲
by
nymanjon
3y ago
You should be able to do this with events in HTMX also. So, you could do an update or create something and then in HTMX capture the event and reload the component when that happens.
57.
▲
by
nymanjon
3y ago
I've done the same thing with vanilla JS in a service worker. I did it with my HTMF library -- similar to HTMX -- but not production ready and based on forms rather than being able to put your attributes everywhere. I'll have to c
58.
▲
by
nymanjon
4y ago
Yeah, I store everything in IndexedDB using a simple Key-Value abstraction library. I have a cache where I store any temporary state between pages.
59.
▲
by
nymanjon
4y ago
lol, I thought since it was Rust that it would be like 100k or something. I think C# has it's WASM package down to 1MB or so. The implementation I did with just JS is about 50k or so, total for the app and everything. That is a bit dis
60.
▲
by
nymanjon
4y ago
I've done exactly that: https://news.ycombinator.com/item?id=33319875
More ›