derekfinlinson/xrm-webapi

Remove unused dependenceis

Closed this issue · 2 comments

It looks like reference to @types/xrm is not actually used anywhere in the code, I believe reference to that module could be removed

Related to #2

Same interesting situation with es6-promises... When we compile typescript we don't want this library to be referenced, since we're supposed to use resulting JS in a browser. And all browsers (except IE) will already have Promise defined.

I don't know how to solve this one, since there is no conditional compilation in TS...

The @types/xrm is used to get the client URL for the requests. It's just a reference file and wouldn't be included in any compilation. As for the promise, in my particular use case, I do want it included. I'm using webpack to bundle my form/ribbon scripts so I only have to include one file in the form. There may be a better way to do it so it only uses the bundled Promise if it doesn't already exist in the browser but I haven't found a way to do that yet.