flutter_fjs 0.1.3
flutter_fjs: ^0.1.3 copied to clipboard
JS/TS runtime for Flutter. Embeds QuickJS-ng with direct JSI-style JS<->C++ calls, runs source or bytecode bundles, and renders HTML-like JS tags as Flutter widgets.
0.1.3 #
<canvas>: a Canvas 2D host. JS sends a display list of drawing commands and Dart replays it into aCustomPainter— paths, fills and strokes, gradients and patterns, text, images, clipping, transforms, and per-frame state. The op protocol is at version 4; an older host simply never receives the newer commands.- A partial
clearRectis now correct: a chunk flaggedNEEDS_LAYERis replayed into its ownsaveLayer, instead of erasing whatever sits under the canvas into a black band. A full-canvasclearRectremains the signal that discards the retained display list; going 240 frames without one warns once. arcTois a corner fillet between two segments, which Flutter's SVG-stylearcToPointcannot express — a rounded rectangle came out as a barrel. The tangent points are computed in JS now, so the host only ever receiveslineTo+arc.PathCmd.arcTokeeps its slot (the numbering is fixed incanvas_ops.dart, andfjs devcan attach any older bundle to any client): it warns once and draws the corner as a polyline.height: 100%resolves inside a column whose height is known. Flutter'sFlexhands children unbounded main-axis constraints by design, so a percentage resolved againstinfinityand degraded toauto— and a child that degraded while containing its own flex (a<canvas>surface, a nested column) hit "RenderFlex children have non-zero flex but incoming height constraints are unbounded".buildFlexnow passes its own content box down to children that declare a main-axis percentage; children without one keep the unbounded constraints, and an unbounded box (inside a scroller) still degrades toauto.- Percentages resolve for absolutely positioned children too.
RenderStackhandsBoxConstraints()unless an opposite edge or an explicit size is set, soposition: absolutewithwidth/height: 100%collapsed a full-screen overlay to one line of text; sizes are now resolved in place against the space the positioned box was given. ExpandedbecameFlexible(fit: bounded ? tight : loose). A tight fit is only legal when there is free space to hand out, so it asserted inside a shrink-wrapping column; CSS has no such failure —flex-growwith no free space simply does nothing.- Style lengths accept
%andcalc()onwidth/height/min-*/max-*. The expression reduces to a px term plus a percentage term and is resolved in aLayoutBuilder; an unbounded axis degrades toauto, as in CSS. Percentages on other properties are still unsupported. - Local images:
<image src>resolves project assets, from thefjs devserver in development and from the bundled asset in release. MirrorNodeis exported frompackage:flutter_fjs/flutter_fjs.dart. Writing aComponentBuilder— the Flutter widget behind a JS tag — means reading the node it is handed, so the type is now part of the public surface. This is what an fjs module's widget extension is built on.FjsEngine.devUri/devFetch(path)expose the connectedfjs devserver, andfetch(url)/fetchString(url)make one-off requests over the same HttpClient that backs JSfetch(). A module that ships a build-time file (an icon set, a language pack) can now read it from the dev server in dev and from its asset in release without anFJS_DEVdart-define or an HttpClient of its own. One engine now means oneHttpClient: the dev-server connection shares it too, instead of opening a second one to the same host.
0.1.1 #
- Android natives are now 16 KB page aligned, as required by Android 15+ devices
with 16 KB memory pages.
tool/build-android.shrefuses NDKs older than r28, which is where that alignment became the default.
0.1.0 #
- First release.
- QuickJS-ng embedded via Dart FFI, JSI-style direct JS↔C++ calls.
- Source bundles and precompiled QuickJS bytecode bundles.
- HTML-like JS tags rendered as Flutter widgets; Vue 3 custom renderer support
through the
@ufjs/runtimenpm package. - Ships prebuilt natives:
libfjs.soforarmeabi-v7a,arm64-v8a,x86_64, andfjs.xcframeworkfor iOS device, iOS simulator, and macOS — no NDK, CMake, or native compile step in consumer builds.