You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, apologies for the slightly trollish title - I couldn't come up with one that was descriptive without sounding a bit ... nasty. Anyway.
Technically this is a continuation of #73. However, since that's become something of a discussion thread I thought I'd raise a new issue so this didn't get lost in the noise.
Background first, I wanted to do this:
write TypeScript code in Atom using Atom-TypeScript (crucially without Atom actually performing the transpilation)
write React with JSX using TypeScript
write Jasmine tests in TypeScript
write unit tests featuring JSX using TypeScript
have my code type checked by TypeScript, emitted as ES6 and transpiled by Babel
have Karma run my unit tests continually (watching files)
At the time I started I was happily using Browserify and so tsify was the logical first port of call. As #73 testifies, I failed straight out the gate.
Finally I decided to see if I could get webpack working with ts-loader to do the same thing. I succeeded and globalize-so-what-cha-want is now built with Webpack.
I wanted to pass on what I've learned as I've tried to get tsify working on my project.
These are the problems I've had:
tsify doesn't pay attention to files property in tsconfig when it comes to typings / d.ts files. As a consequence you have to directly supply them to karma.
tsify doesn't seem to work well with Karma. I'm ending up with these errors when I have tsx files in the mix.
25 10 2015 09:52:39.849:ERROR [framework.browserify]: bundle error
25 10 2015 09:52:39.849:ERROR [framework.browserify]: TypeScript error: Error TS6054: File 'test/demo/components/Module.
tests.tsx' must have extension '.ts' or '.d.ts'.
tsify doesn't seem to respect tsconfig.json very well straight out of the box. @basarat has alluded to this here. In my browserify set up I'm having to force it to use the a specific tsconfig.json which kind of blasts you out of the water when you have several of these in play to enforce difference compilation contexts. This may be what's causing my Jasmine pain. Also, it's not obvious that you have to do this. It was only down to @basarat having a play with the project that I got it that far.
That's all for now - hopefully tsify can evolve to be more "seamless". I did actually manage to get tsify compiling typescript with babel which is great. But testing wasn't a go-er and I can't live without it. I'm sure these issues can be overcome and I'm happy to try and help if I can. Here are the reference repo's:
First of all, apologies for the slightly trollish title - I couldn't come up with one that was descriptive without sounding a bit ... nasty. Anyway.
Technically this is a continuation of #73. However, since that's become something of a discussion thread I thought I'd raise a new issue so this didn't get lost in the noise.
Background first, I wanted to do this:
At the time I started I was happily using Browserify and so tsify was the logical first port of call. As #73 testifies, I failed straight out the gate.
Finally I decided to see if I could get webpack working with ts-loader to do the same thing. I succeeded and globalize-so-what-cha-want is now built with Webpack.
I wanted to pass on what I've learned as I've tried to get tsify working on my project.
These are the problems I've had:
files
property in tsconfig when it comes to typings /d.ts
files. As a consequence you have to directly supply them to karma.tsx
files in the mix.tsconfig.json
very well straight out of the box. @basarat has alluded to this here. In my browserify set up I'm having to force it to use the a specifictsconfig.json
which kind of blasts you out of the water when you have several of these in play to enforce difference compilation contexts. This may be what's causing my Jasmine pain. Also, it's not obvious that you have to do this. It was only down to @basarat having a play with the project that I got it that far.That's all for now - hopefully tsify can evolve to be more "seamless". I did actually manage to get tsify compiling typescript with babel which is great. But testing wasn't a go-er and I can't live without it. I'm sure these issues can be overcome and I'm happy to try and help if I can. Here are the reference repo's:
tsloader (all working): https://github.com/johnnyreilly/globalize-so-what-cha-want
tsify (main code working, unit testing not working): https://github.com/johnnyreilly/globalize-so-what-cha-want-typescript (so named because it was my first attempt to port to typescript)
Finally, thanks for all your hard work on tsify and the help you've provided to me as I've struggled to get things up and running.
The text was updated successfully, but these errors were encountered: