3 ms·
How would you compare yourself to HTMX and Unpoly? I'm keenly interesting in this space for sure and love that you're working on another!
by canadiantim 3y ago
How would you compare yourself to HTMX and Unpoly? I'm keenly interesting in this space for sure and love that you're working on another!
- devmunchies 3y agoLib is EXTREMELY minimal. Only GET requests with anchor tags. That you can’t POST forms or send metadata make it mostly useless for anything but the most basic website. I guess the creator will think about the minimal features to add in their remaining 50 LoC budget. (IMO a minimized KB target would be a better ceiling).
- breakfastduck 3y agoI mean, you can just write some code to post data to an API.
- devmunchies 3y agoIt's not about the POSTing. Its how you handle the response. The paradigm of this library is that you replace segments of the page with the response, which it doesn't support for POST requests.
- juancampa 3y agoIsn't that what <form> is for?
- djbusby 3y agoWas. for, "modern" things (libs, framework, etc) intercept these bog standard bits with their "magic" rebuilding to maybe 70% of what already worked.
- hombre_fatal 3y agoRefreshing the page to send an upvote isn’t peak UX.
- josephernest 3y agoThanks for the comment! These 2 other libraries are really great. For something as important as the choice of a web framework, I realized I really wanted to 100% understand the internals, then I starting working on Swap. The key things for me are: - no tool required (just a text editor, no compiler, no bundler/packer, no minification even needed: I just wanted to write JS and that's all). - be able to re-read the source code in 10 minutes and 100% understand how it works, which is impossible with most frameworks - even if simple, I wanted that non-trivial features are included (such as browser history, when using previous / forward browser buttons), because I don't want to have to think about this when creating a new web appliation My first prototypes took a few hundreds of lines of code (for the same result). I spent some good time redesigning it, and finally I was surprised I can cover 80% of my navigation needs (when doing web applications), with only 50 to 100 LoC. For the rest (features not enhanced by Swap, like form submission), of course, I just write normal JS, but I think I would have done it anyway whatever the framework. TL;DR: in my lib I just focused on swapping HTML content (parts of the page) when navigating, thus the name "Swap" :) + I wanted the lib to do the boring stuff for me (make sure the browser history still works, etc.)