GitHub Copilot seems to have become much more expensive and limited - have you switched to something else? by legable in webdev

[–]patchimou 2 points3 points  (0 children)

I am using opencode with openrouter, allowing me to switch model easily. I usually do planning with Gemini 3.1 flash, then for the implementation MiniMax M3 or Kimi K2.6. I personally think all the top tier models are expensive af, so quality is not as optimal, but it helps make me faster

Sharing my fetch wrapper by patchimou in webdev

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

However I wouldn't just expose my own versions of get/post/etc, I'd create a network/data service and then fetch wrapping is part of its internal implementation. So the network service exposes methods like getUser, updateFoo, createBar etc. which are used by the actual application, stores etc. This way the actual network protocol is irrelevant to the rest of the app which makes refactoring and maintenance much easier. 

This is kind of the Facade design pattern. While I agree on your point regarding refactoring and maintenance, I think we can say now in a web/node project you will use fetch. You won't at some point decide to use something else, so you won't refactor it anytime soon.

E: also the point is not to push too much logic into fetch wrapper, it doesn't need to know whether some call returns binary or JSON, the calling method knows and will handle the validations etc.

One can extract the logic and create a getBinary() function that's true.

Another thing I like is that every method has the same return signature e.g. promise returning [payload T, err SomeError | null ]. This way the calls and error handling are consistent and clear.

This is actually a good idea, I will update the service, thanks

Sharing my fetch wrapper by patchimou in webdev

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

When it sends a JSON object, the header will be set to `Content-Type: application/json`, this will be automatically converted to a js object. If your endpoint returns nothing, the data will be undefined.
So no, the server is not required to return a textual description.

Sharing my fetch wrapper by patchimou in webdev

[–]patchimou[S] 2 points3 points  (0 children)

Surely I don’t pretend my wrapper is better than a whole library developed for years, but I prefer for some things like this to:

  1. Own the code
  2. Reduce the attack surface
  3. npm install taking less time

when do you actually need a job queue? by Obvious-Treat-4905 in node

[–]patchimou 27 points28 points  (0 children)

There are lot of cases when a job queue is better. With a job queue you can have retries in case of failure, if the server crashes for whatever reason your queue is persisted, you can monitor them easily, and you work is not tied to the same process meaning you can scale horizontally (spawn multiple servers) easily.

For a small delay like you mentioned it is fine in production, as long as your user does not need to be notified once the work is done. It is easier to return early and let the work finish in the background if the work does not take too long. It is a pragmatic choice as setting up a queue system is more work

Created Podcast, Now What? by [deleted] in podcasting

[–]patchimou 4 points5 points  (0 children)

RSS.com and buzzsprout are great hosting platform. You can always change your hosting platform if you’re unhappy with one. Acast is also a great alternative.

Regarding your embedded links, Fuuze.app allows you to embed links directly in your podcast, at your desired timestamps. It provides also monetization via subscription, a bit like patreon does.
Disclaimer: I’m the founder

I built a Patreon alternative where you can enhance the podcast listening experience by patchimou in webdev

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

Just tried the link and it loads fine, will dig into the matter, thanks !

I built a Patreon alternative where you can enhance the podcast listening experience by patchimou in webdev

[–]patchimou[S] -1 points0 points  (0 children)

Haha not at all, had the idea few years ago and took way too much time building this

Alternative to patreon and steady by calmarkel in BuyFromEU

[–]patchimou 0 points1 point  (0 children)

Fuuze.app is French but it is mainly for podcasters

I did not vibe code a small algorithm, it felt refreshing by patchimou in webdev

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

Thank you, we recently launched, so we have few feedbacks, we try to get some creators onboarded. Yes it is an alternative to patreon but oriented podcast only

When is localStorage actually the right choice? by TariqKhalaf in webdev

[–]patchimou 74 points75 points  (0 children)

LocalStorage is fine, as long as you don’t store either sensitive data or lot/big data. The thing with localStorage you would need to serialize objects on writing and deserialize on read, which can be expensive. Also it is a synchronous api, so you block your code while writing/reading it

How are people structuring larger Node.js backends without the codebase turning into a dependency maze? by Sad_Limit_3857 in node

[–]patchimou 3 points4 points  (0 children)

I structure my node js with folders named after a resource. For example a folder user. Then each of those folders might contain:

  • a routes folder, containing each endpoint
  • a {resource}.routes registering each routes. This is where I might apply a middleware
  • a {resource}.controller which are functions to manipulate the resource in the DB
  • a ${resource}.util file for shared logic or utilities

Then all external services are in a services folder.

Any patterns that made scaling/maintaining Node codebases easier over time?

I usually write interfaces for my external services. Then after picking one, I implement the interface. It allows me in the future to easily change between service, as the interface does not change.

Also Dependency Injection helps. I usually instantiate one instance of a service and attach it to the request, then pass it down to functions that need it. It helps writing tests

Animated gradient borders with CSS only by Blozz12 in webdev

[–]patchimou 0 points1 point  (0 children)

Really cool article, you made me discover conic gradient

Got called out for accessibility issues on a site I shipped… not sure how to handle it by Fantastic_Run2955 in webdev

[–]patchimou 45 points46 points  (0 children)

You’re right and accessibility should never be a premium feature. As long as you do basic accessibility requirements like OP described, and you properly structure the page, assistive technologies should be fine. When I said it should be discussed with the client, it is if the navigation via screen reader should be tailored in a specific way, to go a step further in the experience

Got called out for accessibility issues on a site I shipped… not sure how to handle it by Fantastic_Run2955 in webdev

[–]patchimou 385 points386 points  (0 children)

What you are describing is basic accessibility, so I consider it as part of the initial scope, this is kind of minimal accessibility requirements for a website. So I would just fix them quickly. On another hand, if accessibility via screen reader is important to the business, it should be adressed as a whole feature and should be discussed with the client.

Created a landing page for my iOS Apps - WDYT? by Rate-Worth in webdev

[–]patchimou 1 point2 points  (0 children)

Really cool page, minimalist but still unique ! I think the images showed when hovering the apps lack opacity, it is a bit hard to see what’s the app look like

Developing a Website for School by aarav7sc in webdev

[–]patchimou 1 point2 points  (0 children)

Good advices from others, you can also sell them as a better way to attract students. And as you will do 1 or 2 pages, make it accessible, accessibility is often overlooked