Earlier quoted context omitted.
I think parent is completely missing the point. In my opinion the way it should be is that in the backend you export a typed function like "getTasks(filter: Filter): Tasks And in the frontend component you should be able to use it immediately and it would be correctly typed without having to duplicate types or anything. And if function is not complete yet it will not render the component before. This should be instea…
So backend and frontend must have a wholly compatible type system? Even good old WSDL only got 90% of the way there. Keep going with fancier approaches and you end up looking at CORBA and its ilk.
Data fetching on the web still sucks
81–90 of 98 posts
Re: Data fetching on the web still sucks
#82Ember.js seems to check off a lot of those boxes, if you are willing to use a complete solution and not do the 'pick and choose' method of react and friends. While it has lost popularity in the last few years, it has been moving forward technically. It has become leaner and meaner. Really learning the "Ember Way" to do things can reduce some of the friction the author mentions. Ember Data can allow you to talk to mul…
Re: Data fetching on the web still sucks
#83Ember.js seems to check off a lot of those boxes, if you are willing to use a complete solution and not do the 'pick and choose' method of react and friends. While it has lost popularity in the last few years, it has been moving forward technically. It has become leaner and meaner. Really learning the "Ember Way" to do things can reduce some of the friction the author mentions. Ember Data can allow you to talk to mul…
I'm saddened to see that almost a decade after Ember's release, the front-end world still insists rolling their own (terrible) reimplementation of it. I would've expected that a decade later we would've settled on an Ember-like framework for the front-end and moved beyond constructing URLs and parsing JSON responses manually but apparently not.
Ember is the closest to what I thought JS development should have been like, and I really appreciate what they’ve built. RedwoodJS seems promising too but we’ll see.
Re: Data fetching on the web still sucks
#84Re: Data fetching on the web still sucks
#85This post feels like a uninformed and undifferentiated rant against "things are too complex". Let's start with the first paragraph: What does the JavaScript fetch API have to do with data management? How can you compare the fetch() API with Swagger (an API documentation format) with Protobuf (a serialisation format)? That doesn't even make sense. Second paragraph: "The UI should automatically update everywhere the da…
Author here. Data fetching, caching, consistency, and UX are all closely related. If you treat them as separate problems, you're punting the problem onto product engineers, who won't solve it well. (See the last paragraph of the post, which suggests this same idea.) > That is state management, yeah, and you can build proper state management with any HTTP library and any message serialisation format. You're right that…
State management is also proclaimed as something it isn’t because web UI is full of incompetent expert beginners who can’t write two lines of original code and are helplessly mortified if their colossal framework is taken away.
Here is simple web UI state management:
* have a centrally available object in the UI code that stores state data.
* store that data upon change. That storage can be localStorage for maximum simplicity. It can also be a locally written file if you have a local running service or an http server. The further away from the local computer that storage location becomes the slower it is regardless of access mechanism.
* state changes can occur from user interaction or system updates to remote data. Most important are user interactions because that data is locally available. Keep up with remote system changes as best you can, but unless you own that data as well it’s a window into some distant concern.
* when state changes update your central state object save the changed state object. Most of the time UI developers are only concerned with state updates and not saving state because they don’t know what they are doing and hope the framework does everything (or it must obviously be unnecessary).
* once the state object is updated, and optionally saved, update the UI. For most UI developers updating the UI is the ultimate and only struggle. This is such a junior level basic required skill for UI developers. Knowing that you can root out the incompetent people during hiring.
But but but what about 2 way data binding... Treat it as an event. Update the central state store. Process the change. Still simple and no framework is needed.
Re: Data fetching on the web still sucks
#86They demoed an application that has a react component powered directly by a SQL query, when the client next fetched anything from that page, changes in terms of data coming out of the SQL query were automatically propagated to the client
No data fetch API just coding like you would in a server side app with React handling the IO
I hope someone starts implementing something like Drupal on top for automatic deadlock prevention, declarative data driven interfaces for forms, schema etc
Re: Data fetching on the web still sucks
#87Earlier quoted context omitted.
Author here. Data fetching, caching, consistency, and UX are all closely related. If you treat them as separate problems, you're punting the problem onto product engineers, who won't solve it well. (See the last paragraph of the post, which suggests this same idea.) > That is state management, yeah, and you can build proper state management with any HTTP library and any message serialisation format. You're right that…
State management, for anybody half competent, is stupid easy and not tied to the UI. State management is a data storage/retrieval problem only. Once the UI has the state information it needs you can populate it for the user however you want in many different ways. State management is also proclaimed as something it isn’t because web UI is full of incompetent expert beginners who can’t write two lines of original code…
Re: Data fetching on the web still sucks
#88Earlier quoted context omitted.
Apollo client and Elixir LiveView are solving most of these.
Yes. But do they automagically create and maintain database indexes for the most common requests made by your webclients?
BTW IMO most of BI type stuff could be solved by just allowing direct SQL, but for this DBs would need to be written without buffer overflow bugs etc. I would love to have SQLite that has easy data-at-rest encryption amd that supports access control.
Re: Data fetching on the web still sucks
#89Earlier quoted context omitted.
I think the post is a bit unfortunate in its wording and this seems to have sent you off on a wrong track. From how I read it, this the post is not specifically about JS and a discussion of the specific technologies mentioned but rather concerned with the following very general situation: 1. There's a user sitting in front of a browser. 2. There's a backend server providing data and points of interaction with that da…
> But I hope you agree that this would be really nice. Black boxes with tons of magic are great if you need to do exactly that one thing that creators had in mind. When you need it to work a little bit different you're usually either just out of luck, or the added flexibility makes whole api very complex (and usually buggy, as it goes hand in hand). It's just super hard to make things very high-level and simple, whil…
There are a few black boxes most people are very happy not to peek into; Having these black boxes is a huge productivity win:
* Compilers
* Garbage Collection
* OS Kernels
* File systems
* Docker
* App Stores / package managers
* Infrastructure as code frameworks (i.e. terraform)
* JS Frontend frameworks
I think there's three things at work here: 1. Familarity with treating item X as a black box (High for compilers, low for infrastructure as code). 2. Maturity of the interfaces (High for compilers, low for infrastructure as code). 3. Relevance of the details for your use case / business context.
> Having a number of simpler functionalities that you're free to compose any way you like is for me preferred approach anytime. Most of the things that you mention can be solved with fairly simple wrapper libs doing just one thing
I totally agree: That's how I imagine how the magic functions are defined.
> Black boxes with tons of magic are great if you need to do exactly that one thing that creators had in mind.
This totally depends what your business context is. For most companies, dealing with CORS in HTTP requests is very far from their business domain. Still, developers spend a lot of time configuring and building endpoints, API clients, etc. at a low level of abstraction.
Re: Data fetching on the web still sucks
#90Earlier quoted context omitted.
Author here. Data fetching, caching, consistency, and UX are all closely related. If you treat them as separate problems, you're punting the problem onto product engineers, who won't solve it well. (See the last paragraph of the post, which suggests this same idea.) > That is state management, yeah, and you can build proper state management with any HTTP library and any message serialisation format. You're right that…
State management, for anybody half competent, is stupid easy and not tied to the UI. State management is a data storage/retrieval problem only. Once the UI has the state information it needs you can populate it for the user however you want in many different ways. State management is also proclaimed as something it isn’t because web UI is full of incompetent expert beginners who can’t write two lines of original code…
Do you use anything to render your view or do you construct the nodes and insert them into the DOM directly?
Is your centrally available object an instance of a class or is it a plain JavaScript object?
Does it manage the state for all your UI or is it segmented in some way?
How do you drive changes to your UI? Is there an imperative process that renders the UI when you know the data model has changed or is your state object an observable or something that your views subscribe to?