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

Inertia support #16

Closed
d8vjork opened this issue Jul 16, 2021 · 7 comments
Closed

Inertia support #16

d8vjork opened this issue Jul 16, 2021 · 7 comments

Comments

@d8vjork
Copy link

d8vjork commented Jul 16, 2021

Hi there, I see this package very useful for something my company is trying to do

Also we're using InertiaJS, it will be very nice to have compatibility with this package like the "Custom renderers" (which seems wip in the docs page) and sharing data will be much easier reusing Inertia's methods.

@d8vjork
Copy link
Author

d8vjork commented Jul 16, 2021

Ok I was too quick, actually I found the inertia response adapter you guys created on a different repo, now what's left is a little usage guide

@jonagoldman
Copy link

I think the single file package should be included in the main repo. Only 1 file, no need to make it a separate composer package to add to the list.

@d8vjork
Copy link
Author

d8vjork commented Jul 20, 2021

Indeed, PHP is not like JS, don't need to cut down in size as long as its only used when the user is using Inertia in his Laravel setup

@ksassnowski
Copy link
Collaborator

The issue is not the source files but the additional dependencies that the Inertia renderer has. Pulling it into the main package would mean that every project that installs Arcanist now automatically also depends on Inertia.

@jonagoldman
Copy link

jonagoldman commented Jul 20, 2021

Having a separate package also have some issues:

  • its not configurable (can't use main config file to e.g. change Inertia pages path, change route names, ...)
  • its one more composer dependency.
  • its one more Service Provider that needs to be loaded.

But I see the problem now, automatically adding Inertia as a dependency is worse.

No workaround?

@d8vjork
Copy link
Author

d8vjork commented Jul 20, 2021

Why not use Laravel's container instead of depending from the package itself?

I see this used in some packages, they also add the dependency as suggested instead of a requirement.

Edit: I see that you guys use the Facade way, I would suggest to use the global function helper inertia() instead so you can check before that if that function was registered, so no need of checking if the Inertia's service was bound to the container injection

@ksassnowski
Copy link
Collaborator

The suggets idea is an interesting suggestion. I will have a look at how Laravel deals with this internally e.g. for its various cache drivers.

I'm going to close this issue for now since Arcanist does support Inertia.js (in fact, that was my primary use-case when writing the package) and the conversation got a bit derailed. I saw that you also opened an issue in the inertia-response-renderer package regarding merging it into the core package, so let's continue the conversation there.

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

No branches or pull requests

3 participants