typed-typings / npm-mz

Typings for https://github.com/normalize/mz
ISC License
0 stars 0 forks source link

Use `Promise` from `any-promise`? #1

Open blakeembrey opened 8 years ago

blakeembrey commented 8 years ago

This module doesn't require global typings in production, it'd be good to type it for ES5 without typings and use the ES6 typings instead.

felixfbecker commented 8 years ago

I see any-promise typings are included in the NPM package. Would it be enough to add this at the top of every file?

import Promise = require('any-promise')
blakeembrey commented 8 years ago

Sadly, only if the user also included any-promise. Probably the best solution is to bundle es6-promise or any-promise typings. I don't suppose you've been using either of them with 2.0? After that Bluebird PR, I suspect they are both also broken.

felixfbecker commented 8 years ago

But any-promise is a dependency of mz, so it is in node_modules? No, I'm still on TS1.8. What happened to Bluebird?

blakeembrey commented 8 years ago

Oh, sorry, was https://github.com/types/npm-bluebird/pull/29. Why would someone have path-to-regexp installed? Just to check, this is mz.

Edit: Also, there's definitely no Promise lib inside of path-to-regexp, going to assume you meant mz there. In that case, you're assuming NPM v3-style installation always which is scary. There shouldn't be any implicit dependencies, things can easily break that way.

felixfbecker commented 8 years ago

Sorry, it's late. I meant mz. Edited my comment.

felixfbecker commented 8 years ago

If you want to add it as a dep go ahead :) I use target: ES6 everywhere so as long as it is compatible with native promises I'm fine with it