hannahhoward / a1atscript

The Angular 2 Polyfill
MIT License
101 stars 7 forks source link

jspm support #5

Closed maku closed 9 years ago

maku commented 9 years ago

would be great to know how to use it with jspm. (I tried several ways but without success)

hannahhoward commented 9 years ago

will take a look at it :)

hannahhoward commented 9 years ago

I am working on this getting done. At the moment there is an issue with how JSPM does imports that will be fixed in the next major version. I may be able to still work around this though -- we'll see. https://github.com/jspm/jspm-cli/issues/751

maku commented 9 years ago

great, thanks for your effort

hannahhoward commented 9 years ago

Hi, I updated the package with a Common JS format distribution that will work with JSPM, and added the configs to tell JSPM to use this one. So it should now work out of the box with JSPM, with the major caveat that you have to use Babel instead of Traceur. (not sure if JSPM supports Typescript but it ought to work with that as well). The reason I can only support one is that Traceur and Babel implement @ notations differently -- traceur uses "annotations" while Babel implements the upcoming ES7 decorator spec. I use a trick in the source to get both Traceur and Babel to compile correctly to ES5 from the same source, but since I can only get JSPM to work with already transpiled code, I can only choose one. I chose Babel because decorators are the upcoming JS standard-- where Traceur's "annotations" are a custom feature not supported in any other transpiler (including Typescript). I'm closing this for now. When JSPM fixes the above referenced issue, or Traceur switches to supporting decorators, I'll make sure A1AtScript supports Traceur and JSPM out of the box. Thanks -- sorry for the long winded explanation.

guybedford commented 9 years ago

Great to hear this - hopefully in future we can get jspm to work with the untranspiled source as soon as we're more flexible with the extensions.