Live data from Hacker News

What to expect from your framework

johan.hal.se

81–87 of 87 posts

Re: What to expect from your framework

#81
post #35

Earlier quoted context omitted.

The usual heuristic I've encountered is that a library is something where your app code uses it and asks it to do things, and a framework is something where your app code hands off top level control and the framework asks your app code to do things. Whatever you think of that terminology, I think the majority of available things you can use do fall substantialy into one or other of those categories and the difference…

> Whatever you think of that terminology, I think the majority of available things you can use do fall substantialy into one or other of those categories and the difference in working style while using them is a distinction worth being aware of. I think that the offered terminology is nicely put and should be good enough to describe most cases! However, what we might find is that either it's more of a spectrum than a…

Mmm ... while e.g. in React a lot of state libraries are specialised to React, I've had a fair amount of success using e.g. MobX for state management and React as the view rendering layer it was originally advertised at.

But yes, it's not completely binary, hence my saying 'most' a lot - the library/framework distinction definitely has a wide and fuzzy boundary line ala the time years (decades?) of disputes happened because somebody drew a negotiated official border with a really blunt pencil - but I'm advocating the idea that the distinction is a useful way to carve reality at the joints in a sense of "all models are wrong; some models are useful."

Plus, I mean, the 'is it inside' thing would make PSGI/WSGI/Rack/etc. count as a framework since generally they call your application, but they're not really framework-y in spirit on their own (middleware starts to get fuzzier, of course, but I think we're agreed that 'fuzzier' is an inevitably recurring theme here)

Re: What to expect from your framework

#82
post #78
post #71

Earlier quoted context omitted.

I prefer CSS. We even have browser support for CSS variables now so what else do you need? Tailwind wipes out half of the features of CSS and replaces them with mindless inline repetition and bloat all in the name of convenience. I call it inconvenience and refuse to work on Tailwind projects.

> We even have browser support for CSS variables now so what else do you need? Not writing CSS in a different file and have it applied to all my page would be a start. Creating a class for each different component and then writing CSS for that component is not really great. I like the Svelte way where you have your components that have HTML, CSS and JS, and some global CSS too.

> Not writing CSS in a different file and have it applied to all my page would be a start.

Are you saying you do or don't want CSS in a different file? You can have whichever you please. You can put your CSS in style tags on an html document if you want, or use javascript to inject a style tag wherever, that you can write inside a template string, I guess. Depending on whatever templating language system you're using, you can put css in that language's version of style blocks, such as in React or Vue I've seen .jsx or .vue files with blocks of styling code in them (usually just option 2 above with sugar, using js to inject a style tag).

> Creating a class for each different component and then writing CSS for that component is not really great.

You can use CSS variables and basic rules to combine styles if you'd like? I'm not exactly sure what you mean. I mean, the styles cascade, what are you trying to accomplish that can't be done easily by using a universal rule to apply some baseline fonts or what have you?

Re: What to expect from your framework

#83
post #45

This article is great, and it reminds me of a rant I've been wanting to make for a long time: why the hell does everyone these days insist on building every web app as an SPA? I started my career in Rails. I'm sick of Rails these days as I've worked with it for long enough to become intimately familiar with its flaws; these days I'd pick Phoenix over Rails any day of the week. But still, I'd rather spend a million ye…

How do you implement editable list of items where requirements are that: - editing/creating new has to be in a popup - people don't want full page reload because they lose context (and have "feel" it beeing slow even if it is not) - edit-table is not a solution because amount of settings will fit popup - some things like item name in a list has to be updated in the list after saving in popip which requires two way da…

As someone that's basically been forced to build SPAs their whole career, these kinds of comments are always the one I hunt down with hunger in these threads, because the "complaint posts" about SPAs always sound really nice: wait, there's "actual" frameworks (SSR platforms) that take care of all the things I hate implementing for me? Awesome! But then I come to the threads and there's comments like, "cool, but how do you implement {this thing that is one of the ten variations of things I implement in SPAs for my career}," and the answers are always varied but often boil down to "oh, yeah, actually, you should build an SPA for that."

Probably the majority of the internet doesn't need to be implemented as an SPA but I guess I just keep getting gigs for apps that do need an SPA implementation? Maybe I'm self selected for it by working so much in this "niche" of the industry? I have recently been tasked with building out an ecommerce thing and it's finally a time where I'm like wait why would I build this as an SPA, and I've heard that most of the internet is basically just ecommerce sites lol.

Anyway, I would love to see some of the common things I implement in SPAs, and how I'd implement them instead in Django or whatever, cause I'd love to stop having to reimplement cookie and auth management and whatever else these things supposedly give away for free

1. Highly dynamic tables of data with filtering, sorting, pagination, etc

2. Inline editing of a Resource (Widget of some kind) without needing to refresh the entire page

3. Inline progressive forms with lots of logic (one time I had to implement an SQL query generator game)

Or whatever else I'm not thinking of right now

Re: What to expect from your framework

#84
post #83
post #45

Earlier quoted context omitted.

How do you implement editable list of items where requirements are that: - editing/creating new has to be in a popup - people don't want full page reload because they lose context (and have "feel" it beeing slow even if it is not) - edit-table is not a solution because amount of settings will fit popup - some things like item name in a list has to be updated in the list after saving in popip which requires two way da…

As someone that's basically been forced to build SPAs their whole career, these kinds of comments are always the one I hunt down with hunger in these threads, because the "complaint posts" about SPAs always sound really nice: wait, there's "actual" frameworks (SSR platforms) that take care of all the things I hate implementing for me? Awesome! But then I come to the threads and there's comments like, "cool, but how d…

I am mostly annoyed with people jumping out with absolutes which are fake.

Yes you don't need to make everything SPA - but yes SPA has its legitimate use cases. There will be always bunch of people overusing stuff or using it in wrong contexts but yeah complaint posts are usually written with narration of "all or nothing".

Re: What to expect from your framework

#85

This article is great, and it reminds me of a rant I've been wanting to make for a long time: why the hell does everyone these days insist on building every web app as an SPA? I started my career in Rails. I'm sick of Rails these days as I've worked with it for long enough to become intimately familiar with its flaws; these days I'd pick Phoenix over Rails any day of the week. But still, I'd rather spend a million ye…

I'm working on a web framework in Ruby that works kinda like React/Preact but it's 100% server side, so you can write components declaratively as in React, but you don't need to have separate apps for your frontend and backend. I think it's can be a good approach for many types of apps.

Re: What to expect from your framework

#86
post #84
post #83

Earlier quoted context omitted.

As someone that's basically been forced to build SPAs their whole career, these kinds of comments are always the one I hunt down with hunger in these threads, because the "complaint posts" about SPAs always sound really nice: wait, there's "actual" frameworks (SSR platforms) that take care of all the things I hate implementing for me? Awesome! But then I come to the threads and there's comments like, "cool, but how d…

I am mostly annoyed with people jumping out with absolutes which are fake. Yes you don't need to make everything SPA - but yes SPA has its legitimate use cases. There will be always bunch of people overusing stuff or using it in wrong contexts but yeah complaint posts are usually written with narration of "all or nothing".

> complaint posts are usually written with narration of "all or nothing".

Mine wasn't, I specifically said that some UIs are complex enough to justify an SPA.

Re: What to expect from your framework

#87
post #45

This article is great, and it reminds me of a rant I've been wanting to make for a long time: why the hell does everyone these days insist on building every web app as an SPA? I started my career in Rails. I'm sick of Rails these days as I've worked with it for long enough to become intimately familiar with its flaws; these days I'd pick Phoenix over Rails any day of the week. But still, I'd rather spend a million ye…

How do you implement editable list of items where requirements are that: - editing/creating new has to be in a popup - people don't want full page reload because they lose context (and have "feel" it beeing slow even if it is not) - edit-table is not a solution because amount of settings will fit popup - some things like item name in a list has to be updated in the list after saving in popip which requires two way da…

You can build certain sections of your UI in React (or whatever) without needing to rewrite your entire app as an SPA.
Post reply on HN