Skip to content

How well can hapi apps leverage Typescript? #11

@jtlapp

Description

@jtlapp

Hello. Thank you so much for doing this. I'm a long-time Java dev, and after creating my first Express server in vanilla JS, I vowed to never again do without static type checking.

I'm drawn to hapi for a number of reasons, but the more I read, the more worried I get that I wouldn't be able to leverage strong type checking.

How do you get static type checking in the following areas?

  • registered server methods
  • registered app settings
  • emitted plugin events
  • route pre-processing methods

It also seems to me that hapi goes out of its way to avoid the benefits of CommonJS, winging its own solutions that seem less optimal. There's no need for hapi's cross-plugin global namespaces. I don't see why module scoped variables have to go in internals, which is itself module-scoped.

I've only written demo hapi servers so far, am trying to decide whether to proceed. What can you tell me about the pros and cons of trying to get static type checking on top of hapi?

Thanks for any help you can provide!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions