Officejs - Addin Outlook - SmartAlerts - outlook

I developing addin for outlook and i using officejs framework and Yeoman Generator. I use SmartAlerts because with ItemSend event i can't deploy my plugin into Appsource. I have a problem: i would like to call/import my modules from typescript files into launchevent.js, a file to use for event "OnMessageSend". I see on documentation that is not possible.
I tried to create a new bundle but it work only if into file there is a import istruction and in this file i can't use it. How can i do?
Thanks

You may create a new add-in skeleton in TypeScript where you can import the required modules to the event handler's module. The TS compiler will produce the required JS files in the output folder. Webpack links code chunks with web pages. But that is not great idea to mix JS and TS files in the same solution. Use one or another programming language for your solutions. I prefer using TypeScript.

Related

Import existing modules in the VS code plugin extension

We're developing a VS Code extensions web plugin using Typescript. We already have a company provided component, which is downloaded in the node_modules folder. But when I'm referring those modules, the application does not start:
How can I use those components in my plugin extension.
From the web view standpoint, there's no Node.js, no VS Code, node_modules or anything you have in the extension you are writing. The content of the web view must be fully self contained. You have to use a bundler (like webpack) to create JS bundles of your application you want to show in the web view, which includes all the source code of the referenced 3rd party libraries.

how does spfx get builded? how to build custom spfx generator

I am learning spfx webpart. I open the gulpfile.js file but it only has limited code lines. how can I know the procedure of building spfx webpart?
And I notice that there is a PNP spfx generator. is it possible to create my own custom spfx generator? or involve spfx into my node project?
thanks
SPFx projects are built using a complex Build System that is an npm package. You can find it under node_modules folder under the name - #microsoft/sp-build-web
This package makes use of more packages. You can go into the node_moduels folder and look for packages named #microsoft/gulp-core-build*
The entire build system is built in Object oriented code with lots of classes and interfaces using TypeScript.
If you want to just customize the Build process then you can build custom tasks which are coded in the gulpfile.js.
On good article to learn is at - https://rencore.com/blog/extending-sharepoint-framework-build-process-custom-tasks/

Using Angular libraries in Nativescript code sharing project

I'm trying to migrate an Angular app to a shared codebase with Nativescript using the new #nativescript/schematics, however, I'm having problems importing my Angular library when building the mobile version of the app. I used the angular-cli to create the library (ng generate library).
For the web version, all I had to do was build the library separately using ng build library-name which then allowed me to import it into the main application.
How can I build a mobile version of the library that can be imported into the main application when running tns run ios --bundle? I've already migrated the components and module of the library with appropriate *.tns files.
Any help is appreciated
I had the same problem. Nativescript cli do not have this feature where we can build an angular library into npm package and use it in other projects.
I tried a workaround and it worked for me. Write a script to copy all of your project files into another directory and replace all *.tns.ts, *tns.html and *.tns.scss. files with *.ts, *.html and *.scss respectively. Then build these files using regular ng command. You can add a build configuration for the same in angular.json file to build from the copied directory. I hope it helps.
I'm sorry this is just a hyperlink answer but the space required to answer this, in my opinion, is way too large. I just finished finalizing a repo I've been working on to do exactly this. I have a whole slew of angular web libraries that I now want to make available for use on mobile using NativeScript. I have put everything I have learned so far into this repo and I hope it helps you too.
Thanks for the final push/idea #Rohit, a script for doing what he suggests is in the test-lib/gulpfile.js of this repo.

Visual Studio 2015/2017 +react +typescript

Have anyone found a complete react+typescript-tutorial in Visual Studio 2015/2017 MVC-project that works, from start to finish?
Ive tried to just get the NuGet-packages named "Reactjs Mvc4" and "typescript", created a .tsx-file, and copied some of the .config/package-files(from guide below), but the more I google, the more extra stuff I seem to be needing. In the end gets me different kinds of errors.
This one seems ok. It does produce all .config/.package-files one the correct locations, but it seems to assume you are using VS Code.
Hi check this cool template its good beginning for react typescript redux and router.
JavaScriptServices
You can generate VisualStudio project.
Form GIT:
JavaScriptServices is a set of client-side technologies for ASP.NET Core. It provides infrastructure that you'll find useful if you:
Use Angular / React / Vue / Aurelia / Knockout / etc.
Build your client-side resources using Webpack.
Execute JavaScript on the server at runtime.
Read Building Single Page Applications on ASP.NET Core with JavaScriptServices for more details.
This repo contains:
A set of NuGet/NPM packages that implement functionality for:
Invoking arbitrary NPM packages at runtime from .NET code (docs)
Server-side prerendering of SPA components (docs)
Webpack dev middleware (docs)
Hot module replacement (HMR) (docs)
Server-side and client-side routing integration (docs)
Server-side and client-side validation integration
"Lazy loading" for Knockout apps
A Yeoman generator that creates preconfigured app starting points (guide)
Samples and docs
It's cross-platform (Windows, Linux, or macOS) and works with .NET Core 1.0.1 or later.

Can I use Angular2 to build a JavaScript Universal Windows Platform App?

JavaScript newbie here. I'm new to Angular2 and am currently learning about things like module-loaders (there's so many!), etc, so bear with me since my space of "unknown unknowns" is probably quite large.
I'm interested in creating a JavaScript based "Packaged Web App" for windows ("Packaged" in the sense that the JS is included in the Universal Windows Platform app).
One constraint to keep in mind is that I have severe limitations on the size of my packaged app. The smaller, the better.
With that in mind, I have a few specific questions that will hopefully expose the extent of my ignorance:
Without resorting to Electron or Ionic2, is it possible (also, is it a good idea) to create the offline experience in Angular2 and then only manually include the resulting transpiled .js files in my Visual Studio project?
How hard is it to manage the dependencies for these transpiled files? Are they entirely self contained?
Roughly how large would the minimum set of manually imported files end up being? When I use NPM to install angular2, it winds up being ~80mb - a large portion of this (most?) looks like dev tools, test infrastructure, etc. What's the minimal set of angular dependencies needed for the client app to work?
Thanks!
Without resorting to Electron or Ionic2, is it possible (also, is it a good idea) to create the offline experience in Angular2 and then only manually include the resulting transpiled .js files in my Visual Studio project?
Yes, it is possible. TypeScript will be compiled to javascript codes, which will be consumed by your project. So eventually, it is compiled js codes that will be necessary for your project.
But, if you are so worried about your project's size, then I suggest you using Angular 1, which is only JS codes. And for the minimum size of Angular 1 and its dependency jquery. There is a compressed version of Angular 1 (angular.min.js: 164kb) and jquery(jquery-3.1.1.min.js: 85kb).
Answering my own question here:
Yes, it's possible. You can copy over the transpiled .js files and then simply point the webview control at the generated index.html. With that being said, it's a pretty kludgy dev experience since you're constantly working around VS.
The dependencies are handled for you - it's all in the minified/uglified js files.
I haven't investigated tree-shaking yet, but it looks like I can get away with ~0.5Mb with a skeleton project.

Resources