The readme says: "The current state of an instance (i.e., counter's attributes) is automatically transported back and forth." How does this work? Do you need some cross-network locking mechanism when you need to make sure the shared object's state doesn't get out of sync between client and server? What about passing object instances between client and server? Does it do what (I think) DCOM does to handle garbage-coll…
Do we need a web API?
71–80 of 107 posts
Re: Do we need a web API?
#72Does this force you to use node for the back-end?
Re: Do we need a web API?
#73Having clear API allows to have a clear boundary between trusted and untrusted environment in backend. If you don't check your arguments in REST endpoint, it's obvious bug and easy to spot. If it's just another method, well, you're not treating input in every function as a hostile.
Re: Do we need a web API?
#74First Law of Distributed Object Design: "don't distribute your objects" --Martin Fowler
Re: Do we need a web API?
#75Re: Do we need a web API?
#76As someone deploying frontend apps for a large site you should not underestimate how long people have their tabs open. I can get sentry error reports for versions that have not been deployed for months. Does this handle "API" versioning in any real way?
Re: Do we need a web API?
#77What frustrates me is that it's not the API that is the source of complexity. ~80% of the pain of building most apps comes from managing the syncronization of state between the client and server. SPAs are the over-prescribed opiates here making the problem worse. Imagine what could be possible if you walked away from maintaining client state altogether.
We did, and it's wonderful. StimulusReflex let me build a reactive tabular UI with sorting, filtering and pagination with 115 LOC, none of which is custom JS: http://expo.stimulusreflex.com/demos/tabular
I honestly believe that the existence of things like StimulusReflex and LiveView demand we question the ongoing utility of libraries like React. Popularity is not a good reason to use something, especially when you realize you could be radically more productive if you don't use it.
Re: Do we need a web API?
#78RPC - this isn't anything new. When I started doing web development in the late 90s for about ~5 years I was the designer, front-end, and backend developer all in one. Then over time things changed to allow for specializations and we now have many different functions, and that's a good thing. RPC has a place, and it's not for web apps, at least most of the time. I've noticed over the years that JavaScript developers…
Wouldn't you prefer to talk in your mother language instead of using a new language for every country you visit?
Personally I have never understood backend JS as you get untyped, weird silent errors, under or completely un-utilized async features that end up causing more problems than they solve, and then all the quirks of JS to boot. I regularly hear the argument of the benefits of keeping the language the same on both ends, but besides slightly easier JSON between them (something handled by clean packages in almost every language these days with minimal effort/LOC/boilerplate) the languages don't end up actually sharing a ton given how you hook into a web framework like Express, database API's, etc. You don't get code reusability and I don't think the JS tradeoffs are worth the slight savings on context switching. If you have a serious project of any scale/long term use and have front end programmers that want to use JS on the backend, either bite the bullet and have them learn now or hire some backend devs in a language better suited to your project.
Re: Do we need a web API?
#79this is just JSON RPC? The "constantly serialize and deserialize it" statement is totally untrue too... The frontend makes 6 XHR calls just to render a single page and they're all just JSON. The idea of the frontend 'just calling' the backend with no API boundary is nothing short of atrocious for security. The only feasible logical end to this is ASP, which was an interesting idea when it was launched 19 years ago
Regarding the number of XHR calls, to be accurate, it is not 6 but 4. Once Liaison is complete and optimized, the number of calls should drop to 2.
Also, please keep in mind that Liaison is made for building single-page applications. So, using it for a simple blog might not be the right choice.
And about your security concern, please head over here: https://news.ycombinator.com/item?id=21660785
Re: Do we need a web API?
#80RPC - this isn't anything new. When I started doing web development in the late 90s for about ~5 years I was the designer, front-end, and backend developer all in one. Then over time things changed to allow for specializations and we now have many different functions, and that's a good thing. RPC has a place, and it's not for web apps, at least most of the time. I've noticed over the years that JavaScript developers…