Story Details

  • Show HN: Zero-codegen, no-compile TypeScript type inference from Protobufs

    Posted: 2025-04-14 15:41:03

    protobuf-ts-types is a tool that automatically generates TypeScript types from Protobuf schemas without requiring any code generation or compilation steps. It leverages the Protobuf runtime library to infer types directly, offering a simpler and faster workflow for TypeScript developers working with Protobuf. This eliminates the need for separate code generation tools and keeps the TypeScript types synchronized with the Protobuf schemas, reducing potential errors. The project aims to improve developer experience and efficiency when using Protobuf in TypeScript projects.

    Summary of Comments ( 13 )
    https://news.ycombinator.com/item?id=43682547

    Hacker News users generally expressed interest in the project, praising its approach to Protobuf type generation in TypeScript. Several commenters highlighted the advantages of avoiding code generation and runtime dependencies, contrasting it favorably with existing solutions like protoc and protobufjs. Some questioned the handling of specific Protobuf features like oneof and any, and discussions arose around potential performance implications and the project's compatibility with existing JavaScript Protobuf libraries. The author actively engaged with commenters, clarifying design choices and addressing technical questions about the project's inner workings. Overall, the reception was positive, with many seeing the project as a promising alternative for TypeScript Protobuf integration.