RiotTS
RiotTS copied to clipboard
No npm ?
Hello,
I wonder why this nice package isn't published on npm ? It surely is more standard then bower nowadays. Anyway, it wouldn't hurt.
Thanks, Howe
agree 100%, I am just waiting for Typescript 2.0 because UMD Module Loaders will make it more easy to publish a package as a module or in the global namespace (without manually writing definition files).
Typescript 2.0 just came out. See: https://blogs.msdn.microsoft.com/typescript/2016/09/22/announcing-typescript-2-0/
Will RiotTS be published as a npm package in the near future?
@pcssi See riot-typescript. /cc @howesteve
@sandrokeil Thank you!
@pcssi You're welcome. Have you used the npm version? I've some problems see #36 I'm not sure how to use it correclty. Have you tried the Timer example or can you give me a hint?
I'm trying to make a npm package out of RiotTS right now but there are several issue because it seems that there is no easy way to publish a library as a module and as a script at the same time. I'm experimenting with UMD modules...
@nippur72 Thanks for the info and your work! :+1:
I've migrated the whole package to npm and TypeScript 2.0, please check the documentation again as there are some small breaking changes. I did my best to make it work in both scenarios (global and module) but I'm not sure of the result. Suggestions are welcome.
@nippur72 Thank you very much for your work. :+1: Hope I can try it soon. Is it possible to avoid the any type, because otherwise you must use "noImplicitAny": false. But I don't know, if it's really needed to avoid any.
@sandrokeil what do you mean with avoiding the any type?
@nippur72 If you use "noImplicitAny": true the error occurs: error TS7006: Parameter 'opts' implicitly has an 'any' type.. I've this config from the webpack/react tutorial.
noImplicitAny: true = Raise error on expressions and declarations with an implied ‘any’ type.
@sandrokeil that's quite correct, you are telling typescript that you don't allow implicit any types, so you can't write:
constructor(opts) { }
you have to make it explicit, e.g.:
constructor(opts: any) { }
or better:
interface HelloTagOpts {
greet: string;
}
class HelloTag extends Riot.Tag {
constructor(opts: HelloTagOpts) { }
}
btw, forgot to tell I've updated also the helloworld examples, you might want to check example-global and example-module.
update: I've fixed some any signatures, so please use the latest 1.0.10