All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Refactor Inertia configuration into a controller class method. Thanks @ElMassimo!
- Documentation updates. Thanks @osbre and @austenmadden!
- Further fixes to the
Vary
header. Thanks @skryukov! - Add configuration option for the component path in the renderer.
- Refactor the internals of shared Inertia data to use controller instance variables instead of module level variables that run a higher risk of being leaked between requests. Big thanks to @ledermann for the initial work many years ago and to @PedroAugustoRamalhoDuarte for finishing it up!
- Change the Inertia response to set the
Vary
header toX-Inertia
instead ofAccept
, Thanks @osbre! - Always set the
XSRF-TOKEN
in anafter_action
request instead of only on non-Inertia requests. This fixes a bug where logging out (and resetting the session) via Inertia would create a CSRF token mismatch on a subsequent Inertia request (until you manually hard refreshed the page). Thanks @jordanhiltunen!
- Reset Inertia shared data after each RSpec example where
inertia: true
is used. Thanks @coreyaus! - Update Github Actions workflows to use currently supported Ruby/Rails versions. Thanks @PedroAugustoRamalhoDuarte!
- Depend on railties instead of rails so that applications which only use pieces of Rails can avoid a full Rails installation. Thanks @BenMorganMY!
- Fix
have_exact_props
RSpec matcher in the situation where shared props are defined in a lambda that outputs a hash with symbolized keys
- Fix broken partial reloads caused by comparing a list of symbolized keys with string keys from HashWithIndifferentAccess
- CSRF protection works without additional configuration now.
- Optional deep merging of shared props.
- Document Inertia headers. @buhrmi
- Documentation typo fix. @lujanfernaud
- Changelog URI fix. @PedroAugustoRamalhoDuarte
- Allow rails layout to set inertia layout. Thanks @ElMassimo!
- Add the ability to set inertia props and components via rails conventions (see readme)
- Fix for a middleware issue where global state could be polluted if an exception occurs in a request. Thanks @ElMassimo!
- Fix an issue with Rails 7.0. Thanks @0xDing and @aviemet!
- Drop support for Rails 5.0 (and mentally, though not literally drop support for Rails < 6)
- Allow inertia to take over after initial pageload when using ssr. Thanks @99monkey!
- SSR!
- Fixed thread safety in the middleware. Thanks @caifara!
- Fixed the install generator.
installable?
was always returning false, preventing it from actually running. - Added an install generator for Vue.
- Added install generator to quickly add Inertia to existing rails apps via
rails inertia_rails:install:react
- Improve method for detecting whether a user used the RSpec helpers without adding
inertia: true
to the spec - Emit a warning when expecting an Inertia response in RSpec and never reaching a
render inertia:
call
- Define
redirect_to
andredirect_back
as public methods for compatibility with other code using them
- Added the same inertia awareness that redirect_to has to redirect_back
- Add
inertia
route helper feature
- Fix the definition for InertiaRails::Lazy to avoid an uninitialized constant error when booting an application.
- Add support for "lazy" props while rendering. These are props that never compute on the initial page load. The only render during a partial update that calls for them explicitly.
- Built in error sharing across redirects! adding
{ inertia: { errors: 'errors go here' } }
as an option inredirect_to
will automatically feed anerrors
prop to whatever is rendered after the redirect. - Set content type to json for Inertia responses
- Return the original response status with Inertia responses
- Test against multiple Rails versions in Github Actions
- Add the
inertia_location
controller method that forces a full page refresh
- Fixed a bug involving threadsafe versions and layouts
- Fixed Ruby 2.7 deprecation warnings
- Added
inertia_partial?
method - Fixed homepage in the gemspec
- Make the InertiaRails module data threadsafe
- Fix a typo in the README (inertia only has 1 t!)
- Added request.inertia? method
- Added patches to allow Rails errors to show properly in the inertia modal
- Fixed a middleware issue caused by a breaking change in Rack v2.1.*
- Change page url to use path instead of url
- Moved Inertia Share logic to a before_action to ensure it runs on every request
- Added rspec helpers
- Make sure that
inertia_share
properties are reset before each request
- Switches mattr_accessor defaults to block syntax to allow pre Rails 5.2 compatibility
- Allow
Intertia.share
within a controller to access controller methods
- Initial release