nativescript / ios-jsc Goto Github PK
View Code? Open in Web Editor NEWNativeScript for iOS using JavaScriptCore
Home Page: http://docs.nativescript.org/runtimes/ios
License: Apache License 2.0
NativeScript for iOS using JavaScriptCore
Home Page: http://docs.nativescript.org/runtimes/ios
License: Apache License 2.0
This test is failing on iOS 7.1.2 simulator.
The version diff tests should be rewritten not to depend on the iOS SDK, and should be more thorough testing all possible scenarios.
Notify the debugger or the CLI when an exception is thrown.
In Cordova one can call native APIs with JSON objects and they are converted to NSDictionary under the hood.
Consider the same behaviour for JSONArray <-> NSArray
We should call reportFatalErrorBeforeShutdown()
if there was a syntax error or runtime (e.g. wrong require
before we enter UIApplicationMain
) when executing bootstrap.js
so the debugger can be notified.
The file, line and column should be printed on syntax error. The JS stack of the error is not helping. This happens in the companion app.
We need something like a file watcher in the CLI that upon file save will perform fast deploy on the device.
We should check whether a regular "tns run ios" fits in decent times with the latest metadata generator and library improvements. If the delay is small we should simply hook a file watcher.
If the build time is not acceptable we should research how to deliver the changes to the phone and restart the app fast.
CLI generates xcode project that targets iOS 7.0. The project should be updated to latest (at the moment 8.2). And more important is to add Launch Screen File in the default template otherwise applications that run on iPhone 6 Plus are zoomed.
The modules are wrapped in a function that defines a local require
. However when using the debugger it would be useful to have the require
at hand, even if we are not stopped at breakpoint.
We can make that by defining a global require
function. It should search from a path relative to the app's root. And expressions such as:
global.require("ui/frame").topmost().ios.navBarVisibility
should easily locate the ui/frame
module.
Remove the Chrome and the build-log.txt from the npm package.tgz.
Requiring a file like
var file = require("./folder/myfile.js");
is currently not working, while it is a prefectly valid scenario in Node:
Node Modules
This is working in the Android Runtime.
My application id looks kinda like this: com.example.hello-world
. When I run the debug command, I get this error:
Invalid application id: com.example.helloworld. All available application ids are:
...
com.example.hello-world
....
The global object is currently polluted for iOS with all classes, structs, constants, functions etc. etc. for all iOS SDKs and additional libraries included in an App.
We want to expose the native APIs through require. So for example the UIButton will not appear as a class available in the global object but rather should be pulled through require("objc!UIKit")
.
Consider implementing this on top of the SystemJS #165 instead of the current Require implementation.
We will try to keep that backward compatible and preserve the SDK APIs in the global object but we will try to promote the require
usage as best practice.
Methods with null terminated varargs should not be added in the ios.d.ts
Use CMake to build the JSC used in NativeScript for iOS.
NSDictionary
adaptersSometimes when stepping over a statement, the debugger disconnects.
> tns platform add ios
Copying template files...
Failed to retrieve data from npm. Please try again a little bit later.. Error: Error: shasum check failed for /var/folders/t_/pbs1dpv94x17hfdb36t7sskc0000gn/T/npm-12540-93474c24/registry.npmjs.org/tns-ios/-/tns-ios-0.9.1.tgz
Expected: c9e9c3a2266b41c7623282166cb11ccbde2cc4f2
Actual: ef912b0a0dbd9727a3e2f09c06e439c53f730256
From: https://registry.npmjs.org/tns-ios/-/tns-ios-0.9.1.tgz
When using console.log()
with non-ASCII characters the output in stderr is trash. (The output in the console client is fine though.) The reason for this seems to come from utf8ForRange
which calls convertLatin1ToUTF8
.
In order to adopt rapidly new versions of the JSC we will need an infrastructure to run the relevant unit tests for JSC on emulator and devices.
Like here.
See the issue here #40. We currently detect whether the tns_modules are in the root of the Xcode project or in the app folder. We should clean the old behavior once our apps migrate.
The instaceof
operator should work and compile well with interop.Pointer
and interop.Reference
.
Possible solutions are to:
var
for Pointer.Currently we crash when tagged pointers are marshalled to JavaScript as wrapper objects on iOS 7 - 64 bit. This affects roughly 3% of all devices (statistics).
The reason lies in a bug in the Objective-C runtime, which seems to be fixed in iOS 8:
NSNumber *number = @123;
objc_setAssociatedObject(number, ...); // Crashes
Possible workarounds:
WeakGCMap
from pointer to JSValue
Once we have the metadata-generator's performance improved enough to run before build, we should drop the metadata from the npm package and run the tool before build. This should help us keep up with new iOS versions and native libraries.
You can't submit iOS frameworks with x86 architecture.
Embedded frameworks cannot contain nested frameworks.
See:
Related to NativeScript/android#40.
We are working on polishing the MetadataGenerator by rewriting it in C++.
Also we are planning to introduce a mechanism to "require" modules.
(e.g classes from UIKit will be available by using a require("UIKit")
)
So we will need the TypeScript declarations generator ported from the C# project to the C++ one.
Submodule path 'src/jsc': checked out '9cd6d7947270a7059c8f766ebea15d20543e4e2e'
Cloning into 'src/metadata-generator'...
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Clone of '[email protected]:NativeScript/ios-metadata-generator.git' into submodule path 'src/metadata-generator' failed
This would allow us to catch JS errors across native boundaries.
For example:
|-- bootstrap.js code (try block)
|-- [native code - e.g. UIApplicationMain] (unwind this frame)
|-- applicationDidFinishLaunchingWithOptions (error is thrown)
We should research how the application lifetime will be impacted by such interventions.
Possible solutions:
In the current implementation enumerations are exposed as:
var v1 = HMCharacteristicValueHeatingCooling.HMCharacteristicValueHeatingCoolingOff;
We should instead support both:
var v2 = HMCharacteristicValueHeatingCooling.Off;
var v3 = HMCharacteristicValueHeatingCoolingOff;
This way the code isn't so verbose and looks closer both to C/Objective-C and JavaScript.
This is a breaking API change, so it should be done sooner.
Currently CFUUIDCreateString
returns a JS string primitive, which can't be CFRelease
-d.
More info:
This should also be applicable to CFDateRef
and CFNumberRef
.
console.log
is somewhat hard to track.
We should provide a way to obtain the console.log output even in published apps.
Right now Promise .then()'s are preempted by scrolling and other UI events.
This is exhibited in the Cuteness app - images don't appear until scrolling ends because they are loaded with Promises.
/cc @hshristov
We need to support static libraries added in a NativeScript for iOS project.
One of the use cases is adopting existing codebase that is not available in source form.
We had request for the MagTek hardware support. They do distribute officially a static library.
We are not certain for implementation:
library add
like command with the lib*.a
file, point the headers that declare the exposed APIs and provide additional flags if necessary. Since static libraries does not declare their dependencies the developers may also need to resolve them.Create small examples using:
Also we should keep an eye on this issue, and try to satisfy its prerequisites. (pods for example)
Add out of the box support for:
News/Rumors
Google is embracing CocoaPods to bring its services to iOS developers
There are many private ugly APIs that only clutter the debugger and global object. We should remove them from the metadata.
The JSC C API hides them too.
Currently NSDecimalNumber
(which inherits from NSNumber
) is marshalled as JS number primitive and the precision is lost. We should create a wrapper object instead like we do for NSString
and NSMutableString
.
Hi,
Can I add images on tab buttons? Currently, I can do this:
<TabEntry title=“Title">
but I don’t find any image possibility. Is there any?
Thanks,
Eduárd
Think about implicitly converting pointer to ids. This will make the following code easier to translate to NativeScript:
CAGradientLayer *gradient = [CAGradientLayer layer];
gradient.colors = [NSArray arrayWithObjects:(id)[[UIColor whiteColor] CGColor], (id)[[UIColor blackColor] CGColor], nil];
Currently, this looks like this on NS:
var gradient = CAGradientLayer.layer();
var colorsArray = NSMutableArray.alloc().initWithCapacity(2);
colorsArray.addObject(interop.types.id(UIColor.redColor().CGColor));
colorsArray.addObject(interop.types.id(UIColor.blueColor().CGColor));
gradient.colors = colorsArray;
If there is implicit convertion - we can get rid of the interop.types.id( ... )
calls
We want to lower the dependencies for the end devs, and increase the performance of the metadata generator, so we are rewriting the metadata generator in C++. It will link statically all dependencies. The result should be a self contained command line tool.
Currently we build and ship the web inspector built in chrome compatibility. However we do not need the Chrome client in the npm module for now.
I'm developing custom iOS framework for NativeScript . Once library added , the metadata folder is not updated anymore and have to be deleted by hand to apply new changes.
There could be two overloads:
interop.alloc(sizeInBytes)
interop.alloc(numberOfElements, type)
which is a shorthand for interop.alloc(numberOfElements * interop.sizeof(type))
Hi everyone,
I am using a beta Yosemite, 10.3.3. and am trying to implement a simple location retrieve and I am getting this error when running the app in the emulator. The code is this:
if (LocationManager.isEnabled()) {
locationManager.startLocationMonitoring(function (location) {
mainViewModel.set("latitude", location.latitude);
mainViewModel.set("longitude", location.longitude);
}, function (error) {
console.log('Location error received: ' + error);
});
}
ERROR: org.nativescript.mobile is depending on legacy on-demand authorization, which is not supported for new apps
The other thing I tried is a simple latest location retreival:
location.getLocation({ maximumAge: 30000, timeout: 30 }).then(function (location) {
console.log('Location received: ' + location);
}, function (error) {
console.log('Location error received: ' + error);
});
Is there a way to make location work? I assume I should also request permission, but I don’t know how to do that.
Thanks,
Eduárd
Running "exec:libNativeScript_i386_x86_64" (exec) task
>> 2015-03-17 13:57:59.276 xcodebuild[75692:1007] +[MCLog load], env: (null)
>> 2015-03-17 13:57:59.278 xcodebuild[75692:1007] +[MCLog pluginDidLoad:], NSBundle </Users/admin/Library/Application Support/Developer/Shared/Xcode/Plug-ins/MCLog.xcplugin> (loaded)
>> ** BUILD FAILED **
>>
>>
>> The following commands produced analyzer issues:
>> ProcessPCH++ /Users/admin/Library/Developer/Xcode/DerivedData/NativeScript-fgiklipfbakxszehhukovewaiiey/Build/Intermediates/PrecompiledHeaders/NativeScript-Prefix-bvfhtokzrqkgxqhitqycfkossseh/NativeScript-Prefix.pch.pch NativeScript/NativeScript-Prefix.pch normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.analyzer
>> ProcessPCH++ /Users/admin/Library/Developer/Xcode/DerivedData/NativeScript-fgiklipfbakxszehhukovewaiiey/Build/Intermediates/PrecompiledHeaders/NativeScript-Prefix-bjvuvnszjqgedbccadprdsmucacj/NativeScript-Prefix.pch.pch NativeScript/NativeScript-Prefix.pch normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.analyzer
>> (2 commands with analyzer issues)
>>
>> The following build commands failed:
>> ProcessPCH++ /Users/admin/Library/Developer/Xcode/DerivedData/NativeScript-fgiklipfbakxszehhukovewaiiey/Build/Intermediates/PrecompiledHeaders/NativeScript-Prefix-cdzokvntawqmhxchizvfgcxdbsvl/NativeScript-Prefix.pch.pch NativeScript/NativeScript-Prefix.pch normal i386 c++ com.apple.compilers.llvm.clang.1_0.compiler
>> ProcessPCH++ /Users/admin/Library/Developer/Xcode/DerivedData/NativeScript-fgiklipfbakxszehhukovewaiiey/Build/Intermediates/PrecompiledHeaders/NativeScript-Prefix-bpvwiwtcwzhhjscvlnbcwkzipguc/NativeScript-Prefix.pch.pch NativeScript/NativeScript-Prefix.pch normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
>> ProcessPCH++ /Users/admin/Library/Developer/Xcode/DerivedData/NativeScript-fgiklipfbakxszehhukovewaiiey/Build/Intermediates/PrecompiledHeaders/NativeScript-Prefix-afqkafmuzxgvjwewufeqgtdypype/NativeScript-Prefix.pch.pch NativeScript/NativeScript-Prefix.pch normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
>> ProcessPCH++ /Users/admin/Library/Developer/Xcode/DerivedData/NativeScript-fgiklipfbakxszehhukovewaiiey/Build/Intermediates/PrecompiledHeaders/NativeScript-Prefix-badphdphizkkoqbkzouewsnygudg/NativeScript-Prefix.pch.pch NativeScript/NativeScript-Prefix.pch normal i386 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
>> ProcessPCH++ /Users/admin/Library/Developer/Xcode/DerivedData/NativeScript-fgiklipfbakxszehhukovewaiiey/Build/Intermediates/PrecompiledHeaders/NativeScript-Prefix-bvfhtokzrqkgxqhitqycfkossseh/NativeScript-Prefix.pch.pch NativeScript/NativeScript-Prefix.pch normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.analyzer
>> ProcessPCH++ /Users/admin/Library/Developer/Xcode/DerivedData/NativeScript-fgiklipfbakxszehhukovewaiiey/Build/Intermediates/PrecompiledHeaders/NativeScript-Prefix-bjvuvnszjqgedbccadprdsmucacj/NativeScript-Prefix.pch.pch NativeScript/NativeScript-Prefix.pch normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.analyzer
>> (6 failures)
>> Exited with code: 65.
Warning: Task "exec:libNativeScript_i386_x86_64" failed. Use --force to continue.
Try to squeeze as much as possible out of the TelerikNEXT Conference App. The application is close to the target LOB style applications we target. It has rich UI with lot of CSS styles and layout.
We should maximize the frame-rates, minimize CPU utilization, allocations, memory usage, frame-rate spikes/hiccups.
We should provide report on time spent in GC, JSC JavaScript or native code as well as memory spent for JavaScript heap and native allocations.
Cloning into 'src/generator/nclang'...
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Clone of '[email protected]:NativeScript/ios-metadata-generator-nclang.git' into submodule path 'src/generator/nclang' failed
Failed to recurse into submodule path 'src/metadata-generator'
This will require us to support build from the Xcode workspace the cocoapods generate.
We will have to somehow generate metadata for the cocoapods. The best solution would be to generate module maps from the podspecs.
We will have to reasearch what part of the cocoa apis can we consume (e.g there may be C apis that get stripped during the linking, although cocoapods add -ObjC flag)
Hi everyone,
Is there any way of reaching the iOS contacts?
Thanks,
Eduárd
Integrate NativeScript CLI with new metadata generator.
The iOS runtime should invoke global.__onUncaughtError(error)
(if set) on JavaScript error. After this function returns, the application will exit.
See also:
We need to build and distribute a shared framework out of the NativeScript.framework. This should be relatively easy, we have an internal proof of concept spike that proved that today views work with such framework. It should be distributed in the "tns-ios" npm package. However we should be sensitive for the filesize.
Then we need to provide bootstrappers and instructions how each type of the extension types can be set up manually. Please note that we will not integrate this in the CLI yet.
The most valuable deliverable would be a working WatchKit example. For integration with storyboards we will be ok to require manually written headers for now. In future if we provide our own XML markup for the WatchKit we will be able to generate headers from the XML. Or we can generate headers out of TypeScript declaration files if this would be more familiar to JavaScript developer.
We need to have only one copy of the metadata.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.