Skip to content

Ziggy is no longer optional #1023

@flick36

Description

@flick36
  • Jetstream Version: 2.7.0
  • Jetstream Stack: Inertia
  • Uses Teams: no
  • Laravel Version: 9.6.0
  • PHP Version: 8.1.4
  • Database Driver & Version: Postgres 14.2

Description:

Well with the newly added Intertia SSR Support #1012 Ziggy is now imposed to us

use Tightenco\Ziggy\Ziggy;

'ziggy' => function () {
return (new Ziggy)->toArray();
},
]));

So i believe theres no more reason to install ziggy as an optional dependecy

$this->requireComposerPackages('inertiajs/inertia-laravel:^0.5.2', 'tightenco/ziggy:^1.0');

and it should now be part of the package, also i think this is a breaking chance (since it is) because y if people decide not to use ziggy because as the creator of Inertia Jonathan Reinink says :https://twitter.com/reinink/status/1298577581650980871 some of use get rid of Ziggy because it causes more issues than it solves. But now we are forced to. wich is ok, it's your package guys, thanks for all the work you. just, like I mentioned above, now require the package withing the package and don't make it optional if we are not able to remove it, or maybe make it so we can publish de middleware and we might if we choose get rid of it completley.

To add on that, i think it's even bad practice to be using ziggy the way the Pull Request uses it:

.mixin({
methods: {
route: (name, params, absolute) => {
return route(name, params, absolute, {
...page.props.ziggy,
location: new URL(page.props.ziggy.url),
});
},
},
});

since, in Vue 3 mixins are no longer recommended https://vuejs.org/api/options-composition.html#mixins

And since in the same relase we just got the composition API #1001 as default it does make sense not to force ziggy on us

Sorry for the probably bad english btw, not my first tongue

Steps To Reproduce:

Fresh install of Jetstream with the removal of Ziggy as dependency

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions