A CodeFlow blog

about live coding and more…

CodeFlow 1.0.2


CodeFlow 1.0.2 focuses on improving the Live Application Developer Experience

CodeFlow 1.0.2 is a minor release that focuses on improving the Live Application Developer's Experience.

It includes many small improvements and bug fixes in the following areas: automatic creation of Lua action methods, usability of the Lua editor, performance, project templates and live storyboard updates, Lua runtime robustness and native interface support.

Main Changes

This section list the most significant improvements and bug fixes in CodeFlow 1.0.2. For the complete change list, please see the version history in the CodeFlow readme file.

Automatic creation of Lua action methods

CodeFlow can now automatically create Lua action methods in your project to match IBAction methods defined in the associated Xcode project.

This is especially convenient when using Live Storyboards: you can define the action method associated to an interface component by control-dragging from this component to the corresponding View Controller source file in Xcode, and in CodeFlow, a Lua version of the new action method will magically appear in the corresponding Lua class extension, so you can directly write the action code and test it immediately in the target application.

Here is a short video (also available on Youtube) that illustrates this:

The creation of automatic action methods creation can be configured on a per-Lua-module basis (via a command in the Syntax menu).

Lua editor usability

In CodeFlow 1.0.2, we have improved many small details in the Lua code editor to make it more comfortable to use:

  • Easier type annotations: In CodeFlow you can insert type annotations in your Lua code to improve code-completion proposals for native properties and method names. But manually typing type annotation like --[[@type objc.UIPanGestureReognizer]] can become tedious and error-prone. Now, you can now simply insert a type annotation in your code using the command ⌥⌘T, and auto-completion of class and struct names is working inside type annotations comments. These improvements make type annotations very easy to use where needed in the code.

  • Added brief highlighting of counterpart syntax elements in the Lua editor when you enter code or move the selection. Highlighted elements include the usual set of brackets ( ) { } [ ], and also syntax block delimiters like do, if, while, repeat, function, else, elseif, end, until. Syntax counterpart highlighting can be disabled in the application preferences if you don't like it.

  • Much better behavior of Lua syntax auto-completion in the editor (e.g. the automatic insertion of missing strings terminators or of missing closing brackets): previously, syntax auto-completion could get really annoying sometimes by making deletion of the inserted characters or undo quite difficult; this is now fixed and syntax auto-completion should now be a transparent help when entering code. In addition, more syntax auto-completion patterns have been added, and you can now disable syntax auto-completion in the preference window if you don't want it.

  • Special characters and emojis are now correctly displayed inside Lua source code (special characters are valid inside Lua strings and comments).

Performance improvements

The two main performance optimizations in CodeFlow 1.0.2 are related to very different areas of the system: the first one is purely internal to the CodeFlow IDE, while the second one significantly decreases the debug overhead in target applications:

  • Highly improved display performance of Lua source code files in the editor. This better performance is especially noticeable when scrolling in big Lua source files.

  • Reduced the frequency of global variables refresh in the Variable Inspector while the target application is running. In previous versions, global variables refresh in debug mode could have a significant impact on CPU and network bandwidth in target applications with intensive code-driven animations, like 3D games. Now, the Variables Inspector is refreshed at most once per second when the target application is running.

Project templates and live storyboards

Storyboard-based project templates also have significant improvements in this version:

  • iOS project templates now have support for live update of presented View Controllers, like modal sheets or popovers.

  • During a live storyboard update, the saved state of a replaced View Controller is now applied in the replacing View Controller's viewDidLoad method. This makes the state propagation code in your project much simpler, because the controller's views hierarchy is guaranteed to be available when the state propagation code is executed.

  • During a live storyboard update, Root View Controllers (iOS, tvOS) and Window's Content View Controllers (macOS) are now correctly updated, even if their view is not created yet.

  • Live storyboard updates are now coordinated with project bindings update in case an action method has been added to the updated storyboard. This guaranties that the added action can not be triggered before being defined. This comes in addition to the existing coordination in case of added IBOutlet.
    You can see this coordination mechanism in action in the above video, around 01'12": the storyboard version containing the updateLabelSize UISlider action method (MainStoryboard-12:55:35) is loaded to the target application right after the version of the ViewController Lua module implementing this action method (ViewController-12:55:34), so that interacting with the slider can not cause a method-non-existing runtime error.
    Storyboard updates referencing new actions are now coordinated with code updates.

Lua CodeFlow runtime

In addition to a bunch of minor bug fixes and performance improvement in the Lua CodeFlow runtime library embedded in the target applications, CodeFlow 1.0.2 include a few noticeable improvements in this area:

  • It solves an issue causing a target application using SceneKit on iOS 10 to freeze when a texture resource was dynamically updated. More generally, classes or frameworks that use a shared lock to protect their internal structure (like SceneKit) can now be declared as such to the CodeFlow runtime, which removes the possibility of entering a deadlock when a method of these classes is called.

  • You can now specify custom bindings generation options for project bindings libraries: bindings generation options help the bindings generation process to build the Lua version of C / Objective-C APIs. They do this by providing indications that remove ambiguities in C function parameter types, especially when parameters are typed as pointers, and they can dramatically reduce the number of function or methods of the target native API not available to the Lua code in your project. Custom bindings generation options shall be defined in a file named 'CIMLuaBindingsOptions.plist' located in the same directory as the associated Xcode project.

Bug fixes

CodeFlow 1.0.2 fixes a crash that could occur if a Lua module in the project contained emojis (or other characters of Unicode supplementary planes).

Post a Comment


Recent posts

Blog Post
Aug 1, 2016

CodeFlow 1.0.2

CodeFlow 1.0.2 is a minor release that focuses on improving the Live Application Developer's Experience.

Aug 1, 2016
Blog Post
Jun 16, 2016

CodeFlow 1.0.1 and WWDC 2016

The just-released CodeFlow 1.0.1 brings support for the new iOS 10, tvOS 10 and macOS 10.12 announced at WWDC 2016 this week.

Jun 16, 2016
Blog Post
Jun 9, 2016

CodeFlow turns 1.0

It has been some time since the last beta of CodeFlow, version 0.9.20 was released in January this year. And all this time, we have worked very hard to improve CodeFlow, and to turn it into an effective Application Development System that we love to…

Jun 9, 2016

Last tweets

Dec 5, 2016
@JLJumpertz
"Programming iOS in Lua - A bridge story"
Slides of my talk at Lua Workshop 2016 are here: slideshare.net/jljumpertz/pro…
#lualang #iosdev
Dec 5, 2016
Oct 11, 2016
Little Lua red Panda is now on GitHub! github.com/celedev/LuaPan…
A SceneKit 3D game in #LuaLang with dynamic update of all 3D assets and code
Oct 11, 2016
Oct 3, 2016
CodeFlow 1.0.3 is out!
⚡️ Live SceneKit assets, Sierra support, and more…
celedev.com/en/download/#c…
#lualang #iosdev
Oct 3, 2016
Oct 1, 2016
@aligatr
@Javi @nicklockwood same and also sad they didn't mention Redux realm.io/news/benji-enc… nor @celedev for Live Reloading & Faster iterations
Oct 1, 2016
Sep 22, 2016
If you want to test in #LuaLang the (few) new APIs added in iOS 10.1, CodeFlow SDK Bindings for Xcode 8.1 are there
celedev.com/en/download/#s…
Sep 22, 2016
Sep 20, 2016
Live update of SceneKit assets will be available very soon in a new CodeFlow version (1.0.3). Stay tuned! 😊
Sep 20, 2016
Sep 20, 2016
@JLJumpertz
🎉 Live feedback of SceneKit assets in a running app with @celedev!
1. texture
2. scene editing
3. animation
Sep 20, 2016
Sep 8, 2016
Ready for shipping your app for iOS 10, tvOS 10 or macOS 10.12?
Our #LuaLang live-code SDK Bindings are ready too 😎
celedev.com/en/download/#s…
Sep 8, 2016
Sep 6, 2016
@JLJumpertz
Next step, add live SceneKit resources: when using Xcode's SceneKit editor, send the updated assets dynamically to the live application.
Sep 6, 2016
Sep 6, 2016
@JLJumpertz
Amazing how easier SceneKit becomes when using live application update, thks to instant feedback of 3D math! 😃
Sep 6, 2016
Aug 4, 2016
Minor update for CodeFlow 1.0.2 today, fixing a rare issue in dynamic resource updates.
Check for updates or celedev.com/en/download/#c…
Aug 4, 2016
Aug 3, 2016
If you use Xcode 8 beta 4 and CodeFlow, Lua Bindings for the latest iOS 10, tvOS 10 and macOS 10.12 SDKs are here:
celedev.com/en/download/#s…
Aug 3, 2016
Aug 1, 2016
CodeFlow 1.0.2 🚀: learn about automatic Lua action methods and other changes in this new blog post: celedev.com/en/blog/2016/c…
#lualang #iosdev
Aug 1, 2016
Aug 1, 2016
In CodeFlow 1.0.2, automatic creation of Lua action methods leverage the power of Live Storyboards.
New video: youtu.be/koUkihgmyU8
Aug 1, 2016
Jul 29, 2016
For details about improvements and fixes in CodeFlow 1.0.2, release notes are here: celedev.com/en/download/co…
Jul 29, 2016