From 23b6e36df77cec673886dc924a73417885fe4535 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. --- server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server.go') diff --git a/server.go b/server.go index 03c8251..e9e084b 100644 --- a/server.go +++ b/server.go @@ -13,7 +13,8 @@ import ( type Server http.Server -//go:embed view/static/simple.css/simple.css view/static/ceres.js +//go:generate ./view/dart/dart2js.sh +//go:embed view/static/simple.css/simple.css view/static/ceres.js view/dart/ceres.dart.js view/dart/ceres.dart.js.map var static embed.FS func NewServer(addr string, db *model.DB) *Server { -- cgit v1.3.1