Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

How well can hapi apps leverage Typescript?

Open
#11 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Stale
Tech stack
typescript
Domain
backend

Research direction

Start by reviewing the repository's Hapi and TypeScript setup, then trace how registered server methods, app settings, plugin events, and route pre-processing methods are represented. The issue is asking for broad guidance on static typing and Hapi design rather than naming a file, test, or bounded documentation change; done would require an agreed scope and documented answers.

Written by the indexing model from the issue text.

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!

Dominant language
TypeScript
Stars
353
Forks
99
PR merge metrics
No merged PRs in 30d

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dwyl/hapi-typescript-example

All issues in dwyl/hapi-typescript-example

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.