<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>typescript Discussions Rss Feed</title><link>https://typescript.codeplex.com/discussions</link><description>typescript Discussions Rss Description</description><item><title>New Post: SammyJs: module and function impossible to define in 0.9?</title><link>http://typescript.codeplex.com/discussions/444444</link><description>&lt;div style="line-height: normal;"&gt;So the question is how can we declare the following in the new syntax: &lt;br /&gt;
&lt;pre&gt;&lt;code&gt;declare module &amp;quot;mymodule&amp;quot; {
    export function (): any;   
}&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;</description><author>basarat</author><pubDate>Thu, 23 May 2013 23:57:22 GMT</pubDate><guid isPermaLink="false">New Post: SammyJs: module and function impossible to define in 0.9? 20130523115722P</guid></item><item><title>New Post: SammyJs: module and function impossible to define in 0.9?</title><link>http://typescript.codeplex.com/discussions/444444</link><description>&lt;div style="line-height: normal;"&gt;Yup nvivo. However (as you stated at the end) it will &lt;strong&gt;&lt;em&gt;not&lt;/em&gt;&lt;/strong&gt; work when using modules and the import clause. i.e. the following is invalid: &lt;br /&gt;
&lt;pre&gt;&lt;code&gt;declare function &amp;quot;mymodule&amp;quot;();
declare module &amp;quot;mymodule&amp;quot;{
    
}

import x = module(&amp;quot;mymodule&amp;quot;);
x(); &lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;</description><author>basarat</author><pubDate>Thu, 23 May 2013 23:54:44 GMT</pubDate><guid isPermaLink="false">New Post: SammyJs: module and function impossible to define in 0.9? 20130523115444P</guid></item><item><title>New Post: Initialize Simple Variables on the Prototype</title><link>http://typescript.codeplex.com/discussions/444777</link><description>&lt;div style="line-height: normal;"&gt;Dan,&lt;br /&gt;
&lt;br /&gt;
I've read your response multiple times, but it's not making much sense to me. &lt;br /&gt;
&lt;br /&gt;
Sharing between objects is exactly what prototypal inheritance provides.   When I have a function on a prototype, say that function is named &lt;code&gt;name()&lt;/code&gt;,that function is shared between all instances and instances of derived classes.  That's the default for methods/functions,  why not the default for initialization of simple variables (string/numbers/booleans)?  We don't make all our methods static do we.&lt;br /&gt;
&lt;br /&gt;
So yes, I do want &lt;code&gt;name&lt;/code&gt; shared between all my instances.  It achieves the same thing as initializing variables in the constructor chain.  I'm not looking for &lt;code&gt;static&lt;/code&gt; functionality since I want the instances to be able to update those values.  If you believe that instances updating those values will update those values for all  instances, then you need to read up again on  prototypal inheritance.&lt;br /&gt;
&lt;br /&gt;
To be clear, I'm not requesting a declaration attribute, but it may provide a pathway to a compromise. And I'm not recommending that objects and arrays be initialized in the same manner.&lt;br /&gt;
&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;

&lt;span style="color:Green;"&gt;// TS&lt;/span&gt;
&lt;span style="color:Blue;"&gt;class&lt;/span&gt; Foo {
    &lt;span style="color:Green;"&gt;// initializing variables, all instances for Foo will start in this state&lt;/span&gt;
    a:bool = &lt;span style="color:Blue;"&gt;true&lt;/span&gt;;
    c:string = &lt;span style="color:#A31515;"&gt;&amp;quot;hello world&amp;quot;&lt;/span&gt;;
    d:number = 321;
    name:string = &lt;span style="color:#A31515;"&gt;&amp;quot;bob&amp;quot;&lt;/span&gt;;
}

&lt;span style="color:Green;"&gt;// TSC Output&lt;/span&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; Foo = (&lt;span style="color:Blue;"&gt;function&lt;/span&gt; () {
    &lt;span style="color:Blue;"&gt;function&lt;/span&gt; Foo() {
        &lt;span style="color:Green;"&gt;// initializing variables at instance construct time&lt;/span&gt;
        &lt;span style="color:Green;"&gt;// this code is run for every instance created&lt;/span&gt;
        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.a = &lt;span style="color:Blue;"&gt;true&lt;/span&gt;;
        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.c = &lt;span style="color:#A31515;"&gt;&amp;quot;hello world&amp;quot;&lt;/span&gt;;
        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.d = 321;
        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.name = &lt;span style="color:#A31515;"&gt;&amp;quot;bob&amp;quot;&lt;/span&gt;;
    }
    &lt;span style="color:Blue;"&gt;return&lt;/span&gt; Foo;
})();

&lt;span style="color:Green;"&gt;// Desired TSC Output&lt;/span&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; Foo = (&lt;span style="color:Blue;"&gt;function&lt;/span&gt; () {
    &lt;span style="color:Blue;"&gt;function&lt;/span&gt; Foo() {}
    &lt;span style="color:Green;"&gt;// initializing variables on the prototype&lt;/span&gt;
    &lt;span style="color:Green;"&gt;// this code is run once&lt;/span&gt;
    Foo.prototype.a = &lt;span style="color:Blue;"&gt;true&lt;/span&gt;;
    Foo.prototype.c = &lt;span style="color:#A31515;"&gt;&amp;quot;hello world&amp;quot;&lt;/span&gt;;
    Foo.prototype.d = 321;
    Foo.prototype.name = &lt;span style="color:#A31515;"&gt;&amp;quot;bob&amp;quot;&lt;/span&gt;;
    &lt;span style="color:Blue;"&gt;return&lt;/span&gt; Foo;
})();
&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</description><author>pixel4</author><pubDate>Thu, 23 May 2013 20:38:55 GMT</pubDate><guid isPermaLink="false">New Post: Initialize Simple Variables on the Prototype 20130523083855P</guid></item><item><title>New Post: Initialize Simple Variables on the Prototype</title><link>http://typescript.codeplex.com/discussions/444777</link><description>&lt;div style="line-height: normal;"&gt;Putting variable declarations on the prototype vs the instance variable is completely different semantically. As you've noticed, if you want to optimize for memory usage you can do so explicitly if the semantics match what you desire. Consider if your string property c was instead called name. Do you really want the same 'name' property for every instance of Foo? Maybe you do, if so, you need to make that explicit. How would the compiler automatically know which one you meant? The variable declaration attribute you're asking for is essentially what static already is, it defines things shared between all instances of a class rather than those that exist per instance.&lt;br /&gt;
&lt;/div&gt;</description><author>danquirk</author><pubDate>Thu, 23 May 2013 19:57:31 GMT</pubDate><guid isPermaLink="false">New Post: Initialize Simple Variables on the Prototype 20130523075731P</guid></item><item><title>New Post: Initialize Simple Variables on the Prototype</title><link>http://typescript.codeplex.com/discussions/444777</link><description>&lt;div style="line-height: normal;"&gt;Putting variable declarations on the prototype vs the instance variable is completely different semantically. As you've noticed, if you want to optimize for memory usage you can do so explicitly if the semantics match what you desire. Consider if your string property c was instead called name. Do you really want the same 'name' property for every instance of Foo? Maybe you do, if so, you need to make that explicit. How would the compiler automatically know which one you meant? The variable declaration attribute you're asking for is essentially what static already is, it defines things shared between all instances of a class rather than those that exist per instance.&lt;br /&gt;
&lt;/div&gt;</description><author>danquirk</author><pubDate>Thu, 23 May 2013 19:57:31 GMT</pubDate><guid isPermaLink="false">New Post: Initialize Simple Variables on the Prototype 20130523075731P</guid></item><item><title>New Post: Classes In Wrong Order In Single File with Inheritance and Circular Reference</title><link>http://typescript.codeplex.com/discussions/440790</link><description>&lt;div style="line-height: normal;"&gt;I am having a tough time reproducing in a small example.  My project consists of a large amount of files.  So many that if I use the built-in visual studio build mechanism, the compiler errors out because the command is so long and gets truncated.  Instead, I have to spit out the list of files to a file that I can then run tsc on.  In doing so, I inevitably get the error above.  If I change the ordering the list of files to correctly match dependencies, all is well.&lt;br /&gt;
&lt;/div&gt;</description><author>BSick7</author><pubDate>Thu, 23 May 2013 16:48:44 GMT</pubDate><guid isPermaLink="false">New Post: Classes In Wrong Order In Single File with Inheritance and Circular Reference 20130523044844P</guid></item><item><title>New Post: Initialize Simple Variables on the Prototype</title><link>https://typescript.codeplex.com/discussions/444777</link><description>&lt;div style="line-height: normal;"&gt;In order to reduce memory usage and maybe improve initialization time of objects, has there been any discussion about putting simple values (of string/boolean/number) on the prototype of the class?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;TS Input&lt;/strong&gt;&lt;br /&gt;
&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;class&lt;/span&gt; Foo {
    a:bool = &lt;span style="color:Blue;"&gt;true&lt;/span&gt;;
    c:string = &lt;span style="color:#A31515;"&gt;&amp;quot;hello world&amp;quot;&lt;/span&gt;;
    d:number = 321;
}

&lt;span style="color:Blue;"&gt;class&lt;/span&gt; Bar &lt;span style="color:Blue;"&gt;extends&lt;/span&gt; Foo {}

&lt;span style="color:Blue;"&gt;var&lt;/span&gt; a = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; Bar();
&lt;/pre&gt;&lt;/div&gt;&lt;strong&gt;TSC Output&lt;/strong&gt;&lt;br /&gt;
&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; __extends = &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.__extends || &lt;span style="color:Blue;"&gt;function&lt;/span&gt; (d, b) {
    &lt;span style="color:Blue;"&gt;function&lt;/span&gt; __() { &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.constructor = d; }
    __.prototype = b.prototype;
    d.prototype = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; __();
};
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; Foo = (&lt;span style="color:Blue;"&gt;function&lt;/span&gt; () {
    &lt;span style="color:Blue;"&gt;function&lt;/span&gt; Foo() {
        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.a = &lt;span style="color:Blue;"&gt;true&lt;/span&gt;;
        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.c = &lt;span style="color:#A31515;"&gt;&amp;quot;hello world&amp;quot;&lt;/span&gt;;
        &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.d = 321;
    }
    &lt;span style="color:Blue;"&gt;return&lt;/span&gt; Foo;
})();
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; Bar = (&lt;span style="color:Blue;"&gt;function&lt;/span&gt; (_super) {
    __extends(Bar, _super);
    &lt;span style="color:Blue;"&gt;function&lt;/span&gt; Bar() {
        _super.apply(&lt;span style="color:Blue;"&gt;this&lt;/span&gt;, arguments);
    }
    &lt;span style="color:Blue;"&gt;return&lt;/span&gt; Bar;
})(Foo);
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; a = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; Bar();
&lt;/pre&gt;&lt;/div&gt;&lt;strong&gt;Expected Output&lt;/strong&gt;&lt;br /&gt;
&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; __extends = &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.__extends || &lt;span style="color:Blue;"&gt;function&lt;/span&gt; (d, b) {
    &lt;span style="color:Blue;"&gt;function&lt;/span&gt; __() { &lt;span style="color:Blue;"&gt;this&lt;/span&gt;.constructor = d; }
    __.prototype = b.prototype;
    d.prototype = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; __();
};
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; Foo = (&lt;span style="color:Blue;"&gt;function&lt;/span&gt; () {
    &lt;span style="color:Blue;"&gt;function&lt;/span&gt; Foo() {}
    &lt;span style="color:Green;"&gt;// simple JS types like strings, numbers and booleans on the prototype&lt;/span&gt;
    Foo.prototype.a = &lt;span style="color:Blue;"&gt;true&lt;/span&gt;;
    Foo.prototype.c = &lt;span style="color:#A31515;"&gt;&amp;quot;hello world&amp;quot;&lt;/span&gt;;
    Foo.prototype.d = 321;
    &lt;span style="color:Blue;"&gt;return&lt;/span&gt; Foo;
})();
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; Bar = (&lt;span style="color:Blue;"&gt;function&lt;/span&gt; (_super) {
    __extends(Bar, _super);
    &lt;span style="color:Blue;"&gt;function&lt;/span&gt; Bar() {}
    &lt;span style="color:Blue;"&gt;return&lt;/span&gt; Bar;
})(Foo);
&lt;span style="color:Blue;"&gt;var&lt;/span&gt; a = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; Bar();
&lt;/pre&gt;&lt;/div&gt;If the output from TSC is by design/spec then maybe this can be added via a variable declaration attribute.&lt;br /&gt;
&lt;br /&gt;
I've been implementing this hack but I'm sure I shouldn't be doing this..&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Hack&lt;/strong&gt;&lt;br /&gt;
&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;

&lt;span style="color:Blue;"&gt;class&lt;/span&gt; Foo {

    a:bool;
    c:string;
    d:number;

    &lt;span style="color:Blue;"&gt;static&lt;/span&gt; STATIC_CONSTRUCTOR = &lt;span style="color:Blue;"&gt;function&lt;/span&gt;(obj) {
        obj.a = &lt;span style="color:Blue;"&gt;true&lt;/span&gt;;
        obj.c = &lt;span style="color:#A31515;"&gt;&amp;quot;hello world&amp;quot;&lt;/span&gt;;
        obj.d = 321;
        &lt;span style="color:Blue;"&gt;return&lt;/span&gt; &lt;span style="color:Blue;"&gt;true&lt;/span&gt;;
    };

    &lt;span style="color:Blue;"&gt;static&lt;/span&gt; STATIC_CONSTRUCTOR_INIT = TLXBase.STATIC_CONSTRUCTOR(Foo.prototype);

}
&lt;/pre&gt;&lt;/div&gt;Thank you.&lt;br /&gt;
&lt;/div&gt;</description><author>pixel4</author><pubDate>Thu, 23 May 2013 15:40:36 GMT</pubDate><guid isPermaLink="false">New Post: Initialize Simple Variables on the Prototype 20130523034036P</guid></item><item><title>New Post: SammyJs: module and function impossible to define in 0.9?</title><link>http://typescript.codeplex.com/discussions/444444</link><description>&lt;div style="line-height: normal;"&gt;I did some tests last night and it seems to work, and it even compiles and produces the expected code in . For basarat and schungx, here is what I did:&lt;br /&gt;
&lt;br /&gt;
Get Paul's code and compile with --declaration&lt;br /&gt;
&lt;br /&gt;
Sammy.ts:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;function Sammy() { return null; }

module Sammy {
    export class Application {
        constructor() { }
    }
}
--
tsc --declaration Sammy.ts&lt;/code&gt;&lt;/pre&gt;

The declaration generated in Sammy.d.ts for this is:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;declare function Sammy();
declare module Sammy {
    class Application {
        constructor();
    }
}&lt;/code&gt;&lt;/pre&gt;

Create a &amp;quot;file.ts&amp;quot; and reference the Sammy.d.ts you just created:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;/// &amp;lt;reference path=&amp;quot;Sammy.d.ts&amp;quot; /&amp;gt;

var a = Sammy();
var b: Sammy.Application;
var c = new Sammy.Application();&lt;/code&gt;&lt;/pre&gt;

Seems to work for both the declaration as for real javascript code. Overloads can be declared as usual.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So Paul/Dan, it seems that if I'm not using modules and the import clause, this should be possible to map today.&lt;br /&gt;
&lt;/div&gt;</description><author>nvivo</author><pubDate>Thu, 23 May 2013 10:23:42 GMT</pubDate><guid isPermaLink="false">New Post: SammyJs: module and function impossible to define in 0.9? 20130523102342A</guid></item><item><title>New Post: SammyJs: module and function impossible to define in 0.9?</title><link>http://typescript.codeplex.com/discussions/444444</link><description>&lt;div style="line-height: normal;"&gt;Incidentally, just noticed the ID of this discussion -- 444444.&lt;br /&gt;
&lt;br /&gt;
In Chinese, the number 4 is bad luck, since it sounds similar to &amp;quot;death&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Hope this won't affect this extremely important feature...&lt;br /&gt;
&lt;/div&gt;</description><author>schungx</author><pubDate>Thu, 23 May 2013 09:33:05 GMT</pubDate><guid isPermaLink="false">New Post: SammyJs: module and function impossible to define in 0.9? 20130523093305A</guid></item><item><title>New Post: SammyJs: module and function impossible to define in 0.9?</title><link>https://typescript.codeplex.com/discussions/444444</link><description>&lt;div style="line-height: normal;"&gt;@basarat's question is also mine.  Basically, we need new syntax for these two:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;declare module Sammy {
    export class SammyClass {
        constructor();
    }
    export function (): any;
    export function new (): SammyClass;
}&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;</description><author>schungx</author><pubDate>Thu, 23 May 2013 08:45:32 GMT</pubDate><guid isPermaLink="false">New Post: SammyJs: module and function impossible to define in 0.9? 20130523084532A</guid></item><item><title>New Post: SammyJs: module and function impossible to define in 0.9?</title><link>http://typescript.codeplex.com/discussions/444444</link><description>&lt;div style="line-height: normal;"&gt;How would one declare such a module with the new syntax. E.g what is the new syntax for the declaration: &lt;br /&gt;
&lt;pre&gt;&lt;code&gt;declare module Sammy {
    export function (): any;   
}&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;</description><author>basarat</author><pubDate>Wed, 22 May 2013 23:48:26 GMT</pubDate><guid isPermaLink="false">New Post: SammyJs: module and function impossible to define in 0.9? 20130522114826P</guid></item><item><title>New Post: SammyJs: module and function impossible to define in 0.9?</title><link>http://typescript.codeplex.com/discussions/444444</link><description>&lt;div style="line-height: normal;"&gt;What you're looking for is the following:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;function Sammy() { return null; }

module Sammy {
    export class Application {
        constructor() { }
    }
}



export = Sammy;
&lt;/code&gt;&lt;/pre&gt;

But as Dan said, that's currently blocked by a bug on the import side.&lt;br /&gt;
&lt;/div&gt;</description><author>paulb</author><pubDate>Wed, 22 May 2013 17:28:02 GMT</pubDate><guid isPermaLink="false">New Post: SammyJs: module and function impossible to define in 0.9? 20130522052802P</guid></item><item><title>New Post: Real world projects written is TypeScript</title><link>http://typescript.codeplex.com/discussions/430577</link><description>&lt;div style="line-height: normal;"&gt;We launched &lt;a href="http://www.featuremap.co" rel="nofollow"&gt;FeatureMap&lt;/a&gt; recently, a new web application for product management. &lt;br /&gt;
The client side is written entirely in TypeScript and makes extensive use of Knockout, Backbone and jQuery. I must say I'm very pleased with TypeScript this far. :)&lt;br /&gt;
&lt;/div&gt;</description><author>jpatte</author><pubDate>Wed, 22 May 2013 11:35:01 GMT</pubDate><guid isPermaLink="false">New Post: Real world projects written is TypeScript 20130522113501A</guid></item><item><title>New Post: SammyJs: module and function impossible to define in 0.9?</title><link>http://typescript.codeplex.com/discussions/444444</link><description>&lt;div style="line-height: normal;"&gt;Hi Dan,&lt;br /&gt;
&lt;br /&gt;
Please correct me if I didn't understand this. Merged declarations would be declaring the same name twice, like this?&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;export module Sammy {
    interface Application { }
}
export interface SammyStatic { }
declare var Sammy : SammyStatic; &lt;/code&gt;&lt;/pre&gt;

If not, can you give an example on what should it look like in 0.9?&lt;br /&gt;
&lt;/div&gt;</description><author>nvivo</author><pubDate>Wed, 22 May 2013 10:26:11 GMT</pubDate><guid isPermaLink="false">New Post: SammyJs: module and function impossible to define in 0.9? 20130522102611A</guid></item><item><title>New Post: release-0.9</title><link>http://typescript.codeplex.com/discussions/444557</link><description>&lt;div style="line-height: normal;"&gt;I see a release-0.9 branch :p &lt;br /&gt;
&lt;br /&gt;
So i guess we can hope about the 0.9 release in the next few days ? :p&lt;br /&gt;
&lt;/div&gt;</description><author>fdecampredon</author><pubDate>Wed, 22 May 2013 09:31:54 GMT</pubDate><guid isPermaLink="false">New Post: release-0.9 20130522093154A</guid></item><item><title>New Post: Classes In Wrong Order In Single File with Inheritance and Circular Reference</title><link>http://typescript.codeplex.com/discussions/440790</link><description>&lt;div style="line-height: normal;"&gt;My example doesn't correctly illustrate the issues I have had.  As I took a different approach, let me try to reproduce.  Ultimately, I'm seeing cases where the typescript compiler compiles successfully; however, when run in the browser, the javascript engine crashes in the _extends method because _ is undefined in the following code.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;var __extends = this.__extends || function (d, b) {
    function __() { this.constructor = d; }
    __.prototype = b.prototype;
    d.prototype = new __();
};&lt;/code&gt;&lt;/pre&gt;

Stay tuned for an example.&lt;br /&gt;
&lt;/div&gt;</description><author>BSick7</author><pubDate>Wed, 22 May 2013 01:59:41 GMT</pubDate><guid isPermaLink="false">New Post: Classes In Wrong Order In Single File with Inheritance and Circular Reference 20130522015941A</guid></item><item><title>New Post: SammyJs: module and function impossible to define in 0.9?</title><link>http://typescript.codeplex.com/discussions/444444</link><description>&lt;div style="line-height: normal;"&gt;The export assignment feature combined with merged declarations are designed to allow his sort of pattern going forward. It appears there is currently a bug blocking your particular case (we only just put these features in quite recently) but we do intend to support this pattern.&lt;br /&gt;
&lt;/div&gt;</description><author>danquirk</author><pubDate>Wed, 22 May 2013 00:38:46 GMT</pubDate><guid isPermaLink="false">New Post: SammyJs: module and function impossible to define in 0.9? 20130522123846A</guid></item><item><title>New Post: SammyJs: module and function impossible to define in 0.9?</title><link>https://typescript.codeplex.com/discussions/444444</link><description>&lt;div style="line-height: normal;"&gt;DefinitelyTyped has a definition for &lt;a href="https://github.com/borisyankov/DefinitelyTyped/blob/master/sammyjs/sammyjs.d.ts" rel="nofollow"&gt;SammyJS&lt;/a&gt; that use modules to organize the definition. Sammy itself uses namespace Sammy for its objects, where you have Sammy.Object, Sammy.Application, Sammy.EventContext, etc, so the module mimics the behavior correctly.&lt;br /&gt;
&lt;br /&gt;
Sammy is also a function, and the main way to call it is &lt;code&gt;var app = Sammy(...);&lt;/code&gt;.&lt;br /&gt;
&lt;br /&gt;
In 0.8, the definition works fine with the following (simplified) code:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;module Sammy {
    export function (): Sammy.Application;
    ...
    export interface Application {
        new ();
        ...
    }
}&lt;/code&gt;&lt;/pre&gt;

This code no longer compiles in 0.9 due to the breaking change &amp;quot;The ‘module’ keyword no longer creates a type&amp;quot;, and requires the first function to be named in the module.&lt;br /&gt;
&lt;br /&gt;
The issue is that I cannot find any code that produces the same behavior for this valid javascript code in TS 0.9.&lt;br /&gt;
&lt;br /&gt;
Sammy is both a global function and a module for classes, and this is perfectly valid javascript. The definition should support a way to have all these lines compilling:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;var app = Sammy();
var app = new Sammy.Application();
var app : Sammy.Application;&lt;/code&gt;&lt;/pre&gt;

How to map this behavior in the definiton file for 0.9?&lt;br /&gt;
&lt;/div&gt;</description><author>nvivo</author><pubDate>Tue, 21 May 2013 15:18:17 GMT</pubDate><guid isPermaLink="false">New Post: SammyJs: module and function impossible to define in 0.9? 20130521031817P</guid></item><item><title>New Post: Debugging TypeScript in Visual Studio (assets served with Cassette)</title><link>http://typescript.codeplex.com/discussions/444245</link><description>&lt;div style="line-height: normal;"&gt;That's a little frustrating.  I'm generating the map files and bundling them with Cassette but Visual Studio isn't picking up on it.  I have this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script src=&amp;quot;/cassette.axd/asset/Scripts/Views/Home/Index.js?82d036dfdf39db3e4f486a9402dca05e83af0e03&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And behind the scenes Index.js.map and Index.ts can be found too.   However, no joy with the TypeScript debugging.  This is a shame as the project I'm working on has a heavy reliance on Cassette.  Not sure what to do...  I could just rely on the JS debugging I suppose.&lt;br /&gt;
&lt;/div&gt;</description><author>johnny_reilly</author><pubDate>Tue, 21 May 2013 05:33:22 GMT</pubDate><guid isPermaLink="false">New Post: Debugging TypeScript in Visual Studio (assets served with Cassette) 20130521053322A</guid></item><item><title>New Post: Debugging TypeScript in Visual Studio (assets served with Cassette)</title><link>http://typescript.codeplex.com/discussions/444245</link><description>&lt;div style="line-height: normal;"&gt;The debugging support in TypeScript uses the source map format that a number of JS tools support, including browsers like Chrome as well.  The .map file maps from the output .js file back to the original .ts file.  If Visual Studio can't access the .map file, it won't be able to successfully debug directly on your original TS files.&lt;br /&gt;
&lt;br /&gt;
By default, a new TypeScript HTML5 project will create a .map file as part of a debug build.  If you're using your own project not based on that template, you'll need to enable source map output yourself using the &amp;quot;--sourcemap&amp;quot; commandline option.&lt;br /&gt;
&lt;br /&gt;
I'm not familiar Cassette, though as you describe it may be introducing a layer of abstraction that's not compatible with the VS plugin.  It may be worth trying a simpler setup first to see if you can have success with that.&lt;br /&gt;
&lt;/div&gt;</description><author>jonturner</author><pubDate>Mon, 20 May 2013 16:01:22 GMT</pubDate><guid isPermaLink="false">New Post: Debugging TypeScript in Visual Studio (assets served with Cassette) 20130520040122P</guid></item></channel></rss>