Getting started
Upgrade guide
Oriel is in alpha, so a release can change something your app relies on. Each release's breaking changes are listed below, newest first, each with what to do about it.
Moving to a new version#
A new app takes each Oriel package at the exact version of the installer that made it, so a later release changes
nothing in your app until you move to it. To move, set every @orieljs/ package in your package.json to the same
new version, exactly:
npm install --save-exact @orieljs/framework@0.1.0-alpha.15 @orieljs/vite@0.1.0-alpha.15List your kit's own packages in the same command: @orieljs/ and your framework's adapter
(@orieljs/, -vue, -svelte, -solid or -angular), or @orieljs/. With the other
package managers, -E pins the version the same way: pnpm add -E …, yarn add -E …, bun add -E …. Then run your
migrations and work through the sections below, from the version you had to the one you moved to:
node oriel migrateAn app made before 0.1.0-alpha.15 has ^ ranges, which take a later release by themselves the next time the
dependencies are installed without a lockfile. Pinning its packages as above stops that.
0.1.0-alpha.15#
- Oriel's packages are pinned in new apps. Nothing to do in an existing app, but you can pin it the same way (above).
find()with an array returns a collection of the models it found, as Laravel's does. Code that calledfind([1, 2])expecting one model takes.first()of the result.- Two app classes with the same name are stored in a queued job by their folder, as
Events.OrderShippedandMail.OrderShipped. A class whose name is its own keeps it. Deploy your app and its workers together. - A
limit()in an eager-load constraint applies to each model, as in Laravel 11:Post.with({ comments: (q) => q.limit(3) })gives each post three comments. It needs SQLite 3.25, MySQL 8 or PostgreSQL. increment()anddecrement()on a model dispatchupdatingandupdated. An observer that should ignore them checkswasChanged()for the columns it cares about.- Two-factor counts wrong codes in the cache. On several servers, or on Vercel, the cache store must be shared:
databaseorredis. public/publishes the same files everywhere:serve(),vercel:buildandoriel exportleave out TypeScript files and dotfiles, except.well-known/and.nojekyll.serve()now serves.well-known/; the builds no longer copy other dotfiles, such as.htaccess, orpublic/.index.ts - Inner transactions started at once under one transaction run one after the other. One that waits for a sibling started beside it never finishes: await them in turn, or start them from separate transactions.
- Two-factor sign-in rehashes the password when your hashing settings changed, as
Auth.attempt()does, so withauth.sessionthe user's other sessions end at their next sign-in after the change. - A chain's
catchjobs and a batch'sthen,catchandfinallygo to the chain's or batch's connection and queue, not the default: run a worker there. where(column, 'like', …)on PostgreSQL compares the column as text, as Laravel does, so it works on numbers and dates; acitextcolumn compares case-sensitively there, so usewhereLike()orilikefor those.- Page prop types leave out a model's hidden columns, which never reached the page: code reading
props.user.passwordno longer typechecks. inertia:stop-ssrexits 1 with "Unable to connect to Inertia SSR server." when none is running, andinertia:start-ssrexits 1 when its server is killed by a signal: a deploy script that stops SSR before starting it should allow the first to fail.
0.1.0-alpha.14#
- Database sessions keep no IP address or browser. Set
client_details: trueinconfig/to keep storing them; the columns are already there.session.ts - Drivers are installed separately:
better-sqlite3for SQLite on Node,@aws-sdk/andclient-s3 @aws-sdk/for ans3-request-presigner s3disk,@vercel/for ablob blobdisk. A missing one says which package to install. - A Live upload's
store()moves the file. Reset the property after storing it: a secondstore(), ortemporaryUrl()after it, throwsUploadAlreadyStoredError. TwoFactor.enableApp()refuses an app that already works, withTwoFactorAppAlreadyEnabledError: calldisableApp()first.DB_URLandDB_CONNECTIONno longer reach your tests. UseTEST_DATABASE_URLto test on PostgreSQL or MySQL.- A command registered as a class gets a new instance for each run.
- Add
AuthenticateSessionto thewebgroup inbootstrap/to end other sessions on a new password, and inapp.ts vitest.config.tsreplaceenv: { ...TESTING_ENVIRONMENT }with...testingConfig().