dwyl / dwyl/hapi-typescript-example

How well can hapi apps leverage Typescript?

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
354
Forks
99
PR merge metrics
No merged PRs in 30d

Description

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!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.