Website • API Docs • Features Tutorial • Playground • Discord
Neon is a library for creating cross-platform user interfaces that run everywhere on native runtime!
Neon unique characteristics:
- Bare metal/native, no intermediate/embedded runtime - which allow Neon easily target devices like:
IoT
,smartWatch
where embedded runtime e.g Javascript is too expensive to afford. - Instead of using
Virtual DOM
or Runtime Diffing, Neon generate/optimize its templates at Compile Time (like Svelte) and updates them with fine-grained reactions (like SolidJS) for the best performance. - Neon use Haxe language/syntax - part of ECMAScript family, Javascript developer would find it extremely familiar, like home.
package myApp;
import js.Browser.document;
import neon.platform.browser.Renderer;
import neon.core.Common;
import neon.core.Style;
import neon.core.State;
class Main {
public static function main() {
render(document.body, App, {name: "My App"});
}
}
typedef AppProps = {
var name:String;
};
var App = createComponent(function(props:AppProps) {
var count = createSignal(0);
var doubleCount = function() {
return count.get() * 2;
}
var handleClick = function() {
count.set(count.get() + 1);
}
return createElement("div", {style: styles.container}, [
createElement("h1", {}, [
"welcome ", props.name,
]),
createElement("h2", {click: handleClick}, [
"counter is: ", count.get(),
]),
createElement("h2", {}, [
"doubleCount is: ", doubleCount(),
]),
]);
});
var styles = createStyle({
container: {
color: "red",
userSelect: "none",
"@media (max-width: 768px)": {
color: "green",
}
},
});
- Browser
- Server side rendering, including
Node.js
(good for portable runtime like AWS Lambda Edge), and also includeC++
target (offer blazing fast performance) - macOS (POC implementation)
- Windows (POC implementation)
- Linux (POC implementation)
- iOS
- Android
- Other targets like VR/AR, smartWatch, smartTv, IoT devices..