Introducing NativeScriptNativeScript runs JavaScript on a JavaScript VM • JavaScriptCore on iOS • V8 on Android • JavaScriptCore on Windows • Runs on V8 • Runs on JavaScriptCore Gathering Native APIs • NativeScript uses app package at build time. Injecting native APIs • V8/JavaScript Core have APIs to inject global variables Invoking native APIs • V8/JavaScriptCore have C++ callbacks for JS function calls NativeScript uses Android’s JNI (Java Native Interface) to make the bridge from C++ to Java. • 1) The V8 function callback runs. • 2) The NativeScript runtime uses its metadata to know that Time() means0 码力 | 47 页 | 3.36 MB | 1 年前3
Performance Lets dive into Performance issuesTesting • npm i v8-natives --save • Edit your app/package.json • Add --allow-native-syntax to v8Flags V8 Natives • Docs: https://github.com/NathanaelA/v8-Natives • Gives you access to low level engine information v8.helpers.testOptimization(func[, funcNames]) - Allows you to test a set of functions to see if v8 will be able to optimize it. Example code that can’t be optimized • debugger; statement. • Polymorphic0 码力 | 15 页 | 1.71 MB | 1 年前3
NativeScript 101libraries NativeScript Android Example output: JavaScript NativeScript iOS Example JavaScript Runs on V8 JavaScript VM Runs on JavaScriptCore VM NativeScript Module Layer (NML) o Abstractions on native0 码力 | 90 页 | 40.11 MB | 1 年前3
Awesome Native Apps with NativeScript and Angular- jfokus 2018 - @rowdyrabouw 23/120 NativeScript Runtime 4 Runs on JavaScript Virtual Machines 4 V8 (Android) 4 JavaScriptCore (iOS) 4 Executes C++ code to invoke native code 4 Uses reflection to0 码力 | 120 页 | 31.85 MB | 1 年前3
共 4 条
- 1













