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

Don't use declare module for TypeScript types #127

Merged

Commits on Jul 7, 2017

  1. Don't use declare module for TypeScript types

    As I understand things, the `declare module` TypeScript syntax creates a
    globally-importable name and says that any import with that name maps to the
    given type. This means it usually works for libraries, but breaks down when
    you have multiple versions of the same library loaded, since they each redefine
    the same global name. It's really meant for things like Node.js built-in
    modules. Instead, `.d.ts` files in libraries should just do exports at the
    top-level, and TypeScript allows different versions of the same library to
    peacefully coexist in that case.
    
    I ran into a dependency hell problem that I think was caused by this issue where
    decaffeinate pulled in three different versions of magic-string that conflicted.
    I was able to change the dependency tree so it's just one version, which works
    in the near term, but this change should prevent that from happening again.
    alangpierce committed Jul 7, 2017
    Configuration menu
    Copy the full SHA
    d6082d7 View commit details
    Browse the repository at this point in the history