54
TiConf EU Amsterdam INGO MUSCHENETZ Sr. Director of Platform and Tooling, Appcelerator @bingomar

TiConf EU 2014

Embed Size (px)

Citation preview

Page 1: TiConf EU 2014

TiConf EU AmsterdamINGO MUSCHENETZSr. Director of Platform and Tooling, Appcelerator@bingomar

Page 2: TiConf EU 2014

About Me

Currently responsible for all “Client” productsLed design of Aptana, an open-source Web IDEAptana acquired by Appcelerator. Aptana folded into Titanium Studio10+ years fostering vibrant open source communitiesArchitected web-based framework for secure DoD healthcare applications (acquired by Humana)

Page 3: TiConf EU 2014

We can’t build it alone…

Page 4: TiConf EU 2014

The Titanium CommunityA FORCE FOR GOOD

Page 5: TiConf EU 2014

TITANIUM IS GROWING UP

Page 6: TiConf EU 2014

NUMBER OF UNIQUE MOBILE DEVICES

250,000,000

Page 7: TiConf EU 2014

NUMBER OF REGISTERED TITANIUM DEVELOPERS

604,000

Page 8: TiConf EU 2014

NUMBER OF CLOUD API REQUESTS

30,000,000,000

Page 9: TiConf EU 2014

FORTUNE 100 COMPANIES USING TITANIUM

68% of F100

Page 10: TiConf EU 2014
Page 11: TiConf EU 2014

The road ahead

Page 12: TiConf EU 2014

Upcoming Titanium Release

3.3.0 – targeted for mid-July800+ issues addressed (50% bugs, 50% features)Continued performance & parity improvements

Page 13: TiConf EU 2014

Ti.include()[gone!]*

*deprecated in 3.3.0. Will go away in 3.4.0

Page 14: TiConf EU 2014

Alloy

Custom TSS queries<Annotation> tag support in maps, plus data-binding for annotation generationWidget themesCustomizing the Android ActionBar using the <Menu> tagCreating Date/Time pickersKeyboard and returnkey type shortcuts

Page 15: TiConf EU 2014

Demo: AlloyCUSTOM TSS QUERIES

Page 16: TiConf EU 2014

Custom TSS Queries

'#boydlee': {image: '/boydlee.jpg',width: '75%',top: 10,borderWidth: 3

}

/* CUSTOM TSS QUERIES */

'#boydlee[if=Alloy.Globals.isTalliPhone]': {image: '/boydlee0.jpg',borderColor: '#4682b4'

}

'#boydlee[if=Alloy.Globals.isGalaxyS5]': {image: '/boydlee1.jpg',borderColor: '#70a050'

}

Page 17: TiConf EU 2014
Page 18: TiConf EU 2014

CLI

Windows HybridProject templatesConsolidated module projectsdeploy.json is baked into the APKNo more version number formatting for iOS and AndroidDisplay iOS logging when running app on deviceGenymotion officially supported (includes debugging)

Page 19: TiConf EU 2014

SDK

NSURLConnectionAppCompat libraryCoreMotion moduleView Clipping/View ShadowsFull-text search of documentationBlackBerry updates

Page 20: TiConf EU 2014

Studio

Push to device is default (no iTunes sync)Improved Studio Packaging (smaller, more robust)Configuring Studio proxy configures CLI proxyAlloy productivity features:

Jump to event/class/id definitions from controller classCreate event/class /id definitions from controller classCreate new view and style files through context menu

Page 21: TiConf EU 2014

Active Committers• Opened up Appcelerator

Community• Reduced active PRs

backlog by 50%• Invited Open-Source

module committers• Move wiki guides public

and invite comments• Prettify public spaces

Page 22: TiConf EU 2014

Automation and Testing

ti-mochaFramework for running Mocha-based unit tests in TitaniumBeta stagehttps://github.com/tonylukasavage/ti-mocha

tio2Framework for running Ti-mocha tests on emulators and devices and reporting resultsAlpha stagehttps://github.com/appcelerator/tio2

Page 23: TiConf EU 2014

That was the first half (H1) of 2014.How about H2 …or H6?

Page 24: TiConf EU 2014

Ti.Next

Next major release of Titanium (aka 4.0)Significant re-architecture of Titanium(Mostly) same APIHuge performance boost and reduction in app sizeImproved extensibilityWindows support

Page 25: TiConf EU 2014
Page 26: TiConf EU 2014

Ti.Next Foundation

Foundation of Ti.Next is a new compiler, built from the ground up for performance, extensibility

Open Source under Apache Public License v2http://github.com/appcelerator/hyperloopOver a year of R&D already on Hyperloop (6th generation compiler under development)

Page 27: TiConf EU 2014

Hyperloop fundamentally changes game

Hyperloop will allow mixed modes of integration:Titanium traditional (all-in)Titanium in NativeNative in TitaniumTitanium in other frameworks (Phonegap, Xamarin)Pure Native (Hyperloop only)

Page 28: TiConf EU 2014

What is Hyperloop?

Hyperloop turns JS code into native code by mapping the native APIs into JS syntaxHyperloop will be (mainly) used by Titanium platform developers to build Titanium APIs or modulesA more traditional compiler architecture:

Front-end (parse and transform JS AST)Back-end (generate native, platform specific code)+Metabase (metadata about target platform)

Page 29: TiConf EU 2014

Hyperloop iOS Example

“use hyperloop”

var view = new UIView(CGRectMake(100,100,50,50));

view.backgroundColor = UIColor.redColor();

var window = new UIWindow();

window.addSubview(view);

window.makeKeyAndVisible()

Need to revist (dn’t pollute the global namespace)

Page 30: TiConf EU 2014

Hyperloop Front-end

Front-end turns JS code into an AST and then performs transformations on the code to make it more suitable for native generation.

Page 31: TiConf EU 2014

JavaScript to Native

Ti.Current

app.js

Titanium SDK (JS)

Titanium SDK

(Native)

Ti.Next (Dev-Time)

app.js

Titanium SDK (JS)

Ti.SDK (Native)

Ti.Next (Runtime)

Ti.SDK (Native)

app.js (JS)

app.js (Native)

Ti.SDK (JS)

Page 32: TiConf EU 2014

Example Generation

app.js:

var b = 1;

HL_jscode.mm:

// variable:12 auto b = JSValueMakeNumber(ctx,1);auto var13 = JSStringCreateWithUTF8CString("b");JSObjectSetProperty(ctx,object,var13,b,0,exception);CHECK_EXCEPTION(exception);

Page 33: TiConf EU 2014

JavaScript to Native Compilation

Ti.Current FutureImproved HeuristicsHyperloop

(H1)Hyperloop

(H6)

JavaScript

Native

JavaScriptCore

Page 34: TiConf EU 2014

Hyperloop Back-end

Back-end generates C/C++ code for target platform

~90% of the back-end code is reusable for all platforms supported10% is basically specific syntax for things like calling methods, properties, etc. and other platform specific nuances (differences in file extensions, etc.)

Page 35: TiConf EU 2014

Hyperloop Metabase

Defined platform APIs in JSON formatAutomatically generated for all platforms supportedComplete tree of a platform’s public API (classes, functions, types, etc.)Supports C and platform-specific languages (Objective-C, Java, etc.)Uses Clang (+platform specific tools) to generateRich metadata about the platform

Page 36: TiConf EU 2014

Hyperloop Android Metabase example

"java.lang.String": { "package": "java.lang", "interfaces": [ "java.io.Serializable", "java.lang.Comparable", "java.lang.CharSequence" ], "superClass": "java.lang.Object", "attributes": [ "final", "public" ], "metatype": "class", "methods": { "<init>": [ { "exceptions": [], "args": [], "name": "<init>", "attributes": [ "public" ],

Page 37: TiConf EU 2014

Hyperloop iOS Metabase example

"NSString": { "metatype": "interface", "framework": "Foundation", "superClass": "NSObject", "protocols": [ "NSCopying", "NSMutableCopying", "NSSecureCoding" ], "name": "NSString", "methods": { "length": [ { "name": "length", "metatype": "method", "instance": true, "selector": "length", "returnType": "unsigned int", "returnSubtype": "NSUInteger", "requiresSentinel": false, "args": [] } ],

Page 38: TiConf EU 2014

Hyperloop Windows Metabase example

"Platform.String": { "methods": { ".ctor": [ { "attributes": [ "public", "hidebysig", "specialname", "rtspecialname", "instance", "runtime", "managed" ], "returnType": "void", "name": ".ctor", "args": [] } ], "modopt": [ { "attributes": [ "public", "hidebysig”,

Page 39: TiConf EU 2014

Hyperloop JS engine

Unified JS engine for all platforms based on JavaScriptCore

iOS 7.0+ comes with engine installedPort for Windows and Android

Performance testing showed JSC was basically native speed

Page 40: TiConf EU 2014

Hyperloop code re-writing

Huge blocks of code are optimized into pure native code generationNo penalty for “JS bridge” like in Ti.currentJS engine runs on main UI thread:

No thread context switching / creation overheadWill provide background worker for asynchronous non-blocking tasks

Page 41: TiConf EU 2014

Hyperloop Experimentation

git clone https://github.com/appcelerator/hyperloop.gitgit checkout v2.0.0./setup.shcd hyperloop-clisudo npm link

Page 42: TiConf EU 2014

Hyperloop Run (iOS)

cd <project directory>hyperloop clean library compile package launch --src=. --arch=i386

Interesting options:--dump-ir.hyperloop file, add { "obfuscate": false }

Page 43: TiConf EU 2014

Demo: Hyperloop On AndroidGENERATION 6 COMPILER (H6)

Page 44: TiConf EU 2014
Page 45: TiConf EU 2014

Demo: Hyperloop On WindowsGENERATION 6 COMPILER (H6)

Page 46: TiConf EU 2014
Page 47: TiConf EU 2014

Ti.Next

Titanium APIs are being implemented using Hyperloop and compiled using Hyperloop compiler

Titanium APIs (and native APIs) will be first-class JS objectsGoal is to generate API interfaces, test cases from API documentationFull Node.js require implementationWill likely deprecate platform specific APIs and provide a compatibility moduleLikely will reduce size of overall APITitanium APIs will use module design

Page 48: TiConf EU 2014

Ti.Next Modules

Migration path for modules (still trying to determine)Packaging likely will change and modules will be expressed in Hyperloop syntaxPossibility of a module compatibility shim

Page 49: TiConf EU 2014

Hyperloop in Ti.Current

Hyperloop is already being used in Ti.Current!

URLSession API in Titanium 3.2CoreMotion API in Titanium 3.3https://github.com/appcelerator/hyperloop/wiki/Using-Hyperloop-code-in-Ti.Current-SDKProbably our compatibility layer (so API will be same to developer, implementation different)

Page 50: TiConf EU 2014

When?

Gen6 compiler close to release:Almost have enough completed for all 3 major backends (iOS, Android, Windows) before Ti.Next API framework design can startLikely 6+ months from this pointTarget is beta before end of year…could be soonerLikely Windows Developer Preview Release first

Page 51: TiConf EU 2014

iOS 8

Similar approach to iOS 7. Pre-releases track public betasIn planning stages now. Gathering feedback on areas of interest

Capability of adding interactive widgets to the notifications areaHealth Kit / Home KitAdding Extensions to the Share SheetMultiple keyboardsCamera APIs / Touch API

Page 52: TiConf EU 2014

TO NEW ADVENTURES

Page 53: TiConf EU 2014

Thank YouINGO MUSCHENETZ@bingomar

Page 54: TiConf EU 2014