Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

218
Visualizações
share type definition of frontend and backend

I start to use typescript in my frontend and backend (node.js), and I notice I've duplicated type definitions like the API response. What's the best way I can share it when we have 2 teams working on the product?

about 4 years ago · Juan Pablo Isaza
3 Respostas
Responde à pergunta

0

One option would be to put all of the shared types into its own .ts file or a private repository shared among the teams, so that both can import it.

The repository route is probably the more maintainable solution, since it'll allow for multiple files (very useful in large projects) and is easier with its own source control.

about 4 years ago · Juan Pablo Isaza Relatório

0

Use a library like BFF Pattern https://blog.bitsrc.io/sharing-types-between-backend-and-frontend-with-the-bff-pattern-553872842463

about 4 years ago · Juan Pablo Isaza Relatório

0

Note: I’m one of the authors of Remult

If you’re looking for a way to efficiently share TypeScript code between FE and BE and have a type-safe way to query your API from the FE (without code generators) I suggest you try something like Remult

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda