Releases: adonisjs/inertia
Fix footer on splash screen
What's Changed
- fix: fixed footer of the home page by @TheoMeunier in #35
New Contributors
- @TheoMeunier made their first contribution in #35
Full Changelog: v1.2.0...v1.2.1
Use our new splash screen
What's Changed
- Add link to the Adonis Inertia starter kit repo by @marcuspoehls in #23
- Fix Inertia docs link in README.md by @marcuspoehls in #25
- change typo lucid to inertia in the readme by @nbourdin in #33
New Contributors
- @marcuspoehls made their first contribution in #23
- @nbourdin made their first contribution in #33
Full Changelog: v1.1.0...v1.2.0
Include module augmentation in config stub
Commits
- feat: include shared props module augmentation in config stub (47184ff)
Full Changelog: v1.0.0...v1.1.0
Out of experimental phase
Changes
Now that the hooks assembler and @adonisjs/vite have been stabilised, we can release @adonisjs/inertia with a stable version. No change to the API.
As a reminder, make sure you migrate to the new hooks assembler API: https://github.com/adonisjs/application/releases/tag/v8.3.1
Commits
- chore: update dependencies (61641f4)
Full Changelog: v1.0.0-29...v1.0.0
InferSharedProps and dynamic root view
Changes
InferSharedProps
One thing that was missing was the ability to have shared props automatically typesafe client side. This is now possible thanks to InferSharedProps
. To use it, you'll need to modify your config/inertia.ts
configuration file as follows :
import { defineConfig } from '@adonisjs/inertia';
import type { InferSharedProps } from '@adonisjs/inertia/types';
const inertiaConfig = defineConfig({
sharedData: {
mySharedData: 'foo'
},
});
export default inertiaConfig;
declare module '@adonisjs/inertia/types' {
export interface SharedProps extends InferSharedProps<typeof inertiaConfig> {
// If necessary, you can also manually add certain
// shared props, which would be shared from some middleware for example
manuallyAddedSharedProps: number;
}
}
Also make sure to include this reference directive in your inertia/app/app.tsx
/// <reference path="../../config/inertia.ts" />
Then, if you are already using InferPageProps
the SharedProps will be automatically added to it.
Documentation : https://docs.adonisjs.com/guides/inertia#shared-props
Dynamic root view
Sometimes you may need to define a different root view for another part of your application. Now you can, you can pass a function into the config:
import { defineConfig } from ‘@adonisjs/inertia’
export default defineConfig({
rootView: ({ request }: HttpContext) => {
if (request.url().startsWith('/admin')) {
return 'admin_layout';
}
return 'inertia_layout';
},
})
Starter kit example route
The starter-kit example route will now be available on /
, rather than /inertia
as this was a source of confusion for some users.
Commits
- refactor: add starter example route at
/
(71b8e5e) - feat: add InferSharedProps type (388553e)
- feat: dynamic root view (318d608)
- chore: update dependencies (dd6e121)
- test: fix failing test (1192c9a)
- chore: remove unused import (e4ce29d)
Full Changelog: v1.0.0-28...v1.0.0-29
v1.0.0-28
Commits
- fix: usage of SSR bundle on windows (9a16acd)
- chore: update dependencies (bb2b82a)
- feat: add directive (6747a27)
Full Changelog: v1.0.0-27...v1.0.0-28
Update dependencies
- chore: update dependencies (35bb855)
Full Changelog: v1.0.0-26...v1.0.0-27
Improve InferPageProps
Changes
Mainly improvements for InferPageProps:
- added support for inertia.lazy : InferPageProps will correctly infer the type of the lazy props
- Simplified typing output
- Fixed InferPageProps return when inertia.render is used without page props
Commits
- refactor: simplify InferPageProps typing (3436c0d)
- fix: InferPageProps with empty inertia.render method (f1dad28)
- chore: update dependencies (b8dadbc)
- feat: support inertia.lazy props via InferPageProps (0732b96)
- chore: update dependencies (5bfee9d)
Full Changelog: v1.0.0-25...v1.0.0-26
`renderInertia` wrong return type
- fix:
renderInertia
returns Route type (d584e25) - chore: fix incorrect url (d463e5d)
- chore: move to release-it instead of np (41d1e80)
Full Changelog: v1.0.0-24...v1.0.0-25