These are chat archives for TypeStrong/atom-typescript

14th
Apr 2015
Basarat Ali Syed
@basarat
Apr 14 2015 00:47
@mtraynham yeah I feel like just sticking with require for consistency sake. It if ain't broke don't fix it (I think?)
Matt Traynham
@mtraynham
Apr 14 2015 00:53
ehh, isn't the point to be able to write ES6, but generate ES5?
why support the commonJS or requireJS outputs as well
/rant
Michael
@michaelsg
Apr 14 2015 01:31
I was discussing this topic with a friend over lunch today. What is TS doing and what does ES6 say about interoperating with things that modify "exports"?
Basarat Ali Syed
@basarat
Apr 14 2015 02:49
I have arrived at the core of my frustration : https://github.com/Microsoft/TypeScript/issues/2242#issuecomment-92549808
I didn't like the inconsistency in one way (why wasn't it allowed) :) now I don't like it in the other way (if that wasn't allowed, neither should this) :)
Michael
@michaelsg
Apr 14 2015 02:51
I was talking about this problem over lunch with a friend today.
Matt Traynham
@mtraynham
Apr 14 2015 04:08

@basarat I think I might revert some of my code... My other weird-o case, that's actually pretty valid with CommonJS is re-exporting module default's for bundles.
This works, but it's been suggested that it's wrong to do.

export {default as Foo} from './Foo';

I tried a few other things as well:

export Foo from './Foo';
export * as Foo from './Foo';
export * from './Foo';

Although, in the spec description:

import {default as Foo} from './Foo';

is basically long for:

import Foo from './Foo';
Basarat Ali Syed
@basarat
Apr 14 2015 04:09
Wait, what's wrong with?:
export {default as Foo} from './Foo';
Matt Traynham
@mtraynham
Apr 14 2015 04:13
Well it compiles and runs fine, but the ES6 spec is pretty vague about what's really exportable.
Microsoft/TypeScript#2726
They weren't really sure if that syntax is legal
Basarat Ali Syed
@basarat
Apr 14 2015 04:16
blob
sad that there are edge cases like * only if no default
Matt Traynham
@mtraynham
Apr 14 2015 04:16
But I'll hold off for a response before I revert anything
right, I saw that.
I think I'll keep what I have for a week or so in a stash, then decide if I want to keep using the ES6 module syntax or go back
Basarat Ali Syed
@basarat
Apr 14 2015 04:19
Yeah I thought default as Foo was okay because of the Greeter sample same as you :) thanks for pointing that out
Matt Traynham
@mtraynham
Apr 14 2015 04:19
:)
Although, I think it is possible to do:
import Foo from './Foo';
export {Foo};
Basarat Ali Syed
@basarat
Apr 14 2015 04:20
:)
Matt Traynham
@mtraynham
Apr 14 2015 04:21
seems kind of annoying to use two lines, when I really enjoyed the export import CommonJS options
oh well, no worries
as long as the code runs
Basarat Ali Syed
@basarat
Apr 14 2015 04:24
Does make it difficult to commit to a one module system for all
Matt Traynham
@mtraynham
Apr 14 2015 04:28
4real
need a break, gonna go play some gta
Basarat Ali Syed
@basarat
Apr 14 2015 04:29
:heart:
Matt Traynham
@mtraynham
Apr 14 2015 22:28
i'd just like to reiterate how sweet typescript is with atom
my goodness
Saw that in the angular/angular chat
unquote, Saw that in the angular/angular chat
Mike Graham
@cmichaelgraham
Apr 14 2015 23:05
Aurelia like it too ;)
Basarat Ali Syed
@basarat
Apr 14 2015 23:15
:rose: