Fuse (beta) release 0.5.3127

Fuse beta release 0.5.3127

This release brings sweeping changes to the Fuse workflow. Please view the updated tutorials and guides for details. https://www.fusetools.com/developers/guides/tutorial

Fuse tools

Features

  • Replaced the Fuse tool application with a service & system tray application.
  • Added fuse command line tools.
  • Added dedicated Fuse preview window application.
  • Added on-device preview with hot code reload.
  • Added new JSON-based project format that allows rule-based inclusion of project source.
  • Added devices.json file to project template.

Fuse libraries

New Features

  • Fuse.Reactive package which eables reactive programming and data-binding in UX markup
  • <JavaScript> class based on Fuse.Reactive, allowing application logic to be done in JavaScript in a separate thread.
  • Many minor / completeness fixes
  • Added Fuse.Native.Camera package.
  • Added Fuse.Native.WebView package.
  • Added Fuse.Native.Vibrator package.
  • Added Fuse.Native package, which includes iOS.StatusBarConfig class

Changes

  • Many name class and property name changes to make naming more contistent. See changeblog for details
  • Introducing ImageFill, which replaces the old TextureFill. ImageFill has more features, similar to Image.
  • The Mask effect now accept an ImageFill instead of a texture.
  • Change in how Style works (see changeblog for details)
  • Alignment/stretching modes for ImageFill changed (might cause visual differences)
  • Image.FilePreload removed, introduced MemoryPolicy instead. See docs for details
  • ScrollViewer.UserScroll added which enables/disables user pointer control. This allows a ScrollViewer with only programmatic control. This is a shortcut to adding the SuppressUserScroll flag to Behaviors.
  • WhileBool (WhileTrue/WhileFalse) now search their ancestors for a value node on rooting. If avilable they use that as the value instead of an explicit Value. Set Value to true or false explicitly to force a local value.
  • The While is gone, use WhileTrue instead. Use the Value property instead of On to set it on/off.
  • Accordion1D has been removed as it is not used (replaced by other physics simulations)
  • Node.GetResource replaced with Node.TryGetResource which returns a bool and takes an out object as the last parameter. This change is necessary since resources can legitmately be set to a null value.

Bugfixes

  • Several changes were made to the internals of how sizing/positioning are handing in layout. This fixes some high-level defects with redrawing and layout. Other than those defects no other layout change is intended.
  • Pointer gestures, like Tapped, Clicked, WhilePressed, etc. will only operate on the first pointer within an element (the first finger/button that clicks). Additional actions by other fingers/buttons will not trigger the gesture. This is a future-proofing step to ensure more complex gestures can be supported later, and also because this is typically what is intended.
  • WhilePressed now deactivates when then pointer does not hit the underlying element, previously it would be activate so long as the mouse remeains pressed.
  • CubicOut had an error that returned a constant value, this has been fixed
  • Trigger.Start and Trigger.Stop are no longer virtual (was not intended, could not work)

Uno

Features

  • Added a more compact JSON project format (old XML will still be loaded without problems).
  • Includes and Excludes properties in projects now support glob patterns (see Glob notes)
  • New define: MOBILE (replaces ANDROID || IOS).
  • New define: DOTNET (replaces CIL || CSHARP).
  • uno update: Support updating multiple projects recursively. Project items are no longer updated automatically, unless —glob=<pattern> (-g) is specified. Updated options. (See uno update —help.)
  • uno ls: New command that lists resolved project items, for debugging purposes. (See uno ls —help.)
  • Compact logging. Compiler will produce a lot less output by default. Use uno build -v to enable verbose output.
  • Conditional compilation. Platform-specific code that won’t be needed is completely culled, which improves performance. This introduces new syntax that replaces [ExportCondition] (see: Porting Notes).
  • Multithreaded parser. Parsing is now performed on several threads in parallel to improve performance.
  • CIL backend: UXL <Require AssemblyReference="System.Core" /> now supports linking assemblies from the Global Assembly Cache (GAC) in addition to plain DLL filenames.
    • Added string Uno.Exception.StackTrace property. This is implemented in .NET and C++ targets, and will give you a string similar to System.Exception.StackTrace in .NET.
    • Uno.Exception.ToString() in C++ will now include the exception type name and stack trace in the returned string (similar to .NET behaviour).

Changes

  • Fixed compiler warnings in core packages.
  • uno build: Removed undocumented options —debug and —no-debug. Added shortcut options. (See uno build —help.)
  • uno create: Updated options. (See uno create —help.)

Uno libraries

Features

  • Added Experimental.Threading package with support for Promises/Futures.
  • Added Uno.Net.Sockets package.
  • Improved Experimental.TextureLoader.

So this new JS feature… Would it produce a hybrid app? Or would there still be some compiling to create a native app?

Hi Elliot!

JavaScript is just a layer on top, meant for pure business logic. It runs on a separate thread and is not allowed to touch UI directly. Uno is still there doing all the heavy lifting, in pure native code. It has nothing to do with HTML5. So whether it’s “hybrid” depends on what yuo mean by that. We certainly don’t use that term :slight_smile:

I install this version in my mac but does not open… It closes automatically.

This is my Mac Version:

file

Don’t you get a tray icon? The workflow is quite different from the previous version. Have you seen this https://www.fusetools.com/developers/guides/tutorial

What flavor of JS? ES6?

So you are basically saying a developer can choose their level of abstraction. Right? Everything starts with Uno in the background with UX for layout and JS for things like: User clicks this button and the application is now in this state.

Uno > UX > JS

Is this development process backwards compatiable?

For example Dev A only wants Uno code to deal with but Dev B already started the project using JS… Can dev A transpile the application back to pure Uno? This way they can continue ahead

JS > UX > Uno

OR

Is this more akin to something like Adobe AIR. Where you have a native runtime and the JS content runs on top of this thing?

Yes, I had not noticed. But how to open an existing project ?

I only have this Options:

file

Elliot:

Currently it’s ES5.1, but we intend to support ES6 later.

You can look at it this way: A fuse project consists of an arbitrary number of Uno, UX and JS files. You can choose to do your app in pure Uno if you want. Or any combination.

The JS layer is optional to use, you can think of it as top-level scripting on top of a native app/game engine :slight_smile:

Capachego:

You don’t “open” projects as such anymore, you just edit your Uno / UX / JS files in your favorite editor.

We reccommend sublime. Just type

fuse install sublime-plugin

… to get the latest sublime plugin. Then you can right click files in sublime and say Preview -> Local, iOS or Android.

You can also build and preview your projects from command line:

fuse preview

See the updated tutorial for more info.

Capachego:

We are still iterating on this workflow and making it completely intuitive, and this feedback is very important for us. A big goal has been to facilitate better plugins and editor integrations, with the tray menu/Fuse application as a supporting player rather than a core place for interactions.

How we’ve imagined it is with Fuse observing changes or interactions made to projects, and treating the project that was last “touched” as the current one. Creating a project using the fuse create commandline command or using the tray menu will touch a project and allow you more from that point on.

The idea of “opening” a project is somewhat foreign since Fuse does not “open” a project ever, but rather just tracks the one you last did anything to. We’ve some immediate ideas on how to improve this user experience, but for now, try right clicking ux files and previewing from the OSX context menu or within Sublime to “touch” them, and thus set them as current project and add them to the project history. Most commandline commands will touch projects.

The updated tutorials and guides should hopefully make some of this clearer in the short term.

Thank you for your patience :slight_smile:

Thanks! Now I read all the new documentation and I understand the new mecanics.

But I need some help…

I get some errors using:

  • using Uno.Net.Http;

  • using Uno.Data.Json;

  • HeightUnit

  • WidhtUnit

  • AnchorUnit

  • ManualTrigger

  • WhileEdgeSwiped

You should check out the changelogs and changeblogs.

Here are some hints though:

  • <Panel Width="30" WidthUnit="Percent"> --> <Panel Width="30%">
  • ManualTrigger --> WhileTrue
  • WhileEdgeSwiped --> EdgeSwipeAnimation

Thanks for the patience! I only have these errors that I can not solve!

/Users/cristiankarmy/Fuse/findit 4.0/findit/Friend.ux.uno(6,7): E3111: Uno.Net does not contain type or namespace 'Http'. Could you be missing a package reference?

/Users/cristiankarmy/Fuse/findit 4.0/findit/Friend.ux.uno(7,7): E3111: Uno does not contain type or namespace 'Data'. Could you be missing a 

/Users/cristiankarmy/Fuse/findit 4.0/findit/Friend.ux.uno(84,19): E3114: There is no identifier named 'HttpMessageHandlerRequest' accessible in this scope. 

I use a Mask like this:

<Mask>
    <texture2D ux:Binding="Texture" ux:Path="Assets/images/MascaraAvatar.png" />
</Mask>    

But I get this error:

/Users/cristiankarmy/Fuse/findit 4.0/findit/Movie.ux(7): E8001: 'Fuse.Effects.Mask does not expose a bindable property called 'Texture'

In this version how I add a reference to a package like:

using Uno.Data.Json;
using Uno.Net.Http;

Thanks!!!

Cpacheco:

For your first error, remove references to Experimental.Net.Http and Experimental.Data add references to Uno.Net.Http and Uno.Data.Xml + Uno.Data.Json.

You add references by editing your .unoproj file.

For Mask, do this:

<Mask File="Assets/images/MascaraAvatar.png" />

This latest update removed a feature I was using for my app:

TextInput -> TextChangedArgs.OldText

Does it have a new term? I could not find it in the changeblog or the changelogg.
The closest I could get was

ValueChangedArgs<string>.Value

but that would require me to keep a library of the old values of all textboxes that uses this function.

Anders Jacob:

Unfortunately, that feature is gone. However, it is relatively easy to reconstruct:

public class TextChangedArgs: EventArgs
{
    public readonly string OldText;
    public readonly string NewValue;

    public TextChangedArgs(string oldText, string newText)
    {
        OldText = oldText;
        NewText = newText;
    }
}

public delegate void TextChangedHandler(object sender, TextChangedArgs args);

public class MyTextInput: TextInput
{
    string _oldValue;

    public MyTextInput()
    {
        _oldValue = Value;
        ValueChanged += OnValueChanged;
    }

    void OnValueChanged(object sender, ValueChangedArgs<string> args)
    {
        if (TextChanged != null)
        {
            TextChanged(this, new TextChangedArgs(_oldValue, args.Value));
        }
        _oldValue = args.Value;
    }

    public event TextChangedHandler TextChanged;
}

And then in your UX, use this instead of TextInput:

<MyTextInput TextChanged="handler" />

Is the Image FilePreload feature removed?

<Image FilePreload="true" />

Also, may I get some hint on the new name of BundleFileImageSource?

Vicker:

Image.FilePreload removed, use a MemoryPolicy instead. The default policy preload bundle files. So you can just remove the attribtue, and it should work the same way.

BundleFileImageSource -> FileImageSource

I use ManualTriggers like this:

<ManualTrigger ux:Name="MyTrigger">
    ....
</ManualTrigger>

And in UNO I trigger like this:

MyTrigger.On = true;

Now how Active WhileTrue?

I try:

MyTrigger.Value = true;

But dont work…

Or maybe this is not working:

public MyApp()
  {
    InitializeUX();
      Timer.Wait(5.0, ActivateTrigger);
  }

  void ActivateTrigger(){
      MyTrigger.Value = true;
  }