Di

Dipstick – A new way to DI in TS

Hacker News

Dipstick – A new way to DI in TS

For whatever reason, every attempt at DI in this language that I've found over the last few years is more-or-less a port of an existing DI framework for languages like C# or Java/Kotlin, but they leave a lot to be desired. JS doesn't have TS types at runtime, so these frameworks tend to hack around that idea by muddying up source code with `@Decorators` or creating unique tokens to represent types. I personally find these hacks to be pretty ugly. What's worse, they violate the principle of least surprise (especially for devs who aren't familiar with DI), and they often result in code that's not type-safe! Dipstick takes a totally different approach, which leverages the type system and code generation. - Simple. There are only two concepts to learn about: Modules and Bindings. - Obvious. Want to see where a class is instantiated? Let your IDEs tools do the work. No tricky reflection or abstraction here -- just readable, generated code. - Modular. Define multiple modules and compose them together to keep code organized. The framework is still really young, and currently only supports classes (boo), but if it gets some traction, I will update it to support injecting functions or other literal values. I'd really love some feedback to make this thing better!

Share card

Actual performance

2points
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: new, code · Missing: mac, agents, macos
86%86% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Indie HackersFits the IH revenue-focused audience · Strong signals: supports · Missing: reddit linkedin, podcasting, created
79%79% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Strong signals: personal, way · Missing: mobile apps, ios, entrepreneurs
50%50% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Hacker NewsMay not resonate with HN audience · Strong signals: exist, existing, ide · Missing: https docs, excited, just released
40%40% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
28%28% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
20%20% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

A
A new way of ORM in Java65%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

A new way of ORM in Java

Hacker News53
A
A new way to do footnotes61%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

A new way to do footnotes

Hacker News59
A
A new way of eating out – by dropping in61%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

A new way of eating out – by dropping in

Hacker News39
Za
Zaundy, the new way to get your voice out50%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Zaundy, the new way to get your voice out

Hacker News1
Nyra
Nyra11%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

New way to social.

Indie Hackers
Ch
ChattySurvey – a new way to discover PMF36%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

ChattySurvey – a new way to discover PMF

Hacker News2
Le
LeapFM - A new way to find music59%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

LeapFM - A new way to find music

Hacker News17
Ne
New way for connect GoPro to OBS wireless55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

New way for connect GoPro to OBS wireless

Hacker News1
Ne
New way to find and book venues66%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

New way to find and book venues

Hacker News1
Al
Alexandria, a New Way to Read the Classics35%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Alexandria, a New Way to Read the Classics

Hacker News3