-
Notifications
You must be signed in to change notification settings - Fork 50
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
Convert to UMD Definition Files for TypeScript #46
Comments
By "UMD" definitions, you mean generating a |
Yes. |
Ok, I have been able to generate valid
So currently, the global typings work under classic resolution with an AMD loader (and in theory a SystemJS loader) that has been configured properly. The modular typings though currently require either "ugly" MIDs everywhere. Also, because the distributions do not include the emitted modules as relative to the root of the package anymore, it breaks a CJS loader, as I am not sure there is any way to re-root the CJS loader. On the other hand, the CJS loader could easily just utilise the |
I have taken TypeScript 1.9.0-dev.20160528-1.0 for a project which has a build of {
"compilerOptions": {
"baseUrl": ".",
"paths": {
"dojo-core/*": [ "./node_modules/dojo-core/dist/umd/*" ]
}
}
} And the compiler was able to resolve all the absolute modules (e.g. This still doesn't necessarily help those consuming in NodeJS, though we should be exporting our public facing APIs in packages in a import { on } from 'dojo-core';
console.log(on); So my thinking at the moment is that we start migrating to TypeScript 2.0 before it is released. We can pin to a particular pre-release version at the moment. It does mean we would need to utilise the pre-release version until TS 2 is released (likely to be within a few weeks of this writing). |
@kitsonk can this be closed, now that either PRs have landed or they are ready for merge? |
Currently our definitions are exported in a way that are considered "global" by current type acquisition engines, although we have never worked that way. There is a way to define types now as "UMD" definitions, which will effectively mirror the module structure of the code and create definitions that can be better consumed and namespaces by resulting packages.
The text was updated successfully, but these errors were encountered: