From 40b3272f5660517a4c97f97afcc9c3ed787465a4 Mon Sep 17 00:00:00 2001 From: xengineering Date: Tue, 11 Aug 2026 11:14:54 +0200 Subject: Introduce Dart infrastructure for frontend The Dart programming language is excellent for frontend use. It is suitable to write command line programs, web interfaces with the builtin JavaScript transpiler and cross-platform applications with Flutter. To focus on a small number of languages Dart should now be used for frontend purposes as Go is used for backend purposes. Thus it is a valid option to start the migration for Ceres from Go + JavaScript to Go + Dart. This commit sets up the infrastructure. A `view/dart/ceres.dart` file is added together with tooling to transpile to JavaScript, embed it into the Go executable and serve it. Furthermore the script which just prints a message to the console is added to every page. Further commits can move existing code to Dart or add new code in Dart. --- view/dart/dart2js.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 view/dart/dart2js.sh (limited to 'view/dart/dart2js.sh') diff --git a/view/dart/dart2js.sh b/view/dart/dart2js.sh new file mode 100755 index 0000000..8d53fda --- /dev/null +++ b/view/dart/dart2js.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -euf + +SCRIPT="$0" +DART="$(dirname "$SCRIPT")" +CERES_DART="${DART}/ceres.dart" +CERES_DART_JS="${CERES_DART}.js" + +set -x +dart compile js -O2 --output "$CERES_DART_JS" "$CERES_DART" -- cgit v1.3.1