inertia
inertia copied to clipboard
Next
This PR introduces a pretty significant architectural change to Inertia from a publishing perspective.
Previously to use Inertia you needed to install the Inertia core package @inertiajs/inertia as well as the adapter of your choice, such as @inertiajs/inertia-react or @inertiajs/inertia-vue3. In addition to this you could also optionally install the @inertiajs/server and @inertiajs/progress libraries.
This approach was problematic because each library was versioned independently. For example, right now to use Inertia with React, you must be on @inertiajs/inertia at v0.11.0 and @inertiajs/inertia-react at v0.8.1. This is confusing for end users since it's hard to know at any given point which version of the React adapter is compatible with which version of the core adapter. It's also annoying to manage from a library maintenance perspective, since we need to maintain seven different changelogs and release notes, and it's hard to announce new versions from a marketing perspective since there are so many.
We're changing all this moving forward, and end users will only ever interact with one Inertia library — the adapter of their choice. If you use React, you'll install the @inertiajs/react package, and will have access to everything you need from there. Technically there will still be a core package that is shared by all the adapters, but that will automatically be installed as a dependency of the adapter library. This will mean that some of the imports for Inertia will change. For example:
// Before
import { Inertia } from '@inertiajs/inertia'
import { Link, Head } from '@inertiajs/inertia-react'
// After
import { router, Link, Head } from '@inertiajs/react'
In addition to this we're also synchronizing the version numbers across all the packages — so whether you're using React, Vue or Svelte, everyone will be on the same version number. I'm so looking forward to having one changelog!
Changes
- [x] Rename
@inertiajs/inertiato@inertiajs/core, and make it a dependency of all the adapters. - [x] Rename
@inertiajs/inertia-reactto@inertiajs/react - [x] Rename
@inertiajs/inertia-vueto@inertiajs/vue2 - [x] Rename
@inertiajs/inertia-vue3to@inertiajs/vue3 - [x] Rename
@inertiajs/inertia-svelteto@inertiajs/svelte - [x] Merge
@inertiajs/serverto@inertiajs/core - [x] Merge
@inertiajs/progressto@inertiajs/core - [x] Update
axiostov0.27.0(#1197) - [x] Add new
defineLayouthook to Vue 3 adapter (#1117) - [x] Add new
defineLayouthook to Vue 2 adapter (332b1b65aa4cff3fd0057b194a5d25760c51c48f) - [x] Add new
useFormhook to Vue 2 adapter (ff591960b2e3eeb51f0813c7f4b34010e40c72c5) - [x] Add
usePagehook to Vue 2 adapter - [ ] Add
useRememberhook to Vue 2 adapter - [x] Get (Vue 2) Cypress test suite passing
- [ ] Add throttling to fix
router.remember()issues (#411, #1106, #1286)
Fixes
Now that the core library is being merged into the individual libraries, will it still be possible to create our own client-side frameworks? Like the Mithril library, for example, which uses the core as part of its package:
https://github.com/maicol07/inertia-mithril
@jcs224
Technically there will still be a core package that is shared by all the adapters, but that will automatically be installed as a dependency of the adapter library.
Update axios to v0.27.0 (https://github.com/inertiajs/inertia/pull/1197)
what about bumping axios to 1.x?
latest release is 1.2.2
@emargareten yeah that's probably a good idea, I was considering that but forgot, thanks for the reminder 👍