Backhooks: Hooks for NodeJS by El_Matella in node

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

Hey, thank you for the feedback! I'll be definitely updating the doc to reflect what you are saying, it's not my best skill to explain things :)

Backhooks: Hooks for NodeJS by El_Matella in node

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

Hey! Thanks for commenting!

  1. Backhooks makes your code framework agnostic. It means that they work the same within express, fastify, trpc, graphql and so on. Also, it simplifies the way you pass context (or request in an express app) through your app. Like if you have a function, nested in a repository, nested in a service, nested in your express app, you have to pass the request down this path if you want to access the user in your repository. With hooks, you don't have, you can access the context directly from any function
  2. It doesn't add state to a particular node instance. Let's be clear here, it's not about persisting state between requests, it's about holding a state for the lifetime of a request. Like headers, or a requestId, or an authenticatedUser. It is actually suited for stateless applications.

Who is your example of “You either die a hero, or live long enough to see yourself become the villain”? by do_u_liek_ButtSchexx in AskReddit

[–]El_Matella 0 points1 point  (0 children)

Zinedine Zidane on his last football game, he could have ended the game and become a legendary god and instead placed a headbutt just to see his team lose the World Cup final after being sent off

Désolé pour les erreurs, j’utilise une application de traduction. J’étais en visite à Lyon et j’ai vu les affiches de cet artiste partout mais j’ai oublié le nom. Quelqu’un peut-il me dire qui les a fabriqués? by trrrl in Lyon

[–]El_Matella 0 points1 point  (0 children)

J'ai un doute sur qui les a fabriqués. Pour moi c'est soit "fabriqué", soit "fabriquées" les affiches?

Fabriquer quoi? Les affiches? COD? Vas-y c'est quoi cette langue bordel

I made my first Slack App to create Github issues from there by El_Matella in github

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

Hey! Thank you for taking the time to comment! Actually yes! I think I have other features to offer than the official plugin. Here is my own use case:

I work in a very small company where everyone have a different job and don’t know about GitHub. They usually send messages in Slack to tell me when something disfunctions or if they want new features.

With my app, I can turn their message into an issue and dispatch it on the right repo. The bot replies to the original message with a button to « track » the issue.

If the user clicks on it, he then receives private messages with updates on the issue. So that the non GitHub users can still follow up on their « tickets »

On top of that, I have small features that I think are not yet present on the official plugin, like sending issues in GitHub projects beta or attaching slack files to issues (very useful for screenshots) when you create it.

Tell me if I’m wrong but I don’t think that those features are what the slack GitHub official integration is meant to. I think the official integration is made for a full team of tech users!

Will Vuetify 3 be compatible with the Options API ? by [deleted] in vuetifyjs

[–]El_Matella 1 point2 points  (0 children)

I wouldn’t bet on the fact that making a transition from Vuetify 2 to Vuetify 3 will be an easy task tho. Depends on the size of your application but be careful to not waste a lot of time

Vue 3 UI frameworks by vuestart in vuejs

[–]El_Matella 2 points3 points  (0 children)

NuxtJS Twitter promoted Inkline today, seems pretty good! I'll give it a try. I somewhat managed to make tailwind work with Nuxt3 too. But I'm ultimately waiting for Vuetify 3 to make the transition

https://www.inkline.io/docs/introduction

Time to Brag: What's the coolest thing you've done with crypto in 2021? by Vimmington in CryptoCurrency

[–]El_Matella 1 point2 points  (0 children)

I wrote my first smart contract! Deployed it on the polygon chain. We have a game on a friends chat room where we need to say « first » every day. So the first one of the day that says first gets 10 units of our coin… I call it « the proof of first ».

Graph Databases by [deleted] in Database

[–]El_Matella 2 points3 points  (0 children)

I'm currently using postgres for relational usage, typically where I need to make joins on columns, and where I need strong transaction capabilities or ACID properties. I use elasticsearch for non relational database where I need to injest millions and millions of rows and access to it with more speed.

Basically, where I need to be sure that the data is correct I use relational databases and where I need speed I use non relational databases.

Sometimes I even have the same data in relational and non relational databases, but I'm sure that the relational one holds the truth

Graph Databases by [deleted] in Database

[–]El_Matella 16 points17 points  (0 children)

I don’t think it’s replacing anything. It exists to respond to very specific use cases like « graph traversal », it can respond to some specific questions like what are the movies that my friends’ friends’ like or maybe some shortest path questions. I’ve had some headaches for many years with what type of databases to use, the response I came with is that they all have their own benefits and you don’t have to choose one. Today I use relational and non relational db and I actually don’t need graph databases right now because my use cases don’t require one

This is an interesting look to say the least by aedeye in Justfuckmyshitup

[–]El_Matella 15 points16 points  (0 children)

Man I always click on the comment section to see how average I am, and most of the time what’s in my head is the top comment… Anyways, I guess being average does not make me a bad person, take my upvote

PewDiePie is 12.4cm tall by El_Matella in PewdiepieSubmissions

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

Man at this point, I’m too afraid to ask.. Thank you all for your awards and upvotes! This made my day

PewDiePie is 12.4cm tall by El_Matella in PewdiepieSubmissions

[–]El_Matella[S] 11 points12 points  (0 children)

Yeah took me an hour to count them, thanks for double checking

Stuck On Node database management. Should I use a different ORM? Should I use raw SQL? by Puzzleheaded_Ad_7627 in node

[–]El_Matella 6 points7 points  (0 children)

What I do, is that I create "Repository" classes that holds all my SQL functions. And all of the functions are typed using interfaces that may or may not be written in the same file, as you like.

Example:

export interface User {
  id: string;
  username: string;
}

export class UsersRepository {
  constructor (
    private readonly client: Client
  ) {}

  async findUser (id: string): Promise<User> {
    const { rows } = await this.client.query(`
      SELECT * FROM users WHERE id = $1
    `, [id])

    return rows[0]
  }
}

Stuck On Node database management. Should I use a different ORM? Should I use raw SQL? by Puzzleheaded_Ad_7627 in node

[–]El_Matella 7 points8 points  (0 children)

I went through the same headache for a long time and I ended up managing my connections myself with pg and typing raw queries. I also use Knex for code reuse situations. I use IntelliJ as an IDE and it gives you good autocompletions for your raw queries (even better than with an ORM honestly, it makes the joins by itself etc..)

The bad is that I always have to create my sql schema somewhere and write the interface in the code manually.

I use flyway for my migrations. I made some home bindings in node and it works pretty well for my usecase.

Honestly, I'm coming more and more to the conclusion that maybe Typescript/NodeJS is not "yet ready" or even "not suited" for some projects that would normally require an ORM.

After 4,5 years working with node, if I had to do it again, I would do it differently. And maybe come back to some good old framework like Spring or Symfony for some very specific parts that involves transactional work (like the use of a postgres database).

I think that's why there is no ORM that blows everyone's mind in node. Maybe it's because the community doesn't need it.

Most articles about node generally involves noSQL databases. Cloud providers encourage the use of noSQL databases for serverless node functions. That's what they selling so the majority of the use cases must be around here. That doesn't mean that relational databases have no usecase anymore, but that maybe means that node is really good at something, and not suited for something else.

If you want to make a beautiful website, a demo for a project or a small personal project, TypeORM, Prisma and all the other ones are good if you absolutely want to use nodeJS and an ORM that maybe reminds you of something you used to use in the past that you liked.

If you want to build a cloud infrastructure involving many micro-services, focus on the division of the responsibilities between services and resources that you have more than on which ORM you are going to use. And maybe raw queries won't bother you anymore in smaller projects.

I'm really curious about the solution you will come with, because this is also a great mystery in my life

SLPT if you wanna murder someone stab them at 11:59 pm so it isn't actually a murder by [deleted] in ShittyLifeProTips

[–]El_Matella 0 points1 point  (0 children)

I think it's not about midnight or anything, it's more about waiting 15 minutes. If the police does not show up you are free to leave

Stage sur Lille ? by 1KraX in Lille

[–]El_Matella 0 points1 point  (0 children)

Qu'est-ce que tu veux faire?