Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MobX into Typings registry #522

Closed
gamtiq opened this issue Aug 29, 2016 · 6 comments
Closed

Add MobX into Typings registry #522

gamtiq opened this issue Aug 29, 2016 · 6 comments

Comments

@gamtiq
Copy link

gamtiq commented Aug 29, 2016

It would be very helpful to add mobx into Typings registry.
In my project I use TypeScript with JSPM. So TypeScript compiler cannot find mobx without typings.
I know that it is possible to install mobx typings via typings install mobx=https://npmcdn.com/mobx/lib/mobx.d.ts (thanks to the comment in #203).
But having mobx in Typings registry would be more user-friendly (I experienced some difficulties until I found #203).

@mweststrate
Copy link
Member

The package ships with typings out of the box which are picked up
automatically by TS 1.6+, you should not need to install typings, just
directly import from mobx

Op ma 29 aug. 2016 16:55 schreef Denis notifications@github.com:

It would be very helpful to add mobx into Typings registry
https://github.com/typings/registry.
In my project I use TypeScript with JSPM. So TypeScript compiler cannot
find mobx without typings.
I know that it is possible to install mobx typings via typings install
mobx=https://npmcdn.com/mobx/lib/mobx.d.ts (thanks to the comment
#203 (comment) in #203
#203).
But having mobx in Typings registry https://github.com/typings/registry
would be more user-friendly (I experienced some difficulties until I found
#203 #203).


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#522, or mute the thread
https://github.com/notifications/unsubscribe-auth/ABvGhHS_50GFM6cGeA9gAOt-xgyNhazaks5qku7ugaJpZM4Jvio-
.

@gamtiq
Copy link
Author

gamtiq commented Aug 29, 2016

Unfortunately in my case it doesn't work because of the following settings in tsconfig.json:

  "exclude": [
    "node_modules",
    "jspm_packages"
  ],

MobX is installed inside jspm_packages by JSPM.

@mweststrate
Copy link
Member

Argh! can typings handle non ambient typings in the first place?

Op ma 29 aug. 2016 17:17 schreef Denis notifications@github.com:

Unfortunately in my case it doesn't work because of the following settings
in tsconfig.json:

"exclude": [
"node_modules",
"jspm_packages"
],

MobX is installed inside jspm_packages by JSPM.


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
#522 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABvGhNxeNbqOE-1MaGli_LcgAbDuNr1vks5qkvglgaJpZM4Jvio-
.

@mweststrate
Copy link
Member

I doubt this is something that needs fixing on the MobX side of things (ambient declarations / decoupled declarations are really a downgrade of the current system, opening up a can of worms regarding maintenance, versioning etc). Would you mind checking whether these treads offers an acceptable solution / work around? microsoft/TypeScript#6012 jspm/jspm-cli#1476

@gamtiq
Copy link
Author

gamtiq commented Aug 30, 2016

First of all I should say that I'm a newbie regarding JSPM and TypeScript.
Thank you for the links. I have scanned them quickly. It seems it is possible to work around typings install by using baseUrl and path mappings settings as described in microsoft/TypeScript#5039 and in Additional module resolution flags. I have missed this because I studied only official documentation from http://www.typescriptlang.org
I have not tried yet a possible workaround but I have the following concern in relation to it. If I understand correctly, it is necessary to specify package versions in directory names (see this comment, for example). At least it is inconvenient and can lead to problems when a package is updated. So I would stick with typings install.

@mweststrate
Copy link
Member

Although I see your problem, I put a won't fix on this one. First, I suspect JSPM will address this issue. Secondly, maintaining such a typing is very tedious, especially since MobX provides good standardized typings by itself already. If someone from the community wants to submit typings though, he is welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants