daravel 1.13.0
daravel: ^1.13.0 copied to clipboard
A Laravel-inspired, AOT-native backend framework for Dart with routing, validation, an ORM, auth, queues and Laravel-compatible wire formats.
Changelog #
1.13.0 #
- Added load shedding per worker:
HTTP_MAX_IN_FLIGHT(ServeOptions.maxInFlight) andHTTP_MAX_QUEUE_DELAY(ServeOptions.maxQueueDelay) refuse a request before routing with503,Retry-After: 1and{"message":"Service Unavailable"}; the health probes are never refused;ServerEngine.inFlight,queueDelay,shedRequestsandhttp_requests_shed_total. - Added
coordinator_messages_total,coordinator_rejected_totalandcoordinator_in_flighton/metrics, andmessages,uptime_sandmessages_per_secondinCoordinator.stats(). - Added
DatabaseConfig.sharesSqliteFile(isolates);servewith several isolates on a SQLite file logs one warning. - Changed:
http_requests_in_flightandhttp_requests_shed_totalcarry aworkerlabel (one series per worker isolate). - Fixed presence channels across broadcasting servers: no
member_addedfor a membersubscription_succeededalready listed, and no member event before it.
1.12.0 #
-
Added
Cache.tags([...])(TaggableCacheStore,TaggedCacheStore,TagSetCacheStore) on thememoryandprocessstores;fileanddatabaserefuse, as in Laravel. -
Added
Limit.slidingWindow()andLimit.gcra()(RateLimitAlgorithm,AlgorithmRateLimitStore,RateCounterStore), counted by stores that support them and as a fixed window elsewhere. -
Added eager loading specific columns:
with_('user:id,name'), nested and as a map key; the keys a relation matches on, those the next nested level reads and a rootselect's foreign keys are added (Relation.matchColumns,parentColumns). -
Added
QueryExceptionandUniqueConstraintViolationException(QueryErrors,QueryExceptionExecutor), whose message keeps the?placeholders, andcreateOrFirst. -
Fixed:
firstOrCreateandupdateOrCreatecalled at once for the same row no longer fail with the database's unique error. -
Added
ApplicationBuilder.withCacheStore,withQueueDriver,withBroadcastScalingandwithShutdown, theBroadcastRelaycontract andREVERB_SCALING_DRIVER, for driver packages such asdaravel_redis. -
Added
Blueprint.primary([...])(composite primary keys). -
Changed:
withAuth,withPoliciesandwithMiddlewareapply every call, in order, instead of keeping the last. -
Fixed:
withConfigregisters a section under its own type, soConfig.section<T>()finds it. -
Changed:
withHealthCheckskeeps the default checks setting unlessdefaults:is given.
1.11.0 #
- Added cache channels (
cache-,private-cache-,presence-cache-) and end-to-end encryptedprivate-encrypted-channels (REVERB_ENCRYPTION_MASTER_KEY_BASE64,Echo.encryptedPrivate). - Added
compress:toRouter.wsandResponse.webSocket; the Pusher endpoint runs without permessage-deflate. - Changed: a WebSocket connection no longer keeps its HTTP request alive (
Request.detachBody). - Added several broadcasting servers through the database (
REVERB_SCALING_ENABLED,CreateBroadcastingTables,DatabaseChannelState,DatabaseBroadcastRelay). - Added
WakeableQueueDriver: idle workers wake on a push (PostgreSQLNOTIFY, the memory queue) and onstop(). - Added
DatabaseManager.notifications/notifyandNotifyingDriver(PostgreSQLLISTEN/NOTIFY). - Changed:
CACHE_LIMITER=databasecounts an attempt with one upsert (WindowCounterStore).
1.10.1 #
- Fixed:
queue:restart/queue:pausereachqueue:workprocesses with the database queue (QUEUE_SIGNAL_STORE, thefilestore by default). - Fixed:
auth.jwtguards get a denylist shared by every isolate (CacheJwtDenylist), and revoked tokens stay refused through the leeway. - Fixed: with the database queue, unique-job locks default to the
databasecache store, soqueue:workprocesses release them.
1.10.0 #
- Added broadcasting with Laravel Echo: the Pusher protocol as Laravel Reverb (
withBroadcasting,ChannelRegistry,/broadcasting/auth, the HTTP API),ShouldBroadcast,Broadcast.event/send, andBROADCAST_CONNECTION(daravel,reverb,pusher,log,null). - Changed: the
broadcastnotification channel sends Laravel'sBroadcastNotificationCreatedonprivate-App.Models.User.{id}throughBROADCAST_CONNECTION. - Changed: bcrypt runs in libxcrypt on Linux (about 1.5 times as fast) and in a faster Dart implementation elsewhere;
package:bcryptis no longer a dependency. Passwords longer than 72 bytes are cut at 72 bytes, as PHP does.
1.9.0 #
- Added mail (
Mailable,Mail, SMTP,logandarraytransports,MailFake), with queued delivery and markdown mail in Laravel 12's default theme (MailContent(markdown:),mailButton,mailPanel,withMailTheme). - Added notifications:
Notification,Notifications, themail,databaseandbroadcastchannels,CreateNotificationsTable,ShouldQueuenotifications andNotificationFake. - Added
Broadcast/Broadcaster: publish to a channel and every worker isolate delivers to its listeners, through the coordinator;Broadcast.pipefor WebSockets. - Added
DB_URL(ConnectionConfig.withUrl), merged as Laravel 12'sConfigurationUrlParserdoes. - Fixed: PostgreSQL rejected
double.infinity,-infinityandNaNbindings.
1.8.1 #
- Version aligned with Daravel 1.8.1; no changes.
1.8.0 #
- Added
ConnectionConfig.fromUrl,ApplicationBuilder.withDatabaseConnection,DatabaseManager.forConnection,SqliteDriver.fromConfigandPostgresDriver.fromConfig. - Fixed: transactions are per connection. A query on another connection inside
DB.transactionran in the default connection's transaction (on the wrong database), and a transaction on another connection became a savepoint of it.
1.7.0 #
- Added
RouteEntry.isWebSocket(set byrouter.ws); WebSocket routes are left out of the OpenAPI document. - Fixed: the daily log handler could keep one file more than
days(today's file, opened asynchronously, was only counted when it already existed).
1.6.0 #
- Added
Response.sseandSseEvent(Laravel'sresponse()->eventStream()frames and</stream>end event), with an idle heartbeat that also detects closed clients, ending on shutdown. - Added
router.wsandResponse.webSocket: upgrade after the route's middleware, handler in the request scope,426for plain requests,1001on shutdown. - Added
DrainSignal, completed when the application starts draining. - Unsized
Response.streambodies are written unbuffered.
1.5.1 #
- Fixed: a JSON body number outside the double range (
1e309) is400 Malformed JSON body: Number out of rangeinstead of decoding to Infinity (a 500 when echoed, and on SQLite a stored value that broke every later read).
1.5.0 #
TouchableCacheStore.touch(key, ttl)(Laravel'sCache::touch) on the memory, file and database stores.ServerEngine.prepare: a per-request hook inside the request scope.MiddlewareRegistry.groupEntries,Translator.lines/jsonLines(read-only).- Fixed: a shared rate limit (
CacheRateLimitStore) could let one request too many through under concurrency.
1.4.1 #
- Fixed: response headers piled up across requests on a real server (
x-content-type-options: nosniff, nosniff, ...), becausedart:ioshares its default header lists with every response. The server starts withoutdart:io's defaults andResponse.writeToreplaces header values.
1.4.0 #
- Live API reference at
/docs/api(Scalar) and/docs/api.jsonin local environments (API_DOCS,API_DOCS_PATH);buildOpenApimoved here fromdartisan_cli. - Localization:
trans,transChoice,Lang,App.locale/App.setLocaleper scope,withTranslations,lang/<locale>.json,APP_FALLBACK_LOCALE,SetLocaleMiddleware; validation messages follow the current locale. cache.headersmiddleware (ETag,304) andCompressResponseMiddleware(gzip).- Feature flags (
Feature,FeatureManager,feature:middleware,CreateFeaturesTable) in Laravel Pennant's storage format. - Fixed:
HEADresponses are stripped after the global middleware.
1.3.0 #
- Model registry:
ApplicationBuilder.withModels,ModelRegistry,describeModel(read bydartisan model:showandmcp:serve). SCHEDULE_TIMEZONE(Laravel'sapp.schedule_timezone) as the default zone of scheduled tasks;ScheduledTask.wallTime.- Fixed:
ScheduledTask.timezone('UTC')and other alias zone names (GMT,US/Eastern) threw.
1.2.0 #
Application.withBindings,Container.callshorthand,inject<T>()/maybeInject<T>().- Fluent
String/String?helpers,10.minutes/7.days.fromNow, Carbon-style dates (diffForHumansinen/id) and calendar math (addMonthsoverflowing as Carbon,NoOverflowforms, week/month/year boundaries);Number(format,currency,fileSize,abbreviate,forHumans,ordinal). - Query shortcuts
wherePast,whereFuture,whereToday,whereBeforeToday,whereAfterToday(and theirNowOr/Orforms);whereYear/whereMonth/whereDayon model queries. DB.whenQueryingForLongerThan,DB.totalQueryDuration,DB.withQueryCount.Context: request data in log records, carried into dispatched jobs (hidden entries carried but not logged).package:daravel/html.dart: typed, escaped HTML builder; nodes are responses.ScheduledTask.timezone()accepts IANA zone names with Laravel's DST behaviour (addspackage:timezone).- Opening SQLite in a bundle built without it reports what is missing.
1.1.0 #
- Polymorphic relations (
MorphOne,MorphMany,MorphTo,MorphToMany,MorphedByMany),Relation.morphMap/enforceMorphMap,whereHasMorph, schemamorphs(); nestedwhereHas('a.b.c'); self relations aliased aslaravel_reserved_N;HasOneThrough;withSum/withAvg/withMin/withMax/withExists;QueryBuilder.selectSub. request.queryInt,queryDouble,queryBool,queryString(noawait);RuleBuilderchains (Rules.required().email().max(255)).CACHE_PROCESS_L1_TTL(near cache for theprocessstore) andCACHE_LIMITER(CacheRateLimitStore, rate limits in a cache store).- Fixed: nested transactions started together (
Future.wait) could roll back each other's work; a query after its transaction finished ran outside it (now aStateError). - Fixed: the database cache store lost concurrent
increments (now a compare-and-swap). - Fixed: on PostgreSQL,
withCountwith a constraint andwhereNotwith bindings failed (misnumbered placeholders). - Fixed: verifying a multi-lane argon2id hash could hang under load.
1.0.0 #
- First stable release: the Dart API follows SemVer from here on.
- File uploads:
multipart/form-databodies stream to temporary files asUploadedFile(request.file,hasFile,store,storeAs,UploadedFile.fake), with Laravel'sfile,image,mimes,mimetypesandextensionsrules and kilobyte sizes. Types are detected from the content; PHP files are refused. - Database drivers are pluggable (
withDatabaseDriver,DatabaseDriverFactory,RetryableErrors); MySQL and MariaDB ship indaravel_mysql.mediumText/longTextcolumns and named unique indexes match Laravel. Http: outgoing requests with Laravel'sHttp::API andHttp.fake().- Maintenance mode (
storage/framework/down,PreventRequestsDuringMaintenance). - Fixed: the migrator and the
unique/existsrules quoted identifiers with double quotes, which MySQL rejects. - Fixed: SQLite "database is locked" when several isolates open a new database file at once.
1.0.0-beta.3 #
- Declared route metadata:
.validates(FormRequest),.rules({...}),.returns(schema, name:, shape:)and.action(...); the kernel answers 403/422 before the handler andrequest.validated()returns the result.rulesToJsonSchemaconverts rules to JSON Schema. - Typed input:
input<T>()converts query and form strings (?page=5is5forinput<int>), plusinteger(),float(),boolean()andstring(). - Query strings and form bodies read bracketed keys like PHP (
ids[]=1&ids[]=2is a list;Request.queryInput,parseQueryString). Form bodies are now nested maps. - Fixed: on SQLite, queries from another request no longer run inside (and roll back with) an open transaction.
- Fixed: the access log measures time to response, without deferred work.
- PostgreSQL over a Unix socket (
DB_HOST=/cloudsql/...). - Monitoring hooks:
Job.tags,QueueDriver.oldestWait(custom drivers must implement it),QueueManager.pause/resume,DB.listenwithQueryExecuted. .env.encrypteddecrypted in memory at boot (EnvironmentEncrypter, Laravelenv:encryptformat); multi-line double-quoted.envvalues;EmbeddedWorkersandserveWith(embedQueue:, embedScheduler:).- Changed:
.envexpands only${NAME}(phpdotenv 5); a bare$NAMEstays literal. - Faster request path: no timer per request for long timeouts, cheaper request ids, no empty awaits.
1.0.0-beta.2 #
daravelLogoDataUrianddaravelFaviconDataUrifor welcome pages.ServeOptionsfalls back to the platformPORT(Cloud Run, Railway, Render, Fly.io) and binds0.0.0.0whenAPP_PORTis unset.DatabaseQueueskips jobs pushed by a Laravel app sharing thejobstable instead of failing them (or crashing on Laravel's stringbackoff).
1.0.0-beta.1 #
First public beta: the complete Tier 1 framework (container and zones, HTTP kernel and routing, validation with Laravel's rules and messages, query builder, ORM, migrations, auth with Sanctum-compatible tokens and JWT, multi-isolate serving, cache and rate limiting, events, queues and scheduling, API resources, storage, logging and metrics), Laravel-compatible wire and storage formats locked by a conformance suite, a security regression suite, and the Str / helpers / collection support layer.
The full history of the Daravel workspace is in the repository changelog.