GithubHelp home page GithubHelp logo

fuse-open / fuselibs Goto Github PK

View Code? Open in Web Editor NEW
176.0 176.0 72.0 34.53 MB

Fuselibs is the Uno-libraries that provide the UI framework used in Fuse apps

Home Page: https://npmjs.com/package/@fuse-open/fuselibs

License: MIT License

Uno 86.94% Java 2.92% Objective-C 2.20% Objective-C++ 1.03% C# 0.75% C++ 0.70% JavaScript 4.90% HTML 0.02% CSS 0.05% C 0.34% Shell 0.14%
app-development framework fuse uno

fuselibs's People

Contributors

alexeybuzdin avatar anagrr avatar andreweq avatar bolav avatar bondehagen avatar cbaggers avatar ckarmy avatar clebal avatar dermitch avatar devadiab avatar duckers avatar eeue56 avatar eksperts avatar ianychoi avatar ichan-mb avatar jesusmartinoza avatar knatten avatar kristianhasselknippe avatar kusma avatar luisrodriguezld avatar mortend avatar mortoray avatar petterroea avatar rhencke avatar sebbert avatar sunjammer avatar tanordheim avatar tapped avatar telatao avatar yupferris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fuselibs's Issues

TextAlignment broken on TextInput in Fuse 1.1.0

Reported on community.
Tested on Windows 10 and macOS.
Fuse 1.1.0 build 13808.

Affected: local preview and dotnet build, Android preview and build.
Not affected: iOS preview and build.

Repro:

<App>
    <TextInput Alignment="VerticalCenter" TextAlignment="Center" PlaceholderText="This Should be centered." Margin="8" />
</App>

On local preview, the caret is aligned to the very left edge of the TextInput, when it should be aligned to the left edge of the PlaceholderText value (it does that on iOS). When you start typing, caret moves to the expected place and the content you enter appears correctly centered. When you release focus, the content stays centered too which is as expected.

On Android, the PlaceholderText is aligned to the left (should be in center), then when you focus the TextInput it becomes centered and looks exactly like it would on iOS which is as expected, and it's fine while you're typing; no problems with caret position either. Then when you release focus, the content aligns to the left again.

`Each.Reuse` with `Each.ObjectId` cooperation

These two features probably don't work well together if layout/adding/removing animations are being used.

It will be necessary for Each to disinguish a node being reused from the cache and one being matched based on ID. If it's a cache reuse this will need to trigger some kind of virtual "added" event. This would block LayoutAnimation from doing anything.

To be even more useful (works with Adding/RemovingAnimation) this may also need to extend to defer addition of new items until the old ones are finished being removed. Somehow it can trigger a virtual "removed" event, wait for the animation to finish, then grab and reuse the nodes for the new items.

Vibration with Delay=0 doesn't play unless there's one with non-zero delay in the same trigger

Fuse 1.0.1.13566 on a Galaxy S7

This code has three triggers that should play vibration. The first one, with Delay=0, never plays. In the second one, where there's also one with Delay=2, both the vibrations play. In the final trigger, where there's no delay specified, the vibration also plays.

I've observed the exact same issue with PlaySound, so I suspect the actual problem is related to some common action-code, not Vibration itself.

<App>
	<ClientPanel>
		<StackPanel>
			<Button Text="Delay 0">
				<Clicked>
					<DebugAction Message="Clicked Delay 0"/>
					<Vibrate Duration="1" Delay="0"/> <!-- This never plays -->
				</Clicked>
			</Button>
			<Button Text="Delay 0 and 1">
				<Clicked>
					<DebugAction Message="Clicked 0 and 1"/>
					<Vibrate Duration="1" Delay="0"/> <!-- This plays -->
					<Vibrate Duration="1" Delay="2"/> <!-- This plays -->
				</Clicked>
			</Button>
			<Button Text="No delay">
				<Clicked>
					<DebugAction Message="Clicked no delay"/>
					<Vibrate Duration="1"/> <!-- This plays -->
				</Clicked>
			</Button>
		</StackPanel>
	</ClientPanel>
</App>

Fuse preview error

I am using Fuse 1.0.0, which i just installed today on a Windows 10. Whenever I try to preview a project I get the following error...

Fuse 1.0.0 (build 13426)
Configuring (0.6 s)
Compiling syntax tree (2.0 s)
Generating code and data (5.2 s)
Building Android app
2/2: dynamic-tab-bar.apk

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:externalNativeBuildDebug'.
> Build command failed.
Error while executing 'C:\Users\sg\AppData\Local\Android\sdk\cmake\3.6.3155560\bin\cmake.exe' with arguments {--build C:\Users\sg\Desktop\Fuse\dynamic-tab-bar\build\Android\Preview\app\.externalNativeBuild\cmake\debug\armeabi-v7a --target dynamictabbar}
[1/1] Re-running CMake...
-- CMAKE_C_FLAGS:         -isystem C:/Users/sg/AppData/Local/Android/sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=16 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security
-- CMAKE_CXX_FLAGS:         -isystem C:/Users/sg/AppData/Local/Android/sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=16 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/sg/Desktop/Fuse/dynamic-tab-bar/build/Android/Preview/app/.externalNativeBuild/cmake/debug/armeabi-v7a
[1/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/_root.dynamictabbar_F-c936eebb.cpp.o
[2/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/_root.MainView.cpp.o
[3/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/BootstrapperImpl_Android.cpp.o
[4/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/_root.ColorPalette.cpp.o
[5/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/_root.dynamictabbar_F-42fe069c.cpp.o
[6/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/_root.dynamictabbar_F-9e997f2.cpp.o
[7/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/_root.dynamictabbar_bundle.cpp.o
[8/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/_root.g.cpp.o
[9/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/_root.dynamictabbar_F-10a52eac.cpp.o
[10/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/_root.dynamictabbar_F-15e34268.cpp.o
[11/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/_root.MainView.Template.cpp.o
[12/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/_root.dynamictabbar_F-fd296813.cpp.o
[13/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/_root.dynamictabbar_F-c2dd622.cpp.o
[14/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/Uno.Testing.g.cpp.o
[15/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/Source/pugixml.cpp.o
[16/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/hb-ft-cached.cc.o
[17/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/_root.dynamictabbar_F-8da1d66b.cpp.o
[18/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/_root.dynamictabbar_F-b1f4bf63.cpp.o
[19/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/Uno/Memory.cpp.o
[20/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/Uno/ObjectModel.cpp.o
[21/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/Uno/_invoke.cpp.o
[22/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/Uno/Support.cpp.o
[23/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/Uno/_mainMobile.cpp.o
[24/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/Uno/Graphics/GLHelper.cpp.o
[25/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/Implementation/Cpp/posix_thread.cpp.o
[26/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/Implementation/Cpp/posix_reset_event.cpp.o
[27/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/Uno/Base64.cpp.o
[28/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/Uno/JNIHelper.cpp.o
[29/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/Uno/EntryPoints.cpp.o
[30/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/Uno/Reflection.cpp.o
[31/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/Implementation/Cpp/posix_mutex.cpp.o
[32/153] Building CXX object CMakeFiles/dynamictabbar.dir/app/src/main/jni/Uno.Content.Fonts.g.cpp.o
FAILED: C:\Users\sg\AppData\Local\Android\sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe  --target=armv7-none-linux-androideabi --gcc-toolchain=C:/Users/sg/AppData/Local/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64 --sysroot=C:/Users/sg/AppData/Local/Android/sdk/ndk-bundle/sysroot  -DANDROID_NDK=C:/Users/sg/AppData/Local/Android/sdk/ndk-bundle -DANDROID_PLATFORM=9 -DANDROID_STL=stlport_shared -DANDROID_TOOLCHAIN=clang -Ddynamictabbar_EXPORTS -I../../../../src/main/include -IC:/Users/sg/AppData/Local/Fusetools/Packages/UnoCore/1.0.11/prebuilt/Android/include -IC:/Users/sg/AppData/Local/Android/sdk/ndk-bundle/sources/android/support/include -IC:/Users/sg/AppData/Local/Fusetools/Packages/Fuse.Scripting.V8/1.0.2 -IC:/Users/sg/AppData/Local/Fusetools/Packages/Fuse.Text/1.0.2/harfbuzz/include -isystem C:/Users/sg/AppData/Local/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem C:/Users/sg/AppData/Local/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -isystem C:/Users/sg/AppData/Local/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -isystem C:/Users/sg/AppData/Local/Android/sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=16 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security   -std=c++11 -Wno-unused-value -Wno-dangling-else  -Wno-invalid-offsetof -fexceptions -frtti -O0 -fno-limit-debug-info  -fPIC -MD -MT CMakeFiles/dynamictabbar.dir/app/src/main/jni/Implementation/Cpp/posix_mutex.cpp.o -MF CMakeFiles\dynamictabbar.dir\app\src\main\jni\Implementation\Cpp\posix_mutex.cpp.o.d -o CMakeFiles/dynamictabbar.dir/app/src/main/jni/Implementation/Cpp/posix_mutex.cpp.o -c C:\Users\sg\Desktop\Fuse\dynamic-tab-bar\build\Android\Preview\app\src\main\jni\Implementation\Cpp\posix_mutex.cpp
C:\Users\sg\Desktop\Fuse\dynamic-tab-bar\build\Android\Preview\app\src\main\jni\Implementation\Cpp\posix_mutex.cpp:23:13: error: use of undeclared identifier 'pthread_mutex_lock_timeout_np'
       return pthread_mutex_lock_timeout_np(mutexHandle, millisecondsTimeout) == 0;
              ^
  1 error generated.
  C:\Users\sg\Desktop\Fuse\dynamic-tab-bar\build\Android\Preview\app\src\main\jni\Uno\Graphics\GLHelper.cpp:243:21: warning: self-comparison always evaluates to true [-Wtautological-compare]
              samples <= samples && r <= colorBits.R && g <= colorBits.G && b <= colorBits.B && a <= colorBits.A)
                      ^
  1 warning generated.
  ninja: build stopped: subcommand failed.


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
## 2/2: dynamic-tab-bar.apk
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2340Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72340Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2340Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72340Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42340Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2340Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:generateJsonModelDebug UP-TO-DATE
:app:externalNativeBuildDebug
  building C:\Users\sg\Desktop\Fuse\dynamic-tab-bar\build\Android\Preview\app\.externalNativeBuild\cmake\debug\obj\armeabi-v7a\libdynamictabbar.so
:app:externalNativeBuildDebug FAILED

BUILD FAILED

Total time: 19.248 secs
(unknown): E0200: Android build failed
?: Error E0200: Android build failed
(20.3 s)

Build completed in 28.17 seconds
    1 error
fuse: Failed to compile project 

index() and offsetIndex() UX expressions do not work in-line Each on preview

Fuse 1.1.0 build 13808, macOS.
Affected: all previews.
Not affected: builds.

Repro:

<App>
	<JavaScript>
		var items = [1,2,3,4,5,6,7,8,9,10];
		module.exports = {
			items: items
		};
	</JavaScript>
	<StackPanel ItemSpacing="8" Margin="8">
		<Each Items="{items}" Offset="2" Limit="4">
			<Panel Height="48">
				<Text Value="value: {}; index: {= index(this)}; offsetIndex: {= offsetIndex(this)}" Alignment="CenterLeft" />
			</Panel>
		</Each>
	</StackPanel>
</App>

Throws Could not find and Instantiator in Problems tab.

Double-subscribing to observable gives inconsistent behavior (in 1.2, not yet released)

Toggling the switch doesn't re-add the Fo items the second time:

	<JavaScript>
		var Observable = require("FuseJS/Observable")

		exports.foo = Observable(1,2,3)
	</JavaScript>
	<StackPanel ux:Name="sp">
		<Each Items="{foo}">
			<Text>Yo</Text>
		</Each>
		<WhileTrue Value="{Property sw.Value}">
			<Each Items="{foo}">
				<Text>Fo</Text>
			</Each>
		</WhileTrue>
		<Switch ux:Name="sw" />
	</StackPanel>
</App>```

Referring to Fuse.Maps without using MapView fails Android builds

This seems to be because the MapView contains the Gradle.Dependency.Compile-dependency, which gets stripped. However, FuseMaps.java doesn't get stripped, which depends on that gradle-dependency.

This should probably be solved by wrapping the java-code in a

#if !@{Fuse.Maps.Android.MapView:IsStripped}
#endif

block, which ProcessFile will allow us to expand at compile-time.

iOS fatal crash: NSInvalidArgumentException - [MKUserLocation markerID]: unrecognized selector sent to instance

Reported on community.

Fuse version 1.1.0 (build 13808) OS: macOS Sierra 10.12.5
Most likely affected both iOS preview and iOS build. Crash happens when clicking the "My location" button.

Errors:

2017-07-12 23:14:38.601761+0600 MapViewExample[5507:1342038] -[MKUserLocation markerID]: unrecognized selector sent to instance 0x1708357c0
2017-07-12 23:14:38.603134+0600 MapViewExample[5507:1342038] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MKUserLocation markerID]: unrecognized selector sent to instance 0x1708357c0'
*** First throw call stack:
(0x18a3dafe0 0x188e3c538 0x18a3e1ef4 0x18a3def54 0x18a2dad4c 0x1000a2d2c 0x196ac1264 0x196a81b58 0x196ab36b8 0x190addd38 0x190ae156c 0x19069b470 0x19053d380 0x190ad1810 0x18a3889a8 0x18a386630 0x18a386a7c 0x18a2b6da4 0x18bd20074 0x190571058 0x1000a13d4 0x1892c559c)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

Repro:

<App>
    <JavaScript>
    function log(obj, mapEventArgs) {
        console.log(JSON.stringify(obj));
        console.log(JSON.stringify(mapEventArgs));
    }
    module.exports = {
        log: log
    }
    </JavaScript>
    <ClientPanel>
        <NativeViewHost Background="#000" >
                <MapView Latitude="42.8227562" Longitude="74.6230976" Zoom="10" ShowMyLocationButton="true" LocationTapped="{log}" MarkerTapped="{log}" ShowMyLocation="true">
                    <MapMarker Latitude="42.8227562" Longitude="74.6230976" Label="Fuse HQ"/>
                </MapView>
            </NativeViewHost>
    </ClientPanel>
</App>

Names are being parsed as data-variables when bound to an `IExpression`

In the test at https://github.com/mortoray/fuselibs-public/blob/exprarrayerror/Source/Fuse.Reactive.Bindings/Tests/Expression.Test.uno#L74 the reference to one is being generated incorrectly when bound to an IExpression.

The same expression is bound to an IArray and IExpression in this data. When bound to the array it has the correct interpretation of one, when bound to IExpression it is wrong.

I couldn't figure out how to test this in this branch, but look at the generated code for the ParameterContext UX file. In my other branch I can evaluate the expression directly, thus have a test for it.

BundleTests.TestExtract fails spuriously

Here's an example log:

Starting project 'FuseJS.Test', target 'Native'
Started test runner on http://localhost:64419/
Configuring (0.9 s)
Compiling syntax tree (1.1 s)
Generating code and data (7.2 s)
Building Native app (58.5 s)
Build completed in 67.74 seconds
---
OK:      FuseJS.Test.FuseJS.Test.Base64Tests.JavaScriptTests (87,737 μs)
FAILED:  FuseJS.Test.FuseJS.Test.BundleTests.TestExtract
         Assertion failed in 'TestExtract', at /Users/travis/build/fusetools/fuselibs-public/Source/FuseJS/Tests/Bundle.Test.uno:67
           Expected: True
           But got : 
OK:      FuseJS.Test.FuseJS.Test.BundleTests.TestList (24,018 μs)
OK:      FuseJS.Test.FuseJS.Test.BundleTests.TestRead (12,034 μs)
OK:      FuseJS.Test.FuseJS.Test.BundleTests.TestReadBuffer (16,860 μs)
OK:      FuseJS.Test.FuseJS.Test.BundleTests.TestReadSync (9,121 μs)
OK:      FuseJS.Test.FuseJS.Test.Latin1HelpersTests.DecodeLatin1_given_valid_base64_encoded_arg_decodes_string (10 μs)
OK:      FuseJS.Test.FuseJS.Test.Latin1HelpersTests.EncodeLatin1_given_string_with_invalid_Latin1_characters_throws_exception (36 μs)
OK:      FuseJS.Test.FuseJS.Test.Latin1HelpersTests.EncodeLatin1_given_valid_Latin1_string_encodes_to_base64 (4 μs)
OK:      FuseJS.Test.FuseTest.SatisfyUnoTest.Test (2 μs)
OK:      FuseJS.Test.JsTest.Environment (84,067 μs)
Built & ran 11 tests in 68.99 seconds (233,889 μs)
Failures: 1

Create a "getting started" doc

As discussed, a GettingStarted.md file should be created here, so that it can be linked to from README.

It should include a set-up procedure description for both Windows and macOS, covering such things as:

  • checking out a local copy of the repo
  • .unoconfig setup
  • building libs
  • how to check / ensure that the new libs are in place and will be used (uno config)
  • which libs Fuse prefers when fuselibs-public has been added (vs the ones shipped with install?)
  • how to painlessly revert to default libs

Fuse.Launcher.Maps problem with query strings

Initially reported on community: https://www.fusetools.com/community/forums/howto_discussions/fusejsmaps_module_js

The root cause of the problem is that the InterApp call opens a link to "http://maps.apple.com/maps?q=" + query ... here: https://github.com/fusetools/fuselibs-public/blob/master/Source/Fuse.Launcher.Maps/Maps/MapsLauncher.uno#L56

There are two potential solutions:

  1. URLencode the query on Uno side before calling LaunchUriiOS.
  2. Change the docs and explain that using encodeURI() on the query string in JavaScript when calling the method is required.

The problem manifests itself on iOS, but the Android counterpart uses a "geo:0,0?q=" + query scheme, so it might be vulnerable too.

Share.shareText() kills app on iPads

Reported on community.

When using the Fuse.Share package in an app, the following action leads to the app crashing on all iPads, including simulators:

Share.shareText('Eu sou dooper! Descolei 10% OFF pra vc lá com o código #soulegal... Não conhece o Doop? tá perdendo então. Baixe agora para seu smartphone http://guiadoop.com.br/compartilhe #doop #guiasdoop #dooper #soudooper','');

The log associated with the crash tells us:

2017-06-26 19:04:58.385 DoopFuse[66017:59524395] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Your application has presented a UIActivityViewController (<UIActivityViewController: 0x7fae7ed18d20>). In its current trait environment, the modalPresentationStyle of a UIActivityViewController with this style is UIModalPresentationPopover. You must provide location information for this popover through the view controller's popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem.  If this information is not known when you present the view controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation.'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000110e67b0b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x000000010f2fb141 objc_exception_throw + 48
    2   UIKit                               0x000000010e56ed67 -[UIPopoverPresentationController presentationTransitionWillBegin] + 3291
    3   UIKit                               0x000000010dc163c2 __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke + 2278
    4   UIKit                               0x000000010dc13d20 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 426
    5   UIKit                               0x000000010daa1853 _runAfterCACommitDeferredBlocks + 318
    6   UIKit                               0x000000010da8e81c _cleanUpAfterCAFlushAndRunDeferredBlocks + 532
    7   UIKit                               0x000000010dac0560 _afterCACommitHandler + 137
    8   CoreFoundation                      0x0000000110e0d717 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    9   CoreFoundation                      0x0000000110e0d687 __CFRunLoopDoObservers + 391
    10  CoreFoundation                      0x0000000110df2720 __CFRunLoopRun + 1200
    11  CoreFoundation                      0x0000000110df2016 CFRunLoopRunSpecific + 406
    12  GraphicsServices                    0x0000000112d4da24 GSEventRunModal + 62
    13  UIKit                               0x000000010da95134 UIApplicationMain + 159
    14  DoopFuse                            0x0000000109dd3337 main + 119
    15  libdyld.dylib                       0x000000011212965d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

The exact same code runs fine on iPhone 6 and presumably other iPhones too.

StatusBarBackground and BottomBarBackground issues on Android Nougat

Reported on community: https://www.fusetools.com/community/forums/general/android_nougat_samsung_s8

Tested with Android 7 running on Samsung Galaxy S8. Use the pull-to-reload example for testing.

First issue: there is a double StatusBarBackground; the expected one, and another black one right below it:
ib5csmpvxdwr-image-1497272087865

Second issue: the BottomBarBackgound is weirdly transparent; if you switch to another application and then reopen the Fuse preview, the other app shines through the BottomBarBackground:
sbry4oayfkmj-image-1497272112971

BusyTest.CompletedReset and BusyTest.JavaScript spurious failure

FAILED: Fuse.Triggers.Test.Fuse.Triggers.Test.BusyTest.CompletedReset
Assertion failed in 'CompletedReset', at C:\projects\fuselibs-public\Source\Fuse.Triggers\Tests\Busy.Test.uno:337
Expected: 2
But got : 1
OK: Fuse.Triggers.Test.Fuse.Triggers.Test.BusyTest.IsHandled (1,621 �s)
FAILED: Fuse.Triggers.Test.Fuse.Triggers.Test.BusyTest.JavaScript
Exception was thrown: System.Exception: Unchecked, queued Diagnostics!
at FuseTest.RecordDiagnosticGuard.Dispose() in C:\projects\fuselibs-public\Source\Fuse.Common\Tests\FuseTest\TestBase.uno:line 65
at Fuse.Triggers.Test.BusyTest.JavaScript() in C:\projects\fuselibs-public\Source\Fuse.Triggers\Tests\Busy.Test.uno:line 99
at MainClass.Invoke___Fuse_Triggers_Test_BusyTest_JavaScript()
at Uno.Testing.AbstractRunner.RunTest(NamedTestMethod test) in C:\projects\fuselibs-public\Stuff\lib\Uno.Testing\1.1.0$.uno:line 110

See this log

Hiding iOS status bar in a small photo taking app crashes on iPhone 7

It does not crash on iPhone 5.

Tested with uno build from an installed Fuse 1.0.1, which has Uno 1.0.12.

The following app crashes as soon as you tap "Take picture".

If you remove the <iOS.StatusBarConfig> line, the app no longer crashes.

<App>
	<JavaScript>
		var Observable = require("FuseJS/Observable");
		var Camera = require("FuseJS/Camera");
		var ImageTools = require("FuseJS/ImageTools")

		var picture = Observable();

		function snap()
		{
			Camera.takePicture().then(function(image)
			{
				picture.value = image;
				ImageTools.getBufferFromImage(image).then(function(buffer) {
					router.goto("takenPicture");
				}).catch(function(e) {
					console.log("1 " + e);
				});
			}).catch(function(e) {
				console.log("2 " + e);
			});
		}

		module.exports =
		{
			snap
		}
	</JavaScript>
	<DockPanel>
		<iOS.StatusBarConfig ux:Name="statusBarConfig" Style="Light" IsVisible="false" />
		<Router ux:Name="router"/>
		<Navigator DefaultPath="start">
			<StartPage ux:Template="start"/>
			<TakenPicturePage ux:Template="takenPicture"/>
		</Navigator>

		<BottomBarBackground Dock="Bottom" />
	</DockPanel>

	<Page ux:Class="StartPage" Alignment="Center">
		<Text Value="Take picture" Clicked="{snap}" />
	</Page>

	<Page ux:Class="TakenPicturePage" Alignment="Center">
        <Text Value="Took picture" />
	</Page>
</App>

Stack trace:

Crash7 was compiled with optimization - stepping may behave oddly; variables may not be available.
* thread #10, stop reason = signal SIGABRT
    frame #0: 0x000000018a03b014 libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x000000018a103450 libsystem_pthread.dylib`pthread_kill + 112
    frame #2: 0x0000000189faf400 libsystem_c.dylib`abort + 140
    frame #3: 0x0000000189a792d4 libc++abi.dylib`abort_message + 132
    frame #4: 0x0000000189a96cc0 libc++abi.dylib`default_terminate_handler() + 304
    frame #5: 0x0000000189aa4844 libobjc.A.dylib`_objc_terminate() + 124
    frame #6: 0x0000000189a9366c libc++abi.dylib`std::__terminate(void (*)()) + 16
    frame #7: 0x0000000189a92f84 libc++abi.dylib`__cxa_throw + 136
    frame #8: 0x0000000189aa4690 libobjc.A.dylib`objc_exception_throw + 364
    frame #9: 0x000000018b06d08c CoreFoundation`+[NSException raise:format:arguments:] + 104
    frame #10: 0x000000018bb2502c Foundation`-[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112
    frame #11: 0x00000001911a3690 UIKit`-[UIApplication _cachedSystemAnimationFenceCreatingIfNecessary:] + 196
    frame #12: 0x00000001911fad70 UIKit`+[UIWindow _synchronizeDrawingWithPreCommitHandler:] + 68
    frame #13: 0x0000000190fdde7c UIKit`-[UIApplication _setStatusBarHidden:animationParameters:changeApplicationFlag:] + 700
    frame #14: 0x0000000190f29448 UIKit`-[UIApplication _updateCurrentStatusBarViewControllerAppearance] + 436
    frame #15: 0x0000000190f98308 UIKit`-[UIViewController setNeedsStatusBarAppearanceUpdate] + 204
    frame #16: 0x000000019101e318 UIKit`-[UIViewController _setPresentedStatusBarViewController:] + 96
    frame #17: 0x000000019128d488 UIKit`-[UIViewController _presentViewController:modalSourceViewController:presentationController:animationController:interactionController:completion:] + 1512
    frame #18: 0x000000019128edec UIKit`-[UIViewController _presentViewController:withAnimationController:completion:] + 4524
    frame #19: 0x0000000191291920 UIKit`-[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 524
    frame #20: 0x0000000191015154 UIKit`-[UIViewController presentViewController:animated:completion:] + 184
  * frame #21: 0x00000001000fd3b0 Crash7`-[ImagePicker openImagePickerWithSourceType:then:or:](self=<unavailable>, _cmd=<unavailable>, type=<unavailable>, a=<unavailable>, or=<unavailable>) at ImagePicker.m:22 [opt]
    frame #22: 0x00000001000fa738 Crash7`-[CameraHelper takePictureWithCompletionHandler:onFail:](self=0x0000000170467a40, _cmd=<unavailable>, onComplete=<unavailable>, onFail=<unavailable>) at CameraHelper.m:16 [opt]
    frame #23: 0x000000010028b6d8 Crash7`g::Fuse::Camera::iOSCamera::TakePictureInternal(uDelegate*, uDelegate*) [inlined] g::Fuse::Camera::iOSCamera::TakePictureInternal(uDelegate*, uDelegate*)::$_0::operator()(void (NSString*) block_pointer, void (NSString*) block_pointer) const at Fuse.Camera.iOSCamera.mm:64 [opt]
    frame #24: 0x000000010028b6a4 Crash7`g::Fuse::Camera::iOSCamera::TakePictureInternal(onComplete=<unavailable>, onFail=<unavailable>) at Fuse.Camera.iOSCamera.mm:62 [opt]
    frame #25: 0x000000010028afd8 Crash7`g::Fuse::Camera::Camera::TakePictureInterface(uArray*) [inlined] g::Fuse::Camera::Camera::TakePicture1(p=<unavailable>) at Fuse.Camera.g.cpp:134 [opt]
    frame #26: 0x000000010028afd4 Crash7`g::Fuse::Camera::Camera::TakePictureInterface(args=<unavailable>) at Fuse.Camera.g.cpp:158 [opt]
    frame #27: 0x000000010028aefc Crash7`g::Fuse::Camera::Camera__TakePictureInterface_fn(args=<unavailable>, __retval=0x000000016e20a450) at Fuse.Camera.g.cpp:100 [opt]
    frame #28: 0x00000001000f5df8 Crash7`uDelegate::Invoke(this=0x000000017428fff0, retval=<unavailable>, args=0x000000016e20a460, count=2) at ObjectModel.cpp:1462 [opt]
    frame #29: 0x00000001000f6114 Crash7`uDelegate::Invoke(this=<unavailable>, count=<unavailable>) at ObjectModel.cpp:1553 [opt]
    frame #30: 0x00000001001a1ac4 Crash7`g::Fuse::Scripting::NativePromise__ContextClosure::CreatePromise(this=0x00000001704769c0, args=0x00000001704681c0) at Fuse.Scripting.g.cpp:1063 [opt]
    frame #31: 0x00000001001a1a20 Crash7`g::Fuse::Scripting::NativePromise__ContextClosure__CreatePromise_fn(__this=<unavailable>, args=<unavailable>, __retval=0x000000016e20a590) at Fuse.Scripting.g.cpp:1039 [opt]
    frame #32: 0x00000001000f5df8 Crash7`uDelegate::Invoke(this=0x00000001702904a0, retval=<unavailable>, args=0x000000016e20a5a0, count=3) at ObjectModel.cpp:1462 [opt]
    frame #33: 0x00000001000f6114 Crash7`uDelegate::Invoke(this=<unavailable>, count=<unavailable>) at ObjectModel.cpp:1553 [opt]
    frame #34: 0x00000001001acc94 Crash7`g::Fuse::Scripting::JavaScriptCore::Context__CallbackWrapper::Call(this=0x0000000170476a00, args=<unavailable>, exception=0x000000016e20a770) at Fuse.Scripting.JavaScriptCore.g.cpp:227 [opt]
    frame #35: 0x00000001001acc3c Crash7`g::Fuse::Scripting::JavaScriptCore::Context__CallbackWrapper__Call_fn(__this=<unavailable>, args=<unavailable>, exception=<unavailable>, __retval=0x000000016e20a6c0) at Fuse.Scripting.JavaScriptCore.g.cpp:204 [opt]
    frame #36: 0x00000001000f5df8 Crash7`uDelegate::Invoke(this=0x00000001702904f0, retval=<unavailable>, args=0x000000016e20a6d0, count=4) at ObjectModel.cpp:1462 [opt]
    frame #37: 0x00000001000f6114 Crash7`uDelegate::Invoke(this=<unavailable>, count=<unavailable>) at ObjectModel.cpp:1553 [opt]
    frame #38: 0x00000001001b01c4 Crash7`g::Fuse::Scripting::JavaScriptCore::JSClassRef::CreateUnoCallback()::$_1::__invoke(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) [inlined] g::Fuse::Scripting::JavaScriptCore::JSClassRef::CreateUnoCallback()::$_1::operator()(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) const at Fuse.Scripting.JavaScriptCore.g.cpp:884 [opt]
    frame #39: 0x00000001001b0190 Crash7`g::Fuse::Scripting::JavaScriptCore::JSClassRef::CreateUnoCallback(ctx=<unavailable>, function=<unavailable>, thisObject=<unavailable>, argumentCount=0, arguments=0x000000016e20a788, exception=0x000000016e20a770)::$_1::__invoke(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) at Fuse.Scripting.JavaScriptCore.g.cpp:869 [opt]
    frame #40: 0x000000018f59a5e0 JavaScriptCore`JSC::JSCallbackObject<JSC::JSDestructibleObject>::call(JSC::ExecState*) + 424
    frame #41: 0x000000018efb180c JavaScriptCore`JSC::LLInt::setUpCall(JSC::ExecState*, JSC::Instruction*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*) + 480
    frame #42: 0x000000018f69861c JavaScriptCore`llint_entry + 24876
    frame #43: 0x000000018f692328 JavaScriptCore`vmEntryToJavaScript + 264
    frame #44: 0x000000018f564a68 JavaScriptCore`JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 168
    frame #45: 0x000000018efb58c4 JavaScriptCore`JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 352
    frame #46: 0x000000018f2289f8 JavaScriptCore`JSC::profiledCall(JSC::ExecState*, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 160
    frame #47: 0x000000018efb5678 JavaScriptCore`JSObjectCallAsFunction + 536
    frame #48: 0x00000001001aed14 Crash7`g::Fuse::Scripting::JavaScriptCore::JSObjectRef::CallAsFunction(__this=<unavailable>, ctx=<unavailable>, thisObject=<unavailable>, arguments=<unavailable>, onException=0x000000017028ae60) at Fuse.Scripting.JavaScriptCore.g.cpp:1217 [opt]
    frame #49: 0x00000001001ae9e4 Crash7`g::Fuse::Scripting::JavaScriptCore::Function__Call_fn(__this=0x0000000170477640, args=<unavailable>, __retval=0x000000016e20adb8) at Fuse.Scripting.JavaScriptCore.g.cpp:751 [opt]
    frame #50: 0x00000001001bb448 Crash7`g::Fuse::Reactive::FunctionMirror__CallClosure::Call() [inlined] g::Fuse::Scripting::Function::Call(this=<unavailable>, args=<unavailable>) at Fuse.Scripting.Function.h:30 [opt]
    frame #51: 0x00000001001bb434 Crash7`g::Fuse::Reactive::FunctionMirror__CallClosure::Call(this=0x0000000170475b80) at Fuse.Reactive.g.cpp:604 [opt]
    frame #52: 0x00000001001cc364 Crash7`g::Fuse::Reactive::ThreadWorker::RunInner(this=0x0000000170112750) at Fuse.Reactive.g.cpp:8040 [opt]
    frame #53: 0x00000001001cc0fc Crash7`g::Fuse::Reactive::ThreadWorker::Run(this=0x0000000170112750) at Fuse.Reactive.g.cpp:7975 [opt]
    frame #54: 0x00000001000fc9b0 Crash7`ThreadStartup(arg=0x000000017046c500) at posix_thread.cpp:44 [opt]
    frame #55: 0x000000018a101850 libsystem_pthread.dylib`_pthread_body + 240
    frame #56: 0x000000018a101760 libsystem_pthread.dylib`_pthread_start + 284
    frame #57: 0x000000018a0fed94 libsystem_pthread.dylib`thread_start + 4
(lldb) 

ObservableTest.InnerDetach fails intermittently

[Fuse.Reactive.JavaScript.Test] Fuse.Reactive.Test.ObservableTest.InnerDetach
[Fuse.Reactive.Test.ObservableTest.InnerDetach] C:\BuildAgent-1\work\452c9bcd4266d21e\Source\Fuse.Reactive.JavaScript\Tests\ObservableTest.uno:1076
[Fuse.Reactive.Test.ObservableTest.InnerDetach] two
[Fuse.Reactive.Test.ObservableTest.InnerDetach]

TransitionTest.Style fails intermittently

This happens often during CI, failing otherwise good tests.

Here's an example of a failure.

FAILED: Fuse.Controls.Navigation.Test.Fuse.Navigation.Test.TransitionTest.Style
Assertion failed in 'Style', at /Users/travis/build/fusetools/fuselibs-> public/Source/Fuse.Controls.Navigation/Tests/Transition.Test.uno:273
Expected: 0.4000000000000000
But got : 0.4166670000000000

ActiveIndex on PageControl does not [fully] work

Reported on community. Affects all previews and Android build at least too. Tested on macOS + Fuse 1.0.3 and Fuse 1.1.0.

The Blue page should be active when launching the app, but the Red one is shown instead:

<App>
    <ClientPanel>
      <PageControl ActiveIndex="1">
          <Panel Color="Red"></Panel>
          <Panel Color="Blue"></Panel>
          <Panel Color="Yellow"></Panel>
      </PageControl>
    </ClientPanel>
</App>

If you change the ActiveIndex value to 2 and save the file, PageControl correctly switches to the Yellow page. If you then hit CMD+R in Studio, it reverts back to showing the Red page.

XMLHttpRequest timeout is ignored

Reported on community.

Test with the following repro:

<App>
    <JavaScript>
    var Observable = require("FuseJS/Observable");
    var latency = Observable(0);
    var url = Observable("http://www.fakeresponse.com/api/?sleep=3");
    var xhr;
    function abort() {
        if(xhr != null) xhr.abort();
    };

    function submit() {
        refTime = new Date().getTime();
        xhr = new XMLHttpRequest();

        xhr.onreadystatechange = function() {
            console.log("readyState: "+xhr.readyState);
            console.log("status: "+ xhr.status);
            console.log("statusText: "+ xhr.statusText);
            console.log("responseType: "+ xhr.responseType);
        }

        xhr.onload = function () {
            debug_log("Loaded!");
            latency.value = (new Date().getTime()) - refTime;
        };

        xhr.onerror = function(err) {
            debug_log("Error!");
            debug_log(JSON.stringify(err));
        };

        xhr.onabort = function () {
            debug_log("Request aborted!");
        };

        xhr.onloadstart = function () {
            debug_log("Request started!");
        };

        xhr.ontimeout = function () {
            debug_log("Timeout!");
            latency.value = (new Date().getTime()) - refTime;
        }

        xhr.open('GET',encodeURI(url.value));
        xhr.timeout = 1500;
        xhr.send();
    }

    module.exports = {
        submit:submit,
        latency:latency,
        url:url,
        abort:abort
    }

    </JavaScript>
    
    <StackPanel Alignment="Center" Width="90%" ContentAlignment="Left" ItemSpacing="20">
        <TextBox Value="{url}" ActionTriggered="{submit}"/>
        <Button Alignment="Left" Text="Send Request" Clicked="{submit}"/>
        <Button Alignment="Left" Text="Abort" Clicked="{abort}"/>
        <Text Value="Latency: {latency} milliseconds"/>
    </StackPanel>
</App>

When clicking "Send Request", it is expected for it to timeout and hit xhr.ontimeout() in 1.5 seconds. It doesn't, and instead completes the request after the 3 secs delay.

ImageTest.RetryReload failure

ImageTest.RetryReload in the Fuse.Controls.Primitives-tests fails consistently for me when I only run that test-project. If I run all tests, it passes just fine...

$ Stuff/uno test -tdotnet Source/Fuse.Controls.Primitives/Tests/
Searching for tests in:
Source/Fuse.Controls.Primitives/Tests/
Starting project 'Fuse.Controls.Primitives.Test', target 'DotNet'
Started test runner on http://localhost:15566/
Configuring (0.4 s)
Compiling syntax tree (1.7 s)
Generating code and data (4.4 s)

Build completed in 6.51 seconds


GL_VERSION: 4.5.0 NVIDIA 382.05
GL_VENDOR: NVIDIA Corporation
GL_RENDERER: GeForce GTX 770/PCIe/SSE2
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.CurveTest.Close (64,457 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.CurveTest.MinPoints (165,120 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.ImageTest.Fail (30,137 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.ImageTest.NullSource (2,771 µs)
FAILED: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.ImageTest.RetryReload
Exception was thrown: System.Exception: Unchecked, queued Diagnostics!
at FuseTest.RecordDiagnosticGuard.Dispose() in C:\Users\erik\src\fuselibs\Source\Fuse.Common\Tests\FuseTest\TestBase.uno:line 65
at Fuse.Controls.Primitives.Test.ImageTest.RetryReload() in C:\Users\erik\src\fuselibs\Source\Fuse.Controls.Primitives\Tests\Image.Test.uno:line 55
at MainClass.Invoke___Fuse_Controls_Primitives_Test_ImageTest_RetryReload()
at Uno.Testing.AbstractRunner.RunTest(NamedTestMethod test) in C:\Users\erik\AppData\Local\Fusetools\Packages\Uno.Testing\1.0.12$.uno:line 92
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.ShadowTest.ColorPanel (64,845 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.ShadowTest.ColorRectangle (8,228 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.ShadowTest.CornerRadius (2,547 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.ShadowTest.Falloff (1,818 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.ShadowTest.InvisiblePanel (1,439 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.ShadowTest.InvisibleRectangle (1,458 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.ShadowTest.Padding (2,108 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.ShadowTest.Underlay (1,473 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.ShapeTest.LoadingImageFill (11,011 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.ShapeTest.LoadingResource (1,546 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.ShapeTest.NullFill (272 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.ShapeTest.NullStoke (578 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.TextControlTest.MaxValueCrashBug (5,531 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.TextControlTest.TextInputBinding (47,998 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.TextTests.FontSizeAffectsHeight (4,399 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.TextTests.LineSpacingAffectsHeight (3,139 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.TextTests.TextTruncationAffectsRenderBounds (26,905 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Controls.Primitives.Test.TextTests.TextWrappingAffectsSize (2,532 µs)
OK: Fuse.Controls.Primitives.Test.Fuse.Gestures.Test.RangeControlTests.Orientation (20,524 µs)
OK: Fuse.Controls.Primitives.Test.FuseTest.SatisfyUnoTest.Test (295 µs)

Built & ran 25 tests in 10.48 seconds (471,131 µs)
Failures: 1

Expand FuseJS/Bundle

Currently FuseJS/Bundle exists mostly to read bundled text files, but this doesn't cover a number of useful scenarios such as extracting bundles to paths, reading buffers and so on. These features should be added:

  • list() Get an array of every bundlefile with full path
  • unpack(bundle_file_path, destination_path) Write the contents of a bundled file to a path, return a promise of the absolute final path
  • readBuffer(bundle_file_path) Read the contents of a bundled file as an ArrayBuffer

Lingering cursor bug is back

When focusing a TextBox and then unfocusing it, its cursor remains visible, although it stops blinking. Likely a bug with caching and the TextBox possibly not invalidating its visual properly when losing focus.

image

Bloated RenderBounds with Harfbuzz

It appears that RenderBounds for text is much larger than needed, resulting in wasted fillrate when caching:

image

Quote @yupferris :
It appears when using harfbuzz our text rendering measures very conservatively. I've tinted the cache rects to show this (to make sure it wasn't my system borking up):

image
image

on Android the rects are much tighter except when using -Duse_harfbuzz, where it looks the same as .net.

StaticAsset class to avoid re-rendering of static bits of UX throughout the app

Background

When profiling apps to improve performance, a recurring theme is the time it takes to render visual elements for the first time. In particular when effects like <DropShadow> and <Mask> is used on tiny elements like icons, allocation of framebuffers and render-to-texture is required for each instance of the icon. If the icon is e.g. repeated for each item in a list, it can add up to hundreds of milliseconds of latency in the middle of transitions.

Of course, the optimal solution here would be to pre-bake the icons with shadows in the image file. However, this is very inconvenient. UX Markup is excellent for describing a "content pipeline" for assets, where final versions can be rendered out after the screen size, density, locale and other runtime properties are available. It would be a shame not to be able to take advantage of that.

Proposal

Proposing a new class StaticAsset, which is a LayoutControl which will be the recommended base class for UX classes that represent small and immutable fixed-size assets, such as icons, buttons.

The content of StaticAsset is implicitly a ux:Template and not instantiated by default. When StaticAsset is used as base class for an ux:Class, only the first instance of the class to be rooted actually instantiates the content and renders the content - to a bitmap, which is then shared globally with other instances of the same class. Subsequent instances of the class simply blit out the bitmap and doesn't actually instantiate or render anything.

Example use

Here is a simple example of an icon with a drop shadow, as a shared bitmap:

<StaticAsset ux:Class="MyApp.FooIcon">
   <Image Source="someMultiDensitySource">
       <DropShadow />
   </Image>
</StaticAsset>

If we now use <MyApp.FooIcon /> for every card in a feed, for example, only one instance will ever be created and rendered.

Implementation details

The content of a StaticAsset can be arbitrary and even contain dynamic data bindings that change over time. However, the contract is that it should be possible to assume that every instance of the shared bitmap has the same visual appearance. Each instance of the StaticAsset can have arbitrary transform and opacity without violating this contract.

In order to be able to create the shared cache, the class needs some unique identifier. The proposal here is to have a ClassId string constructor argument (ux-dependency) on StaticAsset that is used to look up some global cache, plus an UX compiler feature that automatically fills in this dependency witht the class name as a string when StaticAsset is the base class in a ux:Class. This ensures clean syntax in the base class case, and compile-time enforcing the user to enter an ID when its not the base class.

Potential future enhancements

  • Cache the bitmap to file on disk, and reuse across runs of the app. Will only render the first time the app runs.

Feature request: make install location configurable on Android

As requested on community:
https://www.fusetools.com/community/forums/feature_requests/making_apps_movable_to_sd_card_on_android
https://www.fusetools.com/community/forums/howto_discussions/move_the_app_to_external_storage_android

According to the docs, the possibility of an app being moved to external storage is defined by a property on the manifest root tag in AndroidManifest.xml, like so:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    android:installLocation="preferExternal"
    ... >

where the value of that property can be either preferExternal or auto. The auto option seems to be a sane default. It would be nice if this was configurable in the "Android" section in .unoproj files.

There are some concerns about when an app can or can not be moved to external storage, and those are covered in the linked docs page too.

VariousTest.Issue2731 spurious errors

We sometimes get spurious errors, like these:

FAILED: Fuse.Reactive.JavaScript.Test.Fuse.Reactive.Test.VariousTest.Issue2731
Assertion failed in 'Issue2731', at C:\projects\fuselibs-public\Source\Fuse.Reactive.JavaScript\Tests\Various.uno:433
Expected: 0.0000000
But got : 1.0000000

Backpaddle on DataBinding needing a NameTable

DataBinding now requires a NameTable in order to be able to resolve Fuse.Reactive.Name nodes dynamically. This is a quite expensive requirement. Let's rewrite it so names are resolved UX-compile time instead, at the expense of these syntax trees not being reusable. This will generally make it easier to work with expressions in other contexts, too.

Go over UX functions and take advantage of VarArgs where appropriate

For example, index(elm) should be possible to write as just index() when you want to reference the local node. It should also take an extra optional argument; index(element, instantiator) where instantiator can be different from the most local instantiator. For example when you have nested Each's, you might want an inner element to use the index from the outer Each.

Ref discussions like #204

ObservableTest.MapTwoWayFloat3 fails intermittently

This happens often during CI, failing otherwise good tests:

[14:14:48] [Fuse.Reactive.Test.ObservableTest.MapTwoWayFloat3] C:\BuildAgent-1\work\452c9bcd4266d21e\Source\Fuse.Reactive.JavaScript\Tests\Observable.uno:411
[14:14:48] [Fuse.Reactive.Test.ObservableTest.MapTwoWayFloat3] 10,2,30
[14:14:48] [Fuse.Reactive.Test.ObservableTest.MapTwoWayFloat3] 10,2,3

@mortoray: I'm assigning you to this, since you wrote the test. This has been failing randomly for a long time, so I suspect this has always been like this. If you disagree, feel free to reassign to someone more appropriate.

UX expression not updating

<Circle ux:Class="MyCircle" Width="80" Height="80" ux:Name="Self">
	<Translation X="{(width(Self) / 2) * -1}" Y="{(height(Self) / 2) * -1}" />
	<Stroke Width="1">
		<SolidColor Color="#000" />
	</Stroke>
</Circle>

X and Y on Translation is never set

(I know Anchor="50%,50%" is the correct way to achieve what I want)

Missing requirements for running build

Clean win10 machine requires additional packages to be able to build and run tests.

Running the fuse installer (1.0.2) resolves the issue, most likely VCRedist?

PS C:\Users\Marius\fuselibs-public\fuselibs-public-master> Stuff\uno --trace doctor
Uno 1.1.0 (build 5395) Windows 10 x64 706c6d5
Found 69 projects, 69 are out of date
Building 1/69: Android.ActivityUtils
FATAL ERROR: Failed to load 'C:\Users\Marius\fuselibs-public\fuselibs-public-master\Stuff\bin\x64\uAsset.dll'. The speci
fied module could not be found (pass --trace for stack trace)
(0.2 s)

An Image is not shown in a nested trigger inside of a NativeViewHost

Fuse 1.1.0 build 13745, macOS. Android preview affected, build tends to generally be okay, but I've encountered similar issues on build too.

When I have an Image inside of a While* trigger, nested in a NativeViewHost, the image would not display right after launching the app. When I then toggle the data-bound value of enclosing While* triggers, the images appear. Removing the enclosing NativeViewHost makes the issue go away.

<App Background="#000">
    <JavaScript>
        var Observable = require("FuseJS/Observable");
        var isTrue = Observable(false);
        function toggleTrue() {
            isTrue.value = ! isTrue.value;
        }
        module.exports = {
            isTrue: isTrue,
            toggleTrue: toggleTrue
        };
    </JavaScript>
    <NativeViewHost>
        <Panel Width="120" Aspect="1" BoxSizing="FillAspect" Clicked="{toggleTrue}" HitTestMode="LocalBounds" Color="#fff2">
            <WhileTrue Value="{isTrue}">
                <Image File="camera_front.png" />
            </WhileTrue>
            <WhileFalse Value="{isTrue}">
                <Image File="camera_rear.png" />
            </WhileFalse>
        </Panel>
    </NativeViewHost>
</App>

Adding a complete, minimal repro:
NVH-trigger-test.zip

Image not loading in NativeViewHost

<NativeViewHost>
    <Image File="..." />
</NativeViewHost>

When observing in the XCode debugger it looks like the internal ImageContainer in Fuse.Controls.Image does not emit SourceChanged event the first time an Image is rooted

Data-bound MapMarker coordinates snap to screen center instead of the coordinates set when panning

Reported on community. Both Android and iOS affected (both preview and build), tested on macOS + standard Fuse 1.0.1 (build 13566) and Fuse 1.1.0 (build 13793) with a local checkout of fuselibs (on master @ 10.07.2017).

Minimal repro included below. When panning, you will see that one marker stays fixed at the correct coordinates, while the other travels across the map, snapping to the very center of the screen.

<App>
    <JavaScript>
        var Observable = require("FuseJS/Observable");
        var cityName = Observable();
        var cityLong = Observable();
        var cityLat = Observable();
        cityName.value="Colombo";
        cityLong.value="79.86124300000006";
        cityLat.value="6.9270786";
        module.exports = {cityName,cityLong,cityLat};
    </JavaScript>

    <NativeViewHost >
        <MapView Latitude="{cityLat}" Longitude="{cityLong}" Zoom="10">
            <MapMarker Latitude="6.9270786" Longitude="79.86124300000006" Label="{cityName}" />
            <MapMarker Latitude="{cityLat}" Longitude="{cityLong}" Label="{cityName}" />
        </MapView>
    </NativeViewHost>
</App>

Reactive Modules API (proposal)

Posted here for discussion:

Reactive modules

A module related with a <JavaScript> tag supports the Reactive Modules API. This is a set of methods on module that allows the module to change the exported values and notifying the data context about the change. This allows reactive programming between modules.

Each of these APIs accept a path to the node in the exports tree. The path is a sequence of either string keys (to look up into objects) or number indices (to look up into arrays).

module.set(... path, value)

Sets the value at the path to value. Example:

exports.foo = [ {bar: "apples"}, {bar: "oranges"}]

exports.changeSomething = function() {
	// Changes the 'bar' property of the second item in the 'foo' array
	module.set("foo", 1, "bar", "bananas");
}

module.add(... path, item)

Adds item to the end of the array at the path. Example:

exports.user = { name: 'Bob', things: ["lamp", "car"] }

exports.addSomething = function() 
{
	// Adds 'airplane' to the user's list of things
	module.add("user", "things", "airplane");
}

module.removeAt(... path)

Removes the item at the path. The last item in the path must be a numeric index into an array. Example:

exports.user = { name: 'Bob', things: ["lamp", "car"] }

exports.removeSomething = function() 
{
	// Removes 'lamp' from users's list of things
	module.removeAt("user", "things", 0);
}

module.insertAt(... path, value)

Inserts value at the path. The last item in the path must be a numeric index into an array. Example:

exports.user = { name: 'Bob', things: ["lamp", "car"] }

exports.insertSomething = function() 
{
	// Inserts 'dog' in the middle of the user's list of things
	module.insertAt("user", "things", 1, "dog");
}

NavigateToggle does not locate the appropriate Navigation context

Find attached a "minimal" reproduction of the issue.

I am not sure whether this is related to ux:Dependency or it is an issue with the EdgeNavigator and NavigateToggle.

Expected behavior:

  • Both clicking the red square and the center button should toggle the edge menu

Actual behavior:

  • Clicking the red square toggles the edge menu
  • Clicking the center button does nothing

DependencyRepro.zip

ObservableTest.Style fails intermittently

This happens often during CI, failing otherwise good tests.

Here's an example of a failure.

FAILED: Fuse.Controls.Navigation.Test.Fuse.Navigation.Test.TransitionTest.Style
Assertion failed in 'Style', at /Users/travis/build/fusetools/fuselibs-> public/Source/Fuse.Controls.Navigation/Tests/Transition.Test.uno:273
Expected: 0.4000000000000000
But got : 0.4166670000000000

java.lang.NullPointerException in Fuse.Maps

If I modify ManualTestingApp like so:

diff --git a/Tests/ManualTests/ManualTestingApp/MainView.ux b/Tests/ManualTests/ManualTestingApp/MainView.ux
index 4bcaabd..a890db5 100644
--- a/Tests/ManualTests/ManualTestingApp/MainView.ux
+++ b/Tests/ManualTests/ManualTestingApp/MainView.ux
@@ -138,8 +138,10 @@
 			<HitTestPage/>
 			<DefaultFonts/>
 			<Pages.SurfaceMisc/>
+			<MapViewPage/>
 			
 			<Android>
+				<MapViewPage/>
 				<WebViewPage/>
 				<BackButtonView/>
 			</Android>
diff --git a/Tests/ManualTests/ManualTestingApp/ManualTestingApp.unoproj b/Tests/ManualTests/ManualTestingApp/ManualTestingApp.unoproj
index b3f75e8..2fc3740 100644
--- a/Tests/ManualTests/ManualTestingApp/ManualTestingApp.unoproj
+++ b/Tests/ManualTests/ManualTestingApp/ManualTestingApp.unoproj
@@ -1,5 +1,10 @@
 {
   "Version": "0.0.0.0",
+  "Android": {
+     "Geo": {
+          "ApiKey": "**REDACTED**"
+      }
+  },
   "Packages": [
     "Fuse",
     "FuseJS",
diff --git a/Tests/ManualTests/ManualTestingApp/Singles/MapViewPage.ux b/Tests/ManualTests/ManualTestingApp/Singles/MapViewPage.ux
index b05b2cc..9e555a6 100644
--- a/Tests/ManualTests/ManualTestingApp/Singles/MapViewPage.ux
+++ b/Tests/ManualTests/ManualTestingApp/Singles/MapViewPage.ux
@@ -21,8 +21,15 @@
 
 	<NativeViewHost>
 		<DockPanel>
+			<Panel Dock="Bottom">
+				<Slider Margin="40,0" Alignment="VerticalCenter">
+					<ProgressAnimation>
+						<Change map.Zoom="10" />
+					</ProgressAnimation>
+				</Slider>
+			</Panel>
 			<WhileVisible>
-				<MapView Latitude="{lat}" Longitude="{lng}">
+				<MapView ux:Name="map" Latitude="{lat}" Longitude="{lng}">
 					<Each Items="{markers}">
 						<MapMarker Latitude="{latitude}" Longitude="{longitude}" Label="{label}"/>
 					</Each>

I get a java.lang.NullPointerException that takes down the whole app:

06-07 12:08:56.358 15453 15453 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke interface method 'void com.fusetools.maps.FuseMap$FuseMapCallback.onCameraChange(double, double, double, double, double)' on a null object reference
06-07 12:08:56.358 15453 15453 E AndroidRuntime:        at com.fusetools.maps.FuseMap.onCameraChanged(FuseMap.java:335)
06-07 12:08:56.358 15453 15453 E AndroidRuntime:        at com.fusetools.maps.FuseMap.access$100(FuseMap.java:24)
06-07 12:08:56.358 15453 15453 E AndroidRuntime:        at com.fusetools.maps.FuseMap$2.onCameraChange(FuseMap.java:113)
06-07 12:08:56.358 15453 15453 E AndroidRuntime:        at com.google.android.gms.maps.GoogleMap$13.onCameraChange(Unknown Source)
06-07 12:08:56.358 15453 15453 E AndroidRuntime:        at com.google.android.gms.maps.internal.zze$zza.onTransact(Unknown Source)
06-07 12:08:56.358 15453 15453 E AndroidRuntime:        at android.os.Binder.transact(Binder.java:499)
06-07 12:08:56.358 15453 15453 E AndroidRuntime:        at com.google.android.gms.maps.internal.x.a(:com.google.android.gms.DynamiteModulesB:12)
06-07 12:08:56.358 15453 15453 E AndroidRuntime:        at com.google.maps.api.android.lib6.gmm6.api.b.run(:com.google.android.gms.DynamiteModulesB:12)
06-07 12:08:56.358 15453 15453 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:751)
06-07 12:08:56.358 15453 15453 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:95)
06-07 12:08:56.358 15453 15453 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:241)
06-07 12:08:56.358 15453 15453 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:6217)
06-07 12:08:56.358 15453 15453 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
06-07 12:08:56.358 15453 15453 E AndroidRuntime:        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
06-07 12:08:56.358 15453 15453 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

"Missing Push Notification Entitlement" warning from iTunes connect when not using push

I uploaded an app to iTunes connect, and got the following email:

Dear developer,

We have discovered one or more issues with your recent delivery for "". Your delivery was successful, but you may wish to correct the following issues in your next delivery:

Missing Push Notification Entitlement - Your app appears to register with the Apple Push Notification service, but the app signature's entitlements do not include the "aps-environment" entitlement. If your app uses the Apple Push Notification service, make sure your App ID is enabled for Push Notification in the Provisioning Portal, and resubmit after signing your app with a Distribution provisioning profile that includes the "aps-environment" entitlement. Xcode 8 does not automatically copy the aps-environment entitlement from provisioning profiles at build time. This behavior is intentional. To use this entitlement, either enable Push Notifications in the project editor's Capabilities pane, or manually add the entitlement to your entitlements file. For more information, see https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/HandlingRemoteNotifications.html#//apple_ref/doc/uid/TP40008194-CH6-SW1.

After you’ve corrected the issues, you can use Xcode or Application Loader to upload a new binary to iTunes Connect.

Regards,

The App Store team

I have not done anything in my app to register with a push notification service, and I'm not using the Fuse.PushNotifications package. Here's the relevant section of my .unoproj:

  "Packages": [
  	"Fuse",
  	"FuseJS",
  	 "Fuse.Audio",
  	"Fuse.Vibration"
  ],

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.