1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    159
    Vote Rating
    65
    Notepad123 will become famous soon enough

      0  

    Default Typescript and sencha

    I have just read some old forum thread on Typescript and Sencha so I was wondering if there are any new info on that subject?

    I just took a peek on Type Script and how it uses proper/usual class syntax to work with classes inside JavaScript. I would very much like to use normal class syntax I am used from Java instead of current hack using Ext.define and Ext.create.

    I remember trying to understand similar hack for Perl but eventually gave up and now I don't even try to understand how solutions like these work because it all ends up being to confusing and aquard and just wasting my time someone trying to reinvent the wheel.

    So if there is a technology that allows us to work with JS as if it had proper class support why this isn't used and instead we are forced to use workarounds in the form of Ext.define and Ext.define. I defenetly don't want to make the same mistake as I did with Perl and JS trying to understand how their class/object system works thinking that I am just to stupid to understand brilliant minds behind these solution and that I should simply try harder only to later find out that there is nothing brilliant about it, that solutions are dirty hacks as a result of a bad initial design and that they can't be understood since they objectively make no sense.

    I was hoping and praying for new languages/frameworks/solutions to simplify my work, to become simpler, more intuitive and easier to use, to use and recycle the approaches and knowledge I already aquire so that I don't have to learn everything from scratch every time.

    But it seems that everything is going in opposite direction with solutions being more and more complex having less and less sense. If there is a generally accepted way of how to work with classes which most people find user friendly why can't we based new solutions on these approaches instead of forcing programmers to completely relearn and rethink how we work with classes, examples being Ext.define and Ext.create.

  2. #2
    Sencha User
    Join Date
    Jan 2012
    Posts
    159
    Vote Rating
    65
    Notepad123 will become famous soon enough

      0  

    Default

    I did some more reading and it seams that TypeScript is just implementation of ECMASCRIPT 6 which will support classes.

    When will ECMASCRIPT 6 be released?
    When it does, does it mean that it will be supported with all browsers including webkit and I would be able to open notepad, type some JS classes and run this on any browser?
    When this happens will Sencha Touch ditch Ext.creted and Ext.define and use proper class syntax?

    And what exactly means that TypeScript is just implementation of ECMASCRIPT 6?
    Does this means that I will not be able to open notepad, type something in TypeScript and accpect it ti run on Web Browser. Instead I would need to run compiler to transfer that TypeScript to JS?

    Is this the difference between TypeScript and ECMASCRIPT 6?
    For ECMASCRIPT 6 I would just need notepad and for TypeScript I would need to recompile it to JS first?And this would be needed because of few differences in syntach between two which are in general the same?

  3. #3
    Sencha User
    Join Date
    Dec 2007
    Location
    Netherlands
    Posts
    14
    Vote Rating
    5
    seg is on a distinguished road

      0  

    Default Typescript 1.0 is out

    Well, just to let you know that Typescript 1.0 is out. I've used the 1.0rc for the last couple of months, porting a very big (250+ classes) Extjs 4 application to Typescript and so far so good! I think it's class system, interfaces and types are a must for such a very big application. I've found 10+ small errors, so far, in the Extjs 4 application by porting it to Typescript, even though I've got unit tests and more than 4000 users using the Extjs 4 application. Another bonus is that you don't have any dependencies on a framework, it's just plain javascript, so now we can switch very easily from one javascript UI framework to another.
    If you want some more info, see bld win 2014 presentations:

    http://channel9.msdn.com/Events/Build/2014/3-576
    http://channel9.msdn.com/Events/Build/2014/3-583

  4. #4
    Sencha User
    Join Date
    Dec 2013
    Posts
    1
    Vote Rating
    0
    purediamox is on a distinguished road

      0  

    Default Can you provide more details?

    Thanks for this very positive posting. Could you provide more details of how you got this to work - ideally with some sample code. It'd make a great blog post.

    I've found typescript very productive when working with frameworks like Angular, but never had good results with EXTJS.

    http://blorkfish.wordpress.com/2013/...th-typescript/ highlights some potential gotchas.

    Any help you can give would be of interest
    Thanks

  5. #5
    Sencha User tohagan's Avatar
    Join Date
    Sep 2007
    Posts
    39
    Vote Rating
    0
    tohagan is on a distinguished road

      0  

    Default ExtJS and Sench Touch Typescript Generator

    You might be interested in this app that can generate TS definitions.
    Repo includes generated definitions for Sencha Touch 2.2.1 and 2.3.1, ExtJS 4.2.0 and DefJS.

    https://github.com/brian428/ext-typescript-generator

  6. #6
    Sencha User mcelotti's Avatar
    Join Date
    Nov 2013
    Posts
    62
    Vote Rating
    8
    mcelotti will become famous soon enough

      0  

    Default

    Will be typescript officially supported by sencha products? It would be great if someone of the sencha team could clarify this point.
    It looks like a huge feature for the js developers, but no there's no official feedback.
    Here are some details about using DefinitelyTyped definitions OR custom code emitter for extjs:
    - https://github.com/fabioparra/TypeSc...itter/issues/2
    - https://www.sencha.com/forum/showthr...e-code-emitter
    It's such a cool feature, I don't understand why nobody cares about it

    Thanks for reading,
    Marco

  7. #7
    Sencha User
    Join Date
    Nov 2010
    Posts
    9
    Vote Rating
    2
    thanhptr is on a distinguished road

      0  

    Default Premium TypeScript type definitions for Sencha Ext JS 4.x, 5.x, 6.x

    Please go to find ExtTS - Premium TypeScript type definitions for Sencha Ext JS
    https://github.com/thanhptr/extts
    Every latest version of ExtJS 4.x, 5.x, 6.x is supported; currently latest version is 6.0.2.437.
    Everything you can find from ExtJS API document is in the type definitions with strongly-typed support (such as: Ext.dom.Element, ButtonConfig,..)