Skip to content

Releases: adonisjs/inertia

Fix footer on splash screen

17 Sep 21:59
aaf1c0a
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.2.0...v1.2.1

Use our new splash screen

17 Sep 20:42
e45a674
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.1.0...v1.2.0

Include module augmentation in config stub

02 Jun 11:44
Compare
Choose a tag to compare

Commits

  • feat: include shared props module augmentation in config stub (47184ff)

Full Changelog: v1.0.0...v1.1.0

Out of experimental phase

02 Jun 11:31
Compare
Choose a tag to compare

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

01 Jun 22:00
Compare
Choose a tag to compare

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

18 May 13:27
Compare
Choose a tag to compare

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

07 May 16:24
Compare
Choose a tag to compare
  • chore: update dependencies (35bb855)

Full Changelog: v1.0.0-26...v1.0.0-27

Improve InferPageProps

28 Apr 16:02
Compare
Choose a tag to compare

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

04 Apr 17:37
Compare
Choose a tag to compare
  • 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

Incorrect @inertiaHead

30 Mar 18:59
Compare
Choose a tag to compare

Commits

  • fix: incorrect head return with @inertiaHead 280a9e3

Full Changelog: v1.0.0-23...v1.0.0-24