electricessence / TypeScript.NET

A JavaScript-Friendly .NET Based TypeScript Library (Moved)
https://github.com/electricessence/TypeScript.NET-Core
Other
251 stars 36 forks source link

module load error in VS2015 node console application #47

Closed GaikwadPratik closed 7 years ago

GaikwadPratik commented 7 years ago

Hi,

I'm following the steps that you had shown in the video. However I'm using VS2015 instead of WebPack. I'm trying to use the library in a console nodejs project in VS2015. I've installed the library using npm. However it is giving me below error.

Error TS2307 Cannot find module 'typescript-dotnet-umd/dist/es6/System.Linq/Linq'.

Could you please help me out here in resolving the error?

Also can you please update the documentation with examples from JSON and other functions such as where, find, filter etc?

electricessence commented 7 years ago

First thing. This is invalid. typescript-dotnet-umd/dist/es6/System.Linq/Linq

This should work: typescript-dotnet-umd/System.Linq/Linq

But there's a curiosity. Do you want to use es6? Then change your dependencies to the es6 dist: typescript-dotnet-es6/System.Linq/Linq

GaikwadPratik commented 7 years ago

I figured that out. If possible can you correct the documentation at below link?

https://github.com/electricessence/TypeScript.NET/tree/master/source/System.Linq

Also can you please explain what is the difference between umd and es6 modules?

electricessence commented 7 years ago

https://github.com/electricessence/TypeScript.NET/commit/da1f7b047a5e39dcf617f24e4498e74ff8cf25d4 Fixed this.

electricessence commented 7 years ago

Sorry that it was out of date. :(

electricessence commented 7 years ago

Sure... https://www.youtube.com/watch?v=kCmjN5_wVZU

ES6 isn't compatible (yet) with everything. But if you are doing a NodeJS console project, then it's a great way to go if you have the latest NodeJS version that is ES6 compatible. And you'll obviously be able to happily leverage Async/Await :)

UMD (Universal Module Definition) is compatible with both Node (CommonJS) and Web (AMD and static loading). But I have found that WebPack can have trouble with UMD so if you do move to WebPack, it's probably better to use CommonJS (or I think AMD works too) specifically.

electricessence commented 7 years ago

Did I answer all your questions and resolve all your issues?

GaikwadPratik commented 7 years ago

Yes. Thank you for clarifying the all the doubts. and It's an awesome library that you have written.

electricessence commented 7 years ago

@GaikwadPratik Thanks! It helps me too. :) I'm just glad there's even 1 person else that it helps.