a few questions on using the new TypeScript projects

9 posts, 0 answers
  1. Jaja
    Jaja avatar
    8 posts
    Member since:
    May 2013

    Posted 13 Jun 2014 Link to this post

    1) In regular typescript projects I don't need to do the ///reference for kendo and jquery because VS scans for all ts files but yet I'm having to do that within AppBuilder's typescript.  Am I overlooking a configuration setting or something?

    2) Even after placing in the ///reference calls I get an error stating "cannot compile external modules unless --module flag is provided".  Usually thats fixed by setting the project properties to use AMD as the module system but I don't see that setting under the project properties anywhere.

    3) In solution explorer it shows the related .js, and .js.map for every .ts file which makes things kind of crowded.  Is there a way to configuration settings to tell solution explorer to only display the .ts file as VS normally does?

    4) I'm guessing that there is no support for nuget at all since I don't see a menu item for it in the right-click menu, is that correct?
  2. Jaja
    Jaja avatar
    8 posts
    Member since:
    May 2013

    Posted 13 Jun 2014 Link to this post

    In regards to #3, I think this just may be from where I copied over source code from another project and then did the "include in project" and it brought along the .js and .js.map files for the ride.   My bad :-D
  3. Svetlozar
    Admin
    Svetlozar avatar
    269 posts

    Posted 16 Jun 2014 Link to this post

    Hello,

    Thank you for your interest in our TypeScript support!

    Here are the answers to your questions:

    1. In Visual Studio, all files that have build action “TypeScript Compile” implicitly reference each other. If you change the build action of your ts and declarations files to “TypeScript Compile” you should have intellisense without adding /// references. We will improve our project templates to have the TypeScript Compile build action set by default.
    2. You are correct, we haven’t exposed the TypeScript build properties yet. We are still looking for the best way to handle that.
    3. Visual Studio just doesn’t include the JavaScript file. You can remove the JavaScript file from the project if you would like (compiling will continue to work), but we prefer having the JavaScript file in the project by default. Nesting the JavaScript file under the corresponding TypeScript file definitely makes sense, so we will most probably implement it in the future.
    4. The NuGet UI works with known project types. Unfortunately, the AppBuilder project type is unknown to NuGet, so the commands for managing packages are unavailable. The good news is that the Package Manager Console works and you can install packages using “Install-Package”. In fact, Python and Node.js have the very same problem and we are monitoring how the NuGet team will handle the pull request for adding these project types as known projects.

    If you have any other questions or suggestions, please don't hesitate to write back!

    Regards,
    Svetlozar
    Telerik
     

    Share what you think about AppBuilder and Telerik Platform with us in our feedback portal, so we can become even better!

     
  4. Mike Graham
    Mike Graham avatar
    29 posts
    Member since:
    May 2010

    Posted 27 Jun 2014 in reply to Svetlozar Link to this post

    I added a feature request with the following - i'm including it here in case that gives it extra weight ;)

    ----------------------

    love the direction you are taking with mobile projects supporting typescript.

    please, please, please add a project property for specifying the typescript module system (or even a way to manually edit the iceproj file) so this flag gets added to the typescript compile.

    i was very excited with the new appbuilder typescript support, but then disappointed because without a way to specify the typescript module system, i can't leverage typescript in my appbuilder mobile projects. i use amd to load everything.

    the workaround for now is to build the typescript files in a separate website project and manually add the resulting js files to the mobile project. this works for now.

    ultimately, in a perfect world, i would like to have a single project that generates my website and my mobile apps for all platforms (seems like a lot to ask, but you guys rock, so i'm asking)
  5. Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 02 Jul 2014 Link to this post

    Hello Mike,

    Thank you for the feature request and all the feedback about our product. We will definitely have it in mind for our future releases.

    Further, here is the reply from a colleague of mine:
    "... in our Windows Client the setting is exposed in Options | General | Text Editor | TypeScript | Compilation Settings.
    Visual Studio also has settings for that (although it slightly depends on how you've setup your project). Our In-Browser Client doesn't expose that particular setting yet, but we will add it."


    I hope this helps. Please, let me know if there is anything else you want to ask.

    Regards,
    Kaloyan
    Telerik
     

    Share what you think about AppBuilder and Telerik Platform with us in our feedback portal, so we can become even better!

     
  6. Mike Graham
    Mike Graham avatar
    29 posts
    Member since:
    May 2010

    Posted 02 Jul 2014 in reply to Kaloyan Link to this post

    If you could provide more detailed information from your colleague, that would be helpful.  I am simply creating the default Kendo Mobile project in Visual Studio.  I've checked Project-Properties and don't see any option for setting the TypeScript module system.  I've also trolled through the Visual Studio - Tools - Options and don't see any settings there.
  7. Svetlozar
    Admin
    Svetlozar avatar
    269 posts

    Posted 02 Jul 2014 Link to this post

    Hello,

    I tried to give some more details about our VS story here - http://feedback.telerik.com/Project/129/Feedback/Details/132208-typescript-amd-typescript-module-system-option-in-compiler

    We are still looking for the best way to handle all scenarios. Meanwhile, I suggest you compile your TypeScript files on save using VS Tools – Options – Text Editor – TypeScript – Project – Compile On Save – Automatically compile TypeScript files which are not part of a project.

    If you have any questions or suggestions, please don't hesitate to write back.

    Regards,
    Svetlozar
    Telerik
     

    Share what you think about AppBuilder and Telerik Platform with us in our feedback portal, so we can become even better!

     
  8. Adam
    Adam avatar
    5 posts
    Member since:
    Jan 2004

    Posted 12 May 2015 Link to this post

    There is another way.... but you guys may not like it :)

     

       <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
        <TypeScriptRemoveComments>false</TypeScriptRemoveComments>
        <TypeScriptSourceMap>False</TypeScriptSourceMap>
        <TypeScriptTarget>ES5</TypeScriptTarget>
        <TypeScriptModuleKind>amd</TypeScriptModuleKind>
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)' == 'Release'">
        <TypeScriptRemoveComments>true</TypeScriptRemoveComments>
        <TypeScriptSourceMap>false</TypeScriptSourceMap>
        <TypeScriptTarget>ES5</TypeScriptTarget>
        <TypeScriptModuleKind>amd</TypeScriptModuleKind>
      </PropertyGroup>

     if you add the code above to your .iceproj file right above the typescript imports at the bottom of the file you can use typescript they way you want to.

     I have web essentials installed as well so that may also have something to do with why this works for me, I am guessing that the typescript files are being built locally rather than at compile on the server as I have also noticed that I must ensure my duplicate js files are included in the project or I get errors.

    I hope this helps someone 

  9. Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 14 May 2015 Link to this post

    Hi Adam,

    Thank you for sharing this with the community.

    Regards,
    Kaloyan
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
Back to Top