They aren’t using typings they are using the older tsd but more or less they are the same.
Maybe you can find some help there
Joanne Yae
@nyjy85
Ohhh ok I see. Thank you!! So this will be an issue if a module returns a function as opposed to an object? Hopefully other 3rd party typings arent as annoying as moment
Jamie Spittal
@Spittal
Yeah, I haven’t had much trouble with any other typings
Took me a little while to understand how and why to use them though
Growing pains with ng2.
But I really love the features Typescript gives. I come from a Java world
so strongly typed = <3
You also can expect as Angular2 raises in popularity the typings will get 1000x more reliable.
Jamie Spittal
@Spittal
Plus I think it’s getting pretty popular to write React in TS now too.
Joanne Yae
@nyjy85
@Spittal You have been such amazing help. I've been banging my head on this for days. Thank you so much!!!!
errr really?
Jamie Spittal
@Spittal
Well… TSX
Joanne Yae
@nyjy85
I get why people like typescript and i want to like it. I'm slowing starting to appreciate it
Jamie Spittal
@Spittal
Yeah, it’s a little more writing forsure. But once you start really taking advantage of interfaces, abstract classes, super classes you will really see the benefit.
_
For example I have an abstract class for a component that animates a background. I use that as a super class for several other components in my app. Using normal JS that would be such a hassle.
but now it’s dream
rvalimaki
@rvalimaki
Hi, am I the only one to get "RangeError: Maximum call stack size exceeded" when trying to serve compiled bundles? webpack-dev-server works fine, more or less.
Seems that development build (npm run build:dev) is working for me on this regard. It's only build:prod, that's giving me that maximum call stack size exceeded.
Joanne Yae
@nyjy85
How can i make a third party library into a global variable so that I don't have to import or require it in individual modules? For example, I want lodash to be globally available. How do i configure webpack to do this?
I tried to alias it like this : alias: { lodash: path.resolve( __dirname, './node_modules/lodash') }
then added a new plugin: new webpack.ProvidePlugin({ myLodash: "lodash", })
but it doesn't work
Ben
@sysupbda
I was about to say that I use DI for such cases
Joanne Yae
@nyjy85
What is DI?
Ben
@sysupbda
But in fact I don't really have such cases anymore :)
Dependency Injection
I used lodash a lot in ES5, but there are only very few things I would be missing in ES6 that would justify me still using lodash with typescript or ES6
Not sure how you could DI an entire module though to be honest
Joanne Yae
@nyjy85
well, you can do it with jquery
but it only works for jquery -_-;; and i dont know why
Ben
@sysupbda
With the alias logic you mentioned?
Joanne Yae
@nyjy85
for some reason you don't need an alias for jquery
new webpack.ProvidePlugin({ jQuery: 'jquery', $: 'jquery', jquery: 'jquery' })
thats all you need
Ben
@sysupbda
you've made me curious. Would like to see what others say how they would do this. But I really find it extremely rare to need a module across many components modules since typescript and ng2
Joanne Yae
@nyjy85
you're right, its rare but i use lodash and moment everywhere
would like to have it available globally without requireing it in all my components