-
Notifications
You must be signed in to change notification settings - Fork 16
Add a hook for creating a new form #12
Conversation
|
Is this backwards compatible with VueJS v2? And current Jetstream apps? |
|
@driesvints Since I'm just adding a new method, this should be completely backwards-compatible (when I finish removing the dependency on the vue3 Inertia adapter). The only catch is that users with the vue2 adapter will get an error if they try to use the hook. |
|
@m1guelpf I guess that's fine as this is Vue v3 specific. |
|
I've tested this on a Jetstream vue3 app and a Jestream vue2 app and everything seems to work properly, although I'd appreciate some more vue2 testing before merging this |
|
@claudiodekker this look OK to you? |
|
@taylorotwell Yep, looks good to me on first glance 👍 @m1guelpf I'm assuming you tried |
|
@claudiodekker Imports only work on the top level, and we want this package to work with people using vue 2 too, so that's why there's a conditional and I've added the package to |
|
Going back to draft since I've found some issues related to displaying success state |
|
I've managed to solve the reactivity issue by wrapping the |
|
Tested on a Vue 2 app and it doesn't seem to cause any issues, so I'd say it's ready to go 🚀 |
Looking into the core of Inertia, we might be fine by using a global Inertia instance.
Closes #11
Opened the PR in draft mode because as of right now, we're introducing a dependency on
@inertiajs/inertia-vue3which is not ideal, but I can't think of a way to get access to theusePage()hook without doing so. Ideas welcome.