Monday, March 30, 2015

Easy debugging TypeScript and CoffeeScript in Sharepoint Apps with SPFastDeploy 3.6

Technorati Tags: ,,,,

SPFastDeploy 3.6

If you have been developing SharePoint hosted apps for a while then you may be using TypeScript or CoffeeScript to generate the JavaScript code. You can debug the generated JavaScript in the browser but it is hard to determine where in the TypeScript the error is occurring. Now with source mapping you can link the JavaScript to the TypeScript and step through the code. This makes it easier to figure out exactly where the code is breaking. Enhance your JavaScript debugging life. If you have included TypeScript in your Visual Studio project you can check to make sure you are generating the source map for the TypeScript using the project’s TypeScript Build settings.

SPFastDeploy makes it easy to step through TypeScript

SPFastDeploy has the feature to automatically deploy your code changes to a SharePoint app web when saving. This feature deploys the JavaScript that is generated when using TypeScript or CoffeeScript. However, in order to step through your TypeScript code you must also deploy the corresponding source map and TypeScript files. Version 3.6 now has the option to deploy all three files (JavaScript, source map and TypeScript) when saving. Just set the “Include source and source map” option to true.

Now when you save your changes SPFastDeploy will wait for the TypeScript to compile and generate the JavaScript. It will then look for the corresponding source map and Typescript file and deploy all three files to the SharePoint App.

SPFastDeploy only supports deploying source maps files when it is located in the same directory as the source file. You can now refresh your browser making sure the cache is cleared and start stepping through your changes in TypeScript.

Increase your SharePoint development productivity with SPFastDeploy 3.6 and TypeScript

With this release you can now get the benefits of immediately deploying your code changes when saving and the ability to step through your TypeScript code. Previous versions did not support deploying source map and TypeScript files. Now one click can deploy all three. Also, this release will enable you to right click source map and TypeSript files in the solution explorer and deploy them to your SharePoint App site. Finally, remember all the support for TypeScript is available for CoffeeScript. Thanks to Mikael Svenson for asking for this feature.


Darren Gosbell said...

Hi Steve, I've found that when I try to use the SQL Server 2016 Multi-Dimensional SSAS designers while SPFastDeploy is enabled that trying to save anything crashes VS 2015. It's only by disabling SPFastDeploy completely that I can save changes in a SSAS project in VS 2015. I'm not sure what this is as even switching off the "DeployWhenSaving" option does not help. I have to disable SPFastDeploy completely if I want to work with the Multi-Dimensional BI Designers.

Are you able to look into this? Or is the code for SPFastDeploy available somewhere that I could debug?


Steve Curran said...

Are you using the latest version of SPFastDeploy? What kind of solution is this?

Darren Gosbell said...

I'm using v3.6.2 which I believe is the latest. The solution that crashes is a "SQL Server 2016 Analysis Services Multi-Dimensional" solution, so SPFastDeploy should not even be trying to do anything, but with it enabled Visual Studio 2015 does a hard crash and automatically restarts. With SPFastDeploy disabled I don't get the crashes.

JC said...

I love this extension and thank you for building it!

I do have some files I try to resync with SPFastDeploy that are over 1.5MB (I assume with whatever message wrapping this adds up to over 2MB) and it bombs out with "The request message is too big. The server does not allow messages larger than 2097152 bytes.".

It looks like this might be fixable relatively simply by using the `ContentStream` property on `FileCreationInformation` instead of the `Content` property: (see "Uploading Large Documents with CSOM" section).

Any chance you might be able to implement this?! :) I have a few bundle files that I have to resort to ten/fifteen minute VS publishes every time I want to update.

Apparently `ContentStream` is faster in general, too, so it might be a worthy cause all round :)

Steve Curran said...

JC, I will put this in the next release.

Steve Curran said...

JC, please try version 3.6.3 for large file deployment. I made the changed to use the Content property of the FileCreationInformation class.

Richard said...

Thanks for creating SPFastDeploy. The tool used to work fine for me until they configured Multi-Factor Authentication in your SharePoint.
When I try SPFastDeploy, I'm prompted to enter my credentials, the next step was supposed to prompt me for 6 digits code, but I get the following message instead:
Error fast deploying selected items Error( The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.)
It would be nice if you could implement Multi-factor Authentication support in future versions.
Thank you

Post a Comment