0.3.0
Third beta. The same application now runs on Cloud Functions for Firebase as well as on the Dart VM and Cloudflare workerd, and aim_cli scaffolds, runs and deploys such a project end to end. One breaking change, to serial columns; see below.
Highlights
aim_functions(new): run an app as a Cloud Functions for FirebaseonRequestHTTP function.app.serveFunction()returns a plain shelf handler, so the package's only runtime dependencies areaim_coreandshelf—firebase_functionsis something your own entry point needs, not the adapter. Requiresfirebase_functions0.8.0 or later: on 0.6.x the function name is not stripped before dispatch, which leaves an app whose routes are written as/unreachable locally. Verified against the Firebase emulator and against a deployed function. OnlyonRequestis supported;onCallis Firebase's own RPC convention and does not fit an HTTP-in, HTTP-out adapter.aim_cli:aim: target: functionsinpubspec.yaml.aim create --target functionsscaffolds a Cloud Functions project and asks for the Firebase project id — flat, withfirebase.jsonnext topubspec.yaml, so the CLI and the Firebase CLI agree on where the project root is.aim devstartsfirebase emulators:start --only functionsand adds no watcher of its own, because the emulator rebuilds Dart functions itself.aim builddoes nothing for this target:firebase deploycompiles on your machine and uploads the artifact.- Dart support in Firebase is experimental, and a deploy needs the Cloud Run Admin API enabled — a Dart function is deployed as a Cloud Run service, and
firebase deploydoes not switch that API on for you.
Breaking changes
aim_orm_postgres:SerialColumnisColumn<int, SerialColumn>where it wasColumn<String, SerialColumn>.SERIALstores a 4-byte integer, the code generator already maps it toint, and the class's own documentation said so — only the type parameter disagreed, which made every comparison on a serial key take a string. Three things follow for anyone who had written code against the old type: comparisons such asusers.id.eq('1')becomeusers.id.eq(1); a foreign key pointing at a serial column has to have the same value type, sovarchar('user_id').references(() => users.id)becomesinteger('user_id').references(() => users.id); anddefaultValue, along withcopyWith'sdefaultValueparameter, isint?where it wasString?.aim_orm_postgres: asking a serial column for a default now throwsUnsupportedErrorinstead of being ignored.SERIALalready meansinteger NOT NULL DEFAULT nextval(...), and PostgreSQL answers a second default with "multiple default values specified for column".aim db:generaterefuses the same thing when it reads the schema, because it reads the source rather than running it.
Packages in this release
aim_functions 0.3.0 (new), and aim_core, aim_server, aim_edge, aim_cli, aim_server_cors, aim_server_cookie, aim_server_form, aim_server_multipart, aim_server_static, aim_server_logger, aim_server_sse, aim_server_jwt, aim_server_basic_auth, aim_server_testing, aim_database, aim_postgres, aim_orm, aim_orm_postgres, aim_orm_codegen — all 0.3.0.
aim_sqlite is in the repository but held back from this release.