making visualforce remoteaction bulletproof with typescript

Post on 16-Apr-2017

424 Views

Category:

Technology

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Making Visualforce RemoteActions Bulletproof with TypeScript

 Simon Goodyear  Beaufort 12  @simongoodyear  

Simon Goodyear Co-Founder, Beaufort 12

Demo The Problem

Root Cause Analysis

 JavaScript is not metadata aware

Making JavaScript Metadata Aware

What we need Where we get it

Method Signatures Tooling API

Custom Apex Types Tooling API

SObjects Standard API

Making JavaScript Metadata Aware

 JavaScript is loosely typed

What is TypeScript?

  “TypeScript is a typed superset of JavaScript that compiles to plain JavaScript”

  “…a symantic subset of JavaScript; the sensical subset” – Anders Hejlsberg

  Aimed at improving the development experience for JavaScript

What is TypeScript?

  Strongly typed. Tools perform type inference.

  Modules, Classes & Interfaces

  4 primitives: string, number, boolean, any

  TypeScriptLang.org

Demo Introduction to TypeScript

Joining the Dots

  Represent metadata as classes in TypeScript

•  We need tools to do this

  We no longer write JavaScript

•  TypeScript only now

  TypeScript is compiled before deployment

•  And thus type checked

Demo Joining the dots

Where Next?

  Better flow for developers

•  Create a grunt task

•  Automatically generate d.ts files on metadata changes

  Improved support of metadata

•  Inner classes

•  Namespace support

  Integration with continuous integration tools

  Whatever else you can imagine

3 Simple Points

  JavaScript is not aware of the Salesforce metadata

  All the metadata is exposed via the Tooling and Standard APIs

  We can make TypeScript aware of the Salesforce metadata

Resources

  typescriptlang.org

  blogs.msdn.com/b/typescript

  channel9.msdn.com/Tags/typescript

  definitelytyped.org

  github.com/Microsoft/TypeScript-Sublime-Plugin

Thank you

top related