Live data from Hacker News

If Not SPAs, What?

macwright.com

141–150 of 456 posts

Re: If Not SPAs, What?

#141
I've seen a lot of SPA vs. "JavaScript sprinkles" arguments lately and I think it is a false dichotomy. You can add JavaScript interactions to a page, to existing HTML, (take a look at Vue for example) without committing to JavaScript taking over the entire page.

Re: If Not SPAs, What?

#142
post #40

Earlier quoted context omitted.

You want a web browser talking directly to an RDBMS of some kind?

Yes, like we had with WebSQL until it was deprecated. Basically a SQLite db per site.

You can run queries to FaunaDB on the browser with FQL which is quite powerful.

Re: If Not SPAs, What?

#143
post #45

One entry in this space that doesn't get a lot of attention is ASP.NET Blazor [1]. Blazor gives you the option of writing views in C# that will actually compile to WebAssembly and run in the browser, or run on the server and send DOM updates over a SignalR connection, a lot like LiveView. [1] https://docs.microsoft.com/en-us/aspnet/core/blazor/

Blazor currently has to ship its runtime over the wire so it's not an option for anything bandwidth constrained.

Re: If Not SPAs, What?

#144

> SPA pattern has failed to simplify web development The SPA pattern is fine, it is React Router and Redux that has overcomplicated things. Here's an example of an app written using the MVC pattern that is way simpler than the React stack: https://github.com/Rajeev-K/eureka It uses two very simple libs: A 500-line router: https://github.com/Rajeev-K/mvc-router/ A 200-line templating library that uses JSX syntax: http…

nobody really does MVC with react these days, it's all about components

Re: If Not SPAs, What?

#145
I found Blazor to be a good middle ground between SPAs and frameworks like Django or RoR.

The problem with frameworks like Django is that they have no real concept of UI Components. They have glorified ways of copy pasting html code. The cognitive burden when creating a fairly complex app, like a set of dashboards, is very high in Django.

The reason people flock to React is because, once they develop a component, it's easy to re-use. And that is the drug that fuels them. However, the learning curve is high.

I found Blazor to be a good middle ground, because it has the concept of Pages (Razor pages), which are linked to URLs' and those pages can contain re-usable components. The framework is setup for basic site structures with a lot of options for customization. For example, you have default layout pages, that are included in every output. Great to put a basic menu and footer system.

Those working on ASP.NET MVC and like would find it a breeze to work on Blazor.

Couple that with the option of using C# for the whole application, it is very enjoyable to develop with.

I have used Angular, React and Django. Angular, for me, is too much complication for simple stuff, but perhaps works well with complex apps. However learning TS, as good as it is, was a turn-off for me. React is easy to start with, but as your app grows in complexity, it becomes hard to manage and think about various stuff like state management, routing, etc. Given choice between React and Angular, I would definitely choose React. Django is very good for sites like blogs or info pages, basically wherever there is a large amount of static content, pulled from database. Of all the above, I found Blazor to be very productive. I can also mix and match different paradigms and Dependency Injection is a god send.

Re: If Not SPAs, What?

#146
post #143
post #45

One entry in this space that doesn't get a lot of attention is ASP.NET Blazor [1]. Blazor gives you the option of writing views in C# that will actually compile to WebAssembly and run in the browser, or run on the server and send DOM updates over a SignalR connection, a lot like LiveView. [1] https://docs.microsoft.com/en-us/aspnet/core/blazor/

Blazor currently has to ship its runtime over the wire so it's not an option for anything bandwidth constrained.

Not if you use Blazor Server.

Re: If Not SPAs, What?

#147
post #55

HTMX https://htmx.org/ LiteDOM https://litedom.js.org/ Stimulus https://stimulusjs.org/ Turbolinks https://github.com/turbolinks/turbolinks

I am quite a fan of HTMX and am using it for multiple projects now. I hope it continues to gain traction.

Re: If Not SPAs, What?

#148

If not SPAs, and hear me out on this one, how about... Native applications

Yeah, no thanks. There's a reason we abandoned them in the first place. I've never heard of anyone who's itching to go back to Swing.

Re: If Not SPAs, What?

#149
post #78

I'm building an app with a TALL stack now (Tailwind, Alpine.js, Laravel, and Livewire) and I am incredibly productive. Very little build step required (to compile Tailwind to reduce the size based on which classes are used in .blade.php files). CRUD, Image uploads etc are so easily done I am such a fan. I was skeptical at first, but now I love this way of building web apps. No idea how well it scales, but for a simpl…

For all the speed bumps PHP 7 delivered Laravel typically scores lower than Django and Rails on Techempower benchmarks. This and the reality that PHP roles typically pay 20% less than Ruby, Python or Node has led me to ignore Laravel.

Re: If Not SPAs, What?

#150
post #72
post #70

You can achieve near SPA performance with XSLT in the frontend, and stitching multiple XMLs using it. - No JS fallback by default - Naturally friendly to XML database backends - Huge cache hit improvements - Effectively, you get the functionality of the now abandoned "seamless" iframe attribute

Yeah but then you have to use XSLT. (Jokes aside, I tried this years ago hoping for it to be a magic bullet. Gzipping meant that the bandwidth savings weren’t anywhere near what I hoped and XSLT is a PITA to deal with)

I'm not sure if it's still a going concern but I found SXSLT made XSLT much less annoying to deal with. It's a natural fit for S-exprs.
Post reply on HN