These are chat archives for TypeStrong/atom-typescript

10th
Apr 2015
Mike Graham
@cmichaelgraham
Apr 10 2015 00:00 UTC
well, in the case of aurelia, each repo has an index.js that has the public interface for the repo
Michael
@michaelsg
Apr 10 2015 00:00 UTC
I wonder if it's the start of a slight project notion for TS. I could see in a big development wanting to have some TS in one project and some in another (think VS).
Mike Graham
@cmichaelgraham
Apr 10 2015 00:00 UTC
and it would be nice to generate a .d.ts for the types exposed by that file
kinda like r.js does. you point it at a file, and it bundles up that plus all the referenced files
Michael
@michaelsg
Apr 10 2015 00:00 UTC
you think it's part of the compilation proecesss or a separate run of the compiler just to do that part.
Matt Traynham
@mtraynham
Apr 10 2015 00:00 UTC
Mike Graham
@cmichaelgraham
Apr 10 2015 00:01 UTC
yes - any mechanized way that doesn't involve me always hand copying stuff ;)
@mtraynham yes !!
Matt Traynham
@mtraynham
Apr 10 2015 00:02 UTC
:) fyi, it actually seems broken at the moment
SitePen/dts-generator#14
Michael
@michaelsg
Apr 10 2015 00:03 UTC
@cmichaelgraham I was wondering more for TS not you :-). Not that your pain isn't appreciated.
I think a final "here's everytying in this X" is a fine thing for the compiler to produce. It would make TS much more module/reuse friendly.
we have a hard enough time with getting quality dts, we should at least be able to get them from the ts compiler. ppl are not going to want trees of dts files.
Mike Graham
@cmichaelgraham
Apr 10 2015 00:05 UTC
@michaelsg yeah - for sure !!
Michael
@michaelsg
Apr 10 2015 00:06 UTC
what about output module format? Do you know why they don't have.... uh... pure es6 output format or SystemJS output format.
Mike Graham
@cmichaelgraham
Apr 10 2015 00:07 UTC
i'm sure its coming
you can gen es6 and use babel to create generate for now
Michael
@michaelsg
Apr 10 2015 00:07 UTC
when you compile to es6, it says you can't use import/export unless you use modules, which are amd and common js, which I learned not to emit es6 into. Chrome breaks loading an amd style module with es6 features in - like arrow functions.
Mike Graham
@cmichaelgraham
Apr 10 2015 00:08 UTC
ah. ok. haven't got there yet. but it is definitely on our radar. not really a solution for aurelia until we can create generate module format
Matt Traynham
@mtraynham
Apr 10 2015 00:08 UTC
if you're compiling to ES6, you'll need to use Babel or Traceur after the fact
Michael
@michaelsg
Apr 10 2015 00:14 UTC
that's a good solution. I want to try that again with all the newest stuff. Thank you, @mtraynham
Matt Traynham
@mtraynham
Apr 10 2015 00:18 UTC
although, I'd recommend just sticking with ES5 compilation, seems kind of pointless
Matt Traynham
@mtraynham
Apr 10 2015 00:56 UTC
@basarat does grunt-ts support the emitDecoratorMetadata
if I point it at a different tsc version?
Basarat Ali Syed
@basarat
Apr 10 2015 00:58 UTC
@mtraynham you can do https://github.com/TypeStrong/grunt-ts#compiler compiler: './node_modules/grunt-ts/customcompiler/tsc --emitDecoratorMetadata' Let me know if it doesn't work. This is speculation :D
Matt Traynham
@mtraynham
Apr 10 2015 00:58 UTC
:)
:(
@basarat nope.
Error: Cannot find module 'node_modules/typescript/bin/tsc --emitDecoratorMetadata'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3
Michael
@michaelsg
Apr 10 2015 01:06 UTC
:fire: trick failed!
Matt Traynham
@mtraynham
Apr 10 2015 01:07 UTC
I'll open a PR
any other options added recently?
Basarat Ali Syed
@basarat
Apr 10 2015 02:21 UTC
@mtraynham perhaps better PR "additionalCommandLine" to be future proof. /cc @nycdotnet
Matt Traynham
@mtraynham
Apr 10 2015 02:26 UTC
I was thinking the same thing
so I tried it out, didn't seem to work...
error TS5023: Unknown compiler option 'emitdecoratormetadata'.
although the log looked right with TypeScript master as the compiler:
 --sourcemap --emitDecoratorMetadata --target ES5 --module commonjs --outDir ./app/scripts
@basarat and one last thing, since I havn't looked at the grunt-ts code in a while. What's the difference between the tasks vs tasks-internal?
Basarat Ali Syed
@basarat
Apr 10 2015 02:44 UTC
Task is what you want. Task internal is LKG. It's a version of gruntts that will be used to compile the current grunt ts src
Matt Traynham
@mtraynham
Apr 10 2015 02:54 UTC
thanks!
Michael
@michaelsg
Apr 10 2015 02:55 UTC
@basarat You are using the node js tools for vs2013 project type - that solution?
Basarat Ali Syed
@basarat
Apr 10 2015 02:58 UTC
@michaelsg in grunt-ts ?
Michael
@michaelsg
Apr 10 2015 03:02 UTC
sorry, no, I meant the atom-typescript repo has a small vs project. It didn't open. But I think I recognized it. One of the nodejs tools for vs 2013 project.
Mike Graham
@cmichaelgraham
Apr 10 2015 03:03 UTC
@basarat it would be nice to be able to copy/paste the text in the cycles found on the right in dependency view - no biggie, just an idea
Basarat Ali Syed
@basarat
Apr 10 2015 03:03 UTC
@michaelsg yes. That exists from when I was bootstrapping atomts
@michaelsg no use anymore now that we use beta builds. But might come in handy
blob
@cmichaelgraham you should be able to copy them?
Mike Graham
@cmichaelgraham
Apr 10 2015 03:05 UTC
i can select, but not copy
ah, but i can drag/drop
<ctrl> c doesn't seem to work
right click gives me an atom menu about splitting
Basarat Ali Syed
@basarat
Apr 10 2015 03:07 UTC
@cmichaelgraham would you prefer "copy cycles" button?
Mike Graham
@cmichaelgraham
Apr 10 2015 03:08 UTC
i was trying <ctrl> c - but now that i found drag-drop, i'm good. might confuse others too, not sure
copy cycles button would be cool
Basarat Ali Syed
@basarat
Apr 10 2015 03:09 UTC
@cmichaelgraham cool. Added to queue TypeStrong/atom-typescript#246
Mike Graham
@cmichaelgraham
Apr 10 2015 03:10 UTC
here is where i drag/dropped :)
Matt Traynham
@mtraynham
Apr 10 2015 04:57 UTC
@basarat any way to tell atom-typescript to not compile the file on save?
oop nevermind found it
Basarat Ali Syed
@basarat
Apr 10 2015 05:35 UTC
2.14.4 gets a copy button for cycles

probably not a good long term answer

@cmichaelgraham regarding es6.d.ts. Your changes will revert whenever atom-typescript will update. Unless you copied the file into your project

Basarat Ali Syed
@basarat
Apr 10 2015 06:07 UTC
@cmichaelgraham I see you have copied the file into your project :) so all good there :rose:
Jari Pennanen
@Ciantic
Apr 10 2015 06:51 UTC
I think the TS status bar is problematic if one has multiple "projects" open in one window, then the status bar is hanging around in all "projects" (in this context I the project is just a folder)
and secondly if it's shown in all grammars once you've visited a TS file it's intrusive, imagine if other atom extensions started to add global status bars once you've visited a single grammar
though, I think there could be a option: "Show status bar when tsconfig is present" and "Show status bar only when editing TS file"
Jari Pennanen
@Ciantic
Apr 10 2015 06:57 UTC
btw, the Symbols view is now blinking, when I press Ctrl+R it blinks, and what is worse, when I start typing it still types to editor for a few seconds until it opens up for real
Mike Graham
@cmichaelgraham
Apr 10 2015 10:34 UTC
@basarat :point_up: April 9 2015 11:35 PM so does atom-typescript include es6.d.ts in the build if it isn't in the project? when i didn't have it in my project, Promise wasn't resolving...
Erwin Poeze
@donnut
Apr 10 2015 13:27 UTC
I've looked everywhere but I can't figure out how to start the dependency view. In the setting panel is says TypeScript: Dependency View which suggests I should look in Packages>TypeScript. But it isn't there. Can someone enlighten me?
Mike Graham
@cmichaelgraham
Apr 10 2015 13:45 UTC
i had the same troubles. if you hit <ctrl><shift>P and then type typescript in the textbox of the popup, then scroll down to dependency view, that should get you there. let me know if it doesn't work :)
Erwin Poeze
@donnut
Apr 10 2015 13:56 UTC
Super, I found it. Now I'm staring at a black window. Are there any other requirements to get it to work?
blank instead of black. It is actually white ;)
Mike Graham
@cmichaelgraham
Apr 10 2015 13:57 UTC
ah, gotcha. i think you have to have a .ts file open when you launch it
Erwin Poeze
@donnut
Apr 10 2015 13:58 UTC
I have. I'll try something simple first.
Mike Graham
@cmichaelgraham
Apr 10 2015 13:58 UTC
do you have import statements in your .ts files?
Erwin Poeze
@donnut
Apr 10 2015 13:59 UTC
well, only one /// reference path
Mike Graham
@cmichaelgraham
Apr 10 2015 13:59 UTC
i don't think that counts
at least for dependency graphing
here is an example
Erwin Poeze
@donnut
Apr 10 2015 14:01 UTC
ok, it works. Thanks!
Mike Graham
@cmichaelgraham
Apr 10 2015 14:02 UTC
awesome :)
Erwin Poeze
@donnut
Apr 10 2015 14:02 UTC
It's pretty cool
Mike Graham
@cmichaelgraham
Apr 10 2015 14:03 UTC
it finds cycles: a depends on b depends on c depends on a, very import if you use require :)
Erwin Poeze
@donnut
Apr 10 2015 14:05 UTC
Unfortunately the project I'm working on uses internal modules only. That explains the blank window.
Mike Graham
@cmichaelgraham
Apr 10 2015 14:07 UTC
have you looked at aurelia?
Erwin Poeze
@donnut
Apr 10 2015 14:09 UTC
In the past I've looked at it briefly. Why?
Mike Graham
@cmichaelgraham
Apr 10 2015 14:09 UTC
i'm a fan ;) (and on the core team) :)
working the aurelia typescript story
Erwin Poeze
@donnut
Apr 10 2015 14:10 UTC
Ah, wasn't there a relationship with angular or another framework?
@EisenbergEffect is behind Aurelia and worked on the core angular team for awhile
Erwin Poeze
@donnut
Apr 10 2015 14:12 UTC
I see. Thanks for the reference to the typescript sample. I'll have a look at it.
Mike Graham
@cmichaelgraham
Apr 10 2015 14:13 UTC
sure. ping me if you need anything :)
Erwin Poeze
@donnut
Apr 10 2015 14:13 UTC
:+1:
Erwin Poeze
@donnut
Apr 10 2015 14:20 UTC
@cmichaelgraham I had a quick look at spike-aurelia-ts-port and that is pretty interesting. Quite a different 'module' setup from what we are using.
If I'm correct everything is organised in files with functions/classes only.
No modules
Mike Graham
@cmichaelgraham
Apr 10 2015 14:39 UTC
right - each file is an external module
with a few exports
and the index export the public interface
Erwin Poeze
@donnut
Apr 10 2015 14:46 UTC
Are you distributing the library are one file, of does it remain in separete amd modules?
are = as
Mike Graham
@cmichaelgraham
Apr 10 2015 14:47 UTC
well this is a spike. the aurelia libraries are usually distributed with jspm
i'm working on an amd bundled version for dojo to be used with esri
(that's what the aurelia typescript samples use :point_up: April 10 2015 8:10 AM
Erwin Poeze
@donnut
Apr 10 2015 14:52 UTC
Why did you choose this approach instead of the internal modules concatinated into one file?
Just curious.
Mike Graham
@cmichaelgraham
Apr 10 2015 14:57 UTC
i'm porting from the existing aurelia libs - trying to keep things as close to the origin as possible
Erwin Poeze
@donnut
Apr 10 2015 15:02 UTC
That makes sense.
Matt Traynham
@mtraynham
Apr 10 2015 15:54 UTC

@donnut @cmichaelgraham I do the same with a project at work. One file for every construct (class/interface/enum) & each file is an external module. If you are distributing a library, I'd recommend just export import all the classes from your main Module file. dts-generator can create the single .d.ts type file for you. I figured out the build flow using Bartvds' pixelbutler-starter project. So you develop against commonJs and distribute as a single bundle.

Thus, single bundle/single declaration.

Mike Graham
@cmichaelgraham
Apr 10 2015 15:56 UTC
@mtraynham nice !!
Matt Traynham
@mtraynham
Apr 10 2015 15:57 UTC
It's more succinct with how bower works, if you use bower.
:)
Mike Graham
@cmichaelgraham
Apr 10 2015 15:57 UTC
i've had some success with aurelia using bower to obtain the repos and r.js to bundle them up
Matt Traynham
@mtraynham
Apr 10 2015 15:58 UTC
I've heard of r.js, but never used it. Webpack is seemingly nicer than Browserify, especially in terms of getting source maps working.
Mike Graham
@cmichaelgraham
Apr 10 2015 15:59 UTC
here's a link to some of the work i've done with r.js and aurelia