Inversifyjs: Using Inversify without TypeScript?

Created on 22 Dec 2016  路  6Comments  路  Source: inversify/InversifyJS

I'm not a big fan of TypeScript but I would somehow like to use this library.

Is there anyway I may use it without TypeScript? I read this blog: http://blog.wolksoftware.com/introducing-inversifyjs And it shows how to make it work with Vanilla JavaScript (and babel ofc). It doesn't seem to be working though (changes I can imagine).

Simple yes/no will be sufficient!

Most helpful comment

All 6 comments

If you are planning to use ES6 we have https://github.com/inversify/inversify-vanillajs-helpers 馃槈

@remojansen Ooo interesting! From seeing the examples I don't see ES2016 decorators anywhere, any reason for this?

Example instead of the following:

class MyClass { ... }
inversify.decorate(inversify.injectable(), MyClass);

You'd write

@injectable()
class MyClass { ... }

There are no decorators because babel decorators and typescript decorators are not compatible 馃槶 this will be fixed in a few months when the T39 finish the decorator standard. Also we created the helpers not only for babel users but also for ES5 users.

@remojansen Ah! Glad to hear it will be compatible in the future! :) I guess I'll stick with the vanilla helpers until then, thanks!

Three years later, is it possible to use Inversify without TypeScript in ES6+ JavaScript?

@basickarl @remojansen Do you have any information?

EDIT: Nevermind - it seems I scrolled too fast through the README and only saw the "Usage with TypeScript" section.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RastriginSergey picture RastriginSergey  路  3Comments

ashraymehta picture ashraymehta  路  3Comments

rashtao picture rashtao  路  3Comments

Deviad picture Deviad  路  3Comments

remojansen picture remojansen  路  4Comments