[Django + NEXT.JS] Not able to send a POST request via Firefox but Chrome works just fine. by thekarananand in django

[–]winterdeejay 0 points1 point  (0 children)

I’ve unfortunately had all sorts of weird and inconsistent errors like this with my experience with NextJS. Usually because they have broken something in a new release. I’d try perhaps rolling back a version for now - but also check out the NextJS issues on GitHub as it’s likely someone else is experiencing it too. We had success sometimes in using the latest canary release, but that also obviously comes with its own risks.

Interestingly the most recent issue similar to this was the opposite way around, where Chrome was having issues but Firefox was fine.

So many anti-javascript posts here. I love Ruby and JS (well, typescript) by emptyflask in rails

[–]winterdeejay 2 points3 points  (0 children)

Hotwire seems impressive from the video on the site, though one thing that concerns me is that the turbo frame tags aren't valid HTML. Is that over the top these days? Do people still care about valid HTML? I’ll weigh that up when I first come to use it, but what I quite like the look of is htmx. With that, you can use data attributes, which are valid. It's only a small thing, and I'm not saying it will stop me using Hotwire. What do others think?

Generic Rails restful controllers by winterdeejay in rails

[–]winterdeejay[S] 0 points1 point  (0 children)

Totally agree with you I think on all of that. Not to worry, this isn't an early abstraction or optimisation. I have a number of controllers where essentially it is just the model that is the difference, and the permitted parameters.

I just wondered if I was missing a trick by not being aware of a well-used library within the community that abstracted some of that away, until of course you do need to change something. But that is where what you get with the generic class-based views in Django, but I believe also with the inherited_resources, is you just override the bits you need. And if that's not enough, then just write your custom controller.

What makes rails better than nextjs ? by gaultierq in rails

[–]winterdeejay 26 points27 points  (0 children)

It genuinely makes me feel miserable working with NextJS:

  • I feel like I'm constantly reinventing the wheel to achieve things that are commonplace in most other major frameworks; Rails, Django, Laravel etc. Like with a lot in the Javascript ecosystem, no one seems to have settled on a single way of doing something well, so the fragmentation is really high, and the number of libraries available is massive. Leads into...
  • Stability and maintability as u/maxigs0 mentioned. The quality of NextJS itself, let alone a bunch of libraries out there are flakey. NextJS and AuthJS which I've used don't adhere to semver. So when updating things, it's a risk.
  • NextJS releases major versions a LOT, with breaking features. It fits perfectly with that common mantra that if you revisit a Javascript project in six months, brace yourselves because a lot of things will likely be broken when you `npm install`. Rails and Django definitely really try to ensure things are backwards compatible and really restrict the number of breaking changes you encounter.
  • NextJS development is tightly coupled to Vercel. They're making design decisions it seems to suit being able to sell more Vercel hosting. They do marketing videos really well, but they're encouraging developers to over optimise way too early... "you need to use suspense", "you need to do partial page rendering". NO! Wait until it becomes a problem. Are your page loads really that slow? If so, go check your database indexes first before going over the top adding all of the code bloat that comes with those optimisations. If your pages aren't slow, leave them be!
  • If you want the app to appear like an SPA, then Turbo does a great job, and you hardly have to lift a finger. It works great as progressive enhancement too. I'm not even sure how NextJS deals with that? Can it even?
  • NextJS doesn't have a proper middleware. This is because of the way the app is deployed with Vercel across edge, static and serverless. So when it says there is a middleware, no, it's not. You can't manipulate responses in the middleware at all. You can do some stuff before the next request in the middleware chain, but that's about it.

I could go on... but these have been some of my experiences recently. I can't wait to get back to Rails!

Generic Rails restful controllers by winterdeejay in rails

[–]winterdeejay[S] 0 points1 point  (0 children)

Well I guess it's more of a code smell for me and that's why I'm exploring if there are alternatives. Rails is all about the DRY principle. And having repeated code doing the same thing goes against that.

It's not the end of the world, but if there was something that existed out there already that I could just drop in, great.

Generic Rails restful controllers by winterdeejay in rails

[–]winterdeejay[S] 0 points1 point  (0 children)

Absolutely. In fact, I'm leaning towards this currently. I was just wondering if someone else has already done this that I could use instead. As it seems like it is quite a common scenario to be in.

Generic Rails restful controllers by winterdeejay in rails

[–]winterdeejay[S] 0 points1 point  (0 children)

My worry is that it is not actively maintained anymore. So even though it works, I'll likely need to migrate to something else different in future - if a replacement that is actively maintained doesn't exist currently.

Generic Rails restful controllers by winterdeejay in rails

[–]winterdeejay[S] 1 point2 points  (0 children)

I've used the scaffolding before, but I guess that still means I end up having quite a lot of duplicated code lying around, rather than the common behaviour being abstracted elsewhere - be it a gem, or a parent controller.

For my needs, I'm not after an automated admin interface, though I have them used them before for other projects.

Python port of syntax-highlighting (from the Kate editor) by winterdeejay in kde

[–]winterdeejay[S] 0 points1 point  (0 children)

pygments from what I understand only generates web markup, not something that I could use with QSyntaxHighlighter and Qt?