These are chat archives for TypeStrong/atom-typescript

7th
May 2015
Basarat Ali Syed
@basarat
May 07 2015 00:12

It is valid in typescript isn't it

Not if used with import/require. With var/require it will work fine but not be typesafe

Basarat Ali Syed
@basarat
May 07 2015 01:05
@kpgarrod ^
Steve Ognibene
@nycdotnet
May 07 2015 01:10
Hello
Basarat Ali Syed
@basarat
May 07 2015 01:21
@nycdotnet wassup
Steve Ognibene
@nycdotnet
May 07 2015 01:22
working on grunt-ts in atom-typescript
Basarat Ali Syed
@basarat
May 07 2015 01:22
:)
Steve Ognibene
@nycdotnet
May 07 2015 01:22
I'm like so meta 'n stuff
hey can I bug you about automatic tsconfig.json?
Basarat Ali Syed
@basarat
May 07 2015 01:24
@nycdotnet go for it
Steve Ognibene
@nycdotnet
May 07 2015 01:24
so I opened grunt-ts is atom-typescript
first time ever on this computer
as you know there isn't yet a tsconfig.json in grunt-ts
Basarat Ali Syed
@basarat
May 07 2015 01:25
yup
Steve Ognibene
@nycdotnet
May 07 2015 01:25
the first thing I did was test out someone's PR and I opened a TypeScript file not in the root
it was way in the tests/htmlTemplate/src folder
and so atom-typescript created the tsconfig.json there
seems odd
your thoughts
Basarat Ali Syed
@basarat
May 07 2015 01:26

the first thing I did was test out someone's PR and I opened a TypeScript file not in the root

Just copy that tsconfig.json file to where you want it to go and atom-ts will happily not recreate it in the wrong place and pick it up from the correct place :rose:

No restarts should be required
Steve Ognibene
@nycdotnet
May 07 2015 01:26
yes that's what I did
Basarat Ali Syed
@basarat
May 07 2015 01:27
you can even do this all from the keyboard : ctrl+shift+\ to locate file in tree view, up down to focus on tsconfig.json and press m to trigger move and just delete the relevant section from path and finally enter :)
no :mouse: are hurt
Steve Ognibene
@nycdotnet
May 07 2015 01:28
thank goodness for that
have you made any progress with the big "UI" question?
Basarat Ali Syed
@basarat
May 07 2015 01:29
Polymer is looking pretty fantastic
because we are cutting edge chrome we don't have the issues common to general web dev
Steve Ognibene
@nycdotnet
May 07 2015 01:29
hmm
that's a really interesting point
Basarat Ali Syed
@basarat
May 07 2015 01:30
But even polymer > I want to warp in good TypeScript ... maybe that can come later
Steve Ognibene
@nycdotnet
May 07 2015 01:30
you mean wrap?
Basarat Ali Syed
@basarat
May 07 2015 01:31
yup wrap : )
@nycdotnet checkout their abstraction of flexbox : https://www.polymer-project.org/0.5/docs/polymer/layout-attrs.html really nicely done
Steve Ognibene
@nycdotnet
May 07 2015 01:33
huh.
Basarat Ali Syed
@basarat
May 07 2015 01:33
I wish I could demo it to you. The docs don't do it justice :)
picnic software loves it :)
Steve Ognibene
@nycdotnet
May 07 2015 01:33
:-)
looks XAMLy
I'm so glad I came out from under my rock last year and got involved in this stuff.
Basarat Ali Syed
@basarat
May 07 2015 01:35
:rose:
Steve Ognibene
@nycdotnet
May 07 2015 01:36
Chances are I'll be in Oz in 2017 - hope we can meet up.
Basarat Ali Syed
@basarat
May 07 2015 01:36
DEFINITELY
Steve Ognibene
@nycdotnet
May 07 2015 01:36
w00t
Steve Ognibene
@nycdotnet
May 07 2015 02:43
Should have a minor release of grunt-ts in the next week or so - several minor bug fixes
Jari Pennanen
@Ciantic
May 07 2015 04:53
I've been looking polymer several times. I'm not totally sold on putting attributes like "horizontal" on the elements, because I might want to make them go vertical in some @media-query
Basarat Ali Syed
@basarat
May 07 2015 04:55

because I might want to make them go vertical in some @media-query

easy as ... its called auto-vertical : https://www.polymer-project.org/0.5/docs/polymer/layout-attrs.html#auto-vertical

auto-vertical means : horizontal by default .. but auto-vertical on small screen
Jari Pennanen
@Ciantic
May 07 2015 04:56
I've used XAML a quiet bit, so I'm on the edge. But MS has such a good tools for it.
what part of Polymer you consider using?
It has a lot of ideas how things should be ordered, last time I checked all components had to have own dependencies, they were quiet big components
Basarat Ali Syed
@basarat
May 07 2015 04:58

what part of Polymer you consider using?

For ui TypeStrong/atom-typescript#318. space-pen is a bit fugly. See https://github.com/TypeStrong/atom-typescript/blob/master/lib/main/atom/views/mainPanelView.ts#L37-L132

admittedly not my best code ^
Jari Pennanen
@Ciantic
May 07 2015 04:59
hey, I remember looking that JSX-like templating you used
Basarat Ali Syed
@basarat
May 07 2015 05:00
wasn't me.. or perhaps JSX like can mean many things :)
Jari Pennanen
@Ciantic
May 07 2015 05:01
yes, I mean HTML tags embedded as JS
that is what JSX basically is when transformed
of course it has the virtual dom underneath, but the syntax you use could be used with virtual dom's too
Basarat Ali Syed
@basarat
May 07 2015 05:03
Yes I've used innerHTML on occasion :-)
or perhaps you mean space pen : http://atom.github.io/space-pen/ < this is the view system atom ships with by default
Jari Pennanen
@Ciantic
May 07 2015 05:09
world plus dog is going towards virtual doms, I actually think they are really neat
Jari Pennanen
@Ciantic
May 07 2015 05:16
to me though the virtual doms allowes to have type safe templates, with loops etc all type checked. Which I see as a improvement, over the space-pen (which looks a lot like my own Backbone.View + jQuery templating)
Basarat Ali Syed
@basarat
May 07 2015 05:17
Atom decided virtual dom wasn't for them : atom/atom#5624 < I'm not saying its a good decision (I don't know personally) but it is at least one team that moved away.
but yeah, I want typesafe yet databound html :cry:
Jari Pennanen
@Ciantic
May 07 2015 05:18
I can understand why Atom the text editor component can't have react
but other ui elements could
I think
Basarat Ali Syed
@basarat
May 07 2015 05:18
The issue with react is that there can be only one
Jari Pennanen
@Ciantic
May 07 2015 05:19
you mean cause it overwrites the dom tree?
I'm not sure, maybe one could trick it to not see some parts of the dom.
with shadow-dom or some such, where one element has no changes, but internally it has
Basarat Ali Syed
@basarat
May 07 2015 05:20
sorry I just wanted to make that :D
Jari Pennanen
@Ciantic
May 07 2015 05:20
:smile:
Basarat Ali Syed
@basarat
May 07 2015 05:20
yeah... but as soon as I move to shadow dom I wonder why not just use polymer
Jari Pennanen
@Ciantic
May 07 2015 05:23
it still has this weird Polymer({...}) syntax as de-facto
Basarat Ali Syed
@basarat
May 07 2015 05:24
I'm used to that thanks to a few years of angular
Jari Pennanen
@Ciantic
May 07 2015 05:24
I'm not, and I've hacked polymer to work with TS once
with inheritance
and "intellisense"
Basarat Ali Syed
@basarat
May 07 2015 05:27
src pleaaaaaase :)
what insanity
this tries to paste whole gist ;)
in that example, I've gone to CustomElement, but it worked with polymer too
maybe just maybe, they start supporting inheritance with ES6 :smile: no ugly hacks required then
quoting myself year ago: "I did get it working, with a hack. Problem is TypeScript not the polymer." is a bit misleading at this point
Basarat Ali Syed
@basarat
May 07 2015 05:31
first off :heart: the code. Saves me a ton.

Problem is TypeScript not the polymer.

I feel the pain of https://gist.github.com/Ciantic/9db1b6281bd7a743ffb5#file-customelement-ts-L1 again ... thanks for writing this :D is this : https://gist.github.com/Ciantic/9db1b6281bd7a743ffb5#file-index-html-L6 the only hack?

Jari Pennanen
@Ciantic
May 07 2015 05:33
see the HTML file
I'm not sure what you pasted
because this clips
Basarat Ali Syed
@basarat
May 07 2015 05:33
click the link ;) but yeah ... its the html <script>BaseCustomHTMLElement = window.HTMLElement</script>
Jari Pennanen
@Ciantic
May 07 2015 05:34
but notice the export declare class BaseCustomHTMLElement implements HTMLElement
you have to type each and every item from HTMLElement
Basarat Ali Syed
@basarat
May 07 2015 05:34
Yup. That was the first link :)
Jari Pennanen
@Ciantic
May 07 2015 05:34
because TS does not allow to just say implements
Basarat Ali Syed
@basarat
May 07 2015 05:34
yup
Jari Pennanen
@Ciantic
May 07 2015 05:35
I put the code in public domain, just in case you wondered :smile:
Basarat Ali Syed
@basarat
May 07 2015 05:35
@Ciantic if you are curious ... there is a github issue created on Microsoft/TypeScript for the exact same use case : Microsoft/TypeScript#371
Jari Pennanen
@Ciantic
May 07 2015 05:35
I created issue back then
not that probably
Basarat Ali Syed
@basarat
May 07 2015 05:37
again : thanks a lot for this :rose:
Jari Pennanen
@Ciantic
May 07 2015 05:38
no problem, notice that I changed for "customelement" some reason I can't remember
I used the Polymer equivalent for some time, but just can't remember why
Basarat Ali Syed
@basarat
May 07 2015 05:39

for "customelement" some reason I can't remember

I suspect to get the __extends to run

Jari Pennanen
@Ciantic
May 07 2015 05:43
If I can find the code on my computer, I should have some polymer remnants there too
maybe I switched to customelement because Polymer does not include all methods or something
Basarat Ali Syed
@basarat
May 07 2015 05:47
:+1:
Jari Pennanen
@Ciantic
May 07 2015 05:51
oh I see fdcampderon has opened and issue for extending HTMLElement way back in 2013 https://typescript.codeplex.com/discussions/468055
here is the issue (that was discussion) http://typescript.codeplex.com/workitem/1885
probably this should be moved to github: https://typescript.codeplex.com/workitem/2475
it's the root problem here
that "optional interface" is some other proposal
which could lead to easier inheritance from HTMLElement
Jari Pennanen
@Ciantic
May 07 2015 05:58
this I think is a good question still
interface IBase_x { x }
interface IBase_y{ y }
declare class A implements IBase_x, IBase_y; // <- I have to actually type out the members!?
when it's marked "declare", should one need to type out the members.
Jari Pennanen
@Ciantic
May 07 2015 06:12
I bet @basarat you have some voodoo to get the HTMLElement interface members without copy & pasting from the code. Since TS language service knows them, so you can make it to show them to you?
I went the copy & pasting route :)
Basarat Ali Syed
@basarat
May 07 2015 06:16

you have some voodoo to get the HTMLElement interface members without copy & pasting from the code. Since TS language service knows them, so you can make it to show them to you

Don't have that voodoo coded yet. Being tracked though : TypeStrong/atom-typescript#256

Jari Pennanen
@Ciantic
May 07 2015 06:19
I didn't thought of that, but yes, that's the more generic way to do it. Creating stub implements for interface.
Basarat Ali Syed
@basarat
May 07 2015 06:24
I think I can reuse the same logic to determine if there should be a placeholder {} or just a ; depending upon whether the class is ambient
Jari Pennanen
@Ciantic
May 07 2015 06:27
with ambient you mean if it contains word "declare" in front?
Basarat Ali Syed
@basarat
May 07 2015 06:28
yes : either that or the file itself is a d.ts
Jari Pennanen
@Ciantic
May 07 2015 06:45
Microsoft/TypeScript#574
just two days ago some words, maybe it will be resuciated
resuscitated
Nelo Mitranim
@Mitranim
May 07 2015 15:13
Typescript newb question. In a class method, how to refer to the class's own type? I need to include it into the return type in a generic way so that when the method is called on subclasses, the return type refers to the subclass rather than the superclass
Mike Graham
@cmichaelgraham
May 07 2015 20:22
i've been asked to build .ts --> system, which is on master, but not in beta. any idea when the next update from master might be?
Nelo Mitranim
@Mitranim
May 07 2015 21:05
@cmichaelgraham Hmm if the goal is to consume it with System, then you can transpile to commonjs
We're using this in production, mixed transpilation with babel (emits system modules) and TS1.5 (emits commonjs modules), both work
Mike Graham
@cmichaelgraham
May 07 2015 21:06
well, it is a test of https://github.com/cmichaelgraham/aurelia-ts-port to see if we can generate system register format modules
:point_up: Big Question - feel free to weigh in :)