Closed adrum closed 5 months ago
It's great, waiting for its acceptance, so we can start using it immediately 👍 💯
I just resolved the merge conflicts associated with this PR. Let me know if we want/need anything else.
I'm having difficulty reproducing the failed test locally. 🤔 Anything I should try?
It looks like the assertObjectNotHasAttribute
was removed in v10 and assertObjectNotHasProperty
was added as a replacement in v10.1 and v9.6.
Easiest solution is to just use assertFalse
in combination with a property_exists
check.
See: https://github.com/sebastianbergmann/phpunit/issues/5478
@rojtjo Thank you for getting to the bottom of that! I did not dig far enough into the error message to recognize the removal of those methods from PHPUnit.
This will solve so many things for us. Great addition!
I felt inspired by Livewire 3 Lazy feature which automatically fetched the data on page load. I think there's a ton of value in Inertia's current Lazy prop feature, but I think there are also scenarios where adding a Defer prop feature which automatically loads Lazy data on page load.
This works in tandem with https://github.com/inertiajs/inertia/pull/1617. It works by extending the Lazy feature but also informs the front-end on page load which deferred properties should be loaded automatically. These properties will then automatically trigger a reload with those properties automatically added in the
only
attribute.This reduces the amount of front-end code required to pull this off. To add a long-running API query to be deferred, it would look like this:
These deferred properties will only ever be loaded automatically after page loads/navigations. Otherwise, they behave just the same as Lazy props.