nippur72 / RiotTS

RiotJS for TypeScript
MIT License
101 stars 8 forks source link

Any chance of getting this working in JSPM? #31

Open ghost opened 8 years ago

ghost commented 8 years ago

Related stackoverflow question: http://stackoverflow.com/questions/37535057/riotts-riot-ts-and-jspm-anyone-got-it-working-together

nippur72 commented 8 years ago

I will look into it.

The problem is that riot-ts actually works only with bower. Mostly I was waiting for this typescript feature of TypeScript 2.0 (hopefully to be released in mid June '16) to make riot-ts it work with modules.

ghost commented 8 years ago

Thanks @nippur72. I can install it through bower using jspm-bower-endpoint. That pulls in what you've written. However I can't seem to get your @template decorators working. i admit I am at my limit with all this configuration stuff 🎱

ghost commented 8 years ago

Ok I have figured it all out. I will publish an example in the next couple of days, if anyone is interested.

nippur72 commented 8 years ago

yes please I am interested, I struggled the whole day trying to make it work. The source of trouble was mostly TypeScript because of its way of handling modules. I hope things will improve with 2.0.

icarito commented 7 years ago

Hi, I've been struggling to get vscode to recognize the riot object. Where should I put /// <reference types="riot-typescript" /> /// <reference path="node_modules/riot-typescript/riot.global.d.ts" /> if I put my source in src/ and am building to build/? I've been following https://medium.com/@fay_jai/getting-started-with-reactjs-typescript-and-webpack-95dcaa0ed33c#.icl9kama2 more or less replacing react for riot-ts and am getting there (I can build and run my app) but vscode doesn't recognize the riot object. Any help is welcome, thanks for your work!

sidouglas commented 7 years ago

@icarito I actually installed a custom riot-ts typing for typings, that points to nippur's version of the riot-ts typing. Take a look at http://stackoverflow.com/questions/37641960/typescript-how-to-define-custom-typings-for-installed-npm-package

My typings file:

{
  "globalDependencies": {
    ...
    "riot-ts": "file:typings/custom/riot-ts.d.ts",
    "riotjs": "registry:dt/riotjs#0.0.0+20160316155526",
   ...
  },
...
}

You should only have to include the typings once in your main bundle, all other modules should "see" the references. Disclaimer: I am not using webpack, I am using browserify via gulp laravel ( hell of a lot easier )

Good luck!

sandrokeil commented 7 years ago

@icarito I just pushed a PR to the examples repo with a working webpack example. /cc @sidouglas

icarito commented 7 years ago

@sandrokeil thank you a lot, as I learn I will try to be helpful in any way I can!

@sidouglas thanks for your help as well! you sent me looping in another round of tooling uncertainty, for now I'll stick to webpack but I appreciate you sharing your experience!

ghost commented 7 years ago

@icarito yes stick to webpack for new projects. Laravel Elixir now supports webpack, so at some stage I will change over.