Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make jetstream extendable for other stacks by the community #26

Closed
wants to merge 1 commit into from

Conversation

Naoray
Copy link

@Naoray Naoray commented Sep 2, 2020

This time without formating :)

This PR introduces the possibility for the community to create own presets based on Jetstream's existing functionality. For example if someone would rather use Vue without the Inertia stuff in the backend he could create a Vue preset by using

InstallCommand::macro('vue', function () {
  // do steps to setup vue preset with views etc.
});

Those little additions would help the community which is not yet so deep into Livewire and Inertia to come up with there own presets for Jetstream.

@ConsoleTVs
Copy link

This is great!

@taylorotwell
Copy link
Member

I'm gonna be honest, I'm not sure of the community's ability to maintain 1:1 compatible stacks with Jetstream in the long term.

@ConsoleTVs
Copy link

ConsoleTVs commented Sep 2, 2020

I understand the concerns here @taylorotwell , however I think jetstream should not force users to use specific adapters, this would somehow be gate keeping other people's ability to extend this to other frameworks that are quite much popular than the stack used here. Of course this would put maintainers of those new adapters in the position of keeping a 1:1 integration. I highly doubt this should be of our concern in this library since at the end of the day, everybody can use the official provided adapters if they want.

Perhaps it would be cool to explore other ideas on how this should be handled if this solution was not of your liking 😉

@innocenzi
Copy link
Contributor

@taylorotwell Even though I think the same, I still think it'd be nice to let the ability for users to extend Jetstream

@taylorotwell
Copy link
Member

taylorotwell commented Sep 2, 2020

Well, we aren't really gate keeping that. Anyone can already write a Jetstream frontend and publish it as a package and tell people to composer require laravel/jetstream and then run php artisan some-package:install instead of jetstream:install and that package can do whatever it wants.

@ConsoleTVs
Copy link

Well, we aren't really gate keeping that. Anyone can already write a Jetstream frontend and publish it as a package and tell people to composer require laravel/jetstream and then run php artisan some-package:install instead of jetstream:install and that package can do whatever it wants.

Oh well, this is a solution I was not aware of, great to hear that!

@taylorotwell
Copy link
Member

As I noted above, you can already make your own Jetstream stack and publish them. No changes are needed in Jetstream to support this.

@AnandPilania
Copy link

@taylorotwell #26 (comment) solution is good, but can you separate the non-stack installation + configuration from console + service provider, so that custom-package will only handle routes => controllers and views and the core functionality of package remains same #26 (comment).

You can check the basic setup (only skeleton setup yet) @https://github.com/AnandPilania/laravel-jetstream where I'm using only tailwind, like:

after $this->installFortifyServiceProvider():

$this->installJetDefaults(); //will install & publish Sanctum + add Provider, User model & Actions + update configuration with `null` instead of any stack
$this->installJetstreamServiceProvider();

replaced Install Stack conditions with:

if ($this->argument('stack') === 'livewire') {
  $this->installLivewireStack();
} elseif ($this->argument('stack') === 'inertia') {
  $this->installInertiaStack();
} else {
  $this->installNoStack(); // handling all tasks related to non-stack
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants