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

Service Provider 'defer' boolean property has been deprecated since 5.8, Why is it still in the package? #898

Closed
yelnyafacee opened this issue Mar 9, 2020 · 8 comments

Comments

@yelnyafacee
Copy link

The defer boolean property on the service provider which is/was used to indicate if a provider is deferred has been deprecated. In order to mark the service provider as deferred it should implement the Illuminate\Contracts\Support\DeferrableProvider contract. - Laravel

so why is the:

protected $defer = true;

still in IdeHelperServiceProvider?

also if public function boot() exist, how can it be deferrable?

@mfn
Copy link
Collaborator

mfn commented Mar 9, 2020

also if public function boot() exist, how can it be deferrable?

Hmmm 🤔

Good point. I guess it's a non-issue in practice because no one references the registered services out of context etc.

@mfn
Copy link
Collaborator

mfn commented Mar 9, 2020

I guess it's a non-issue in practice

I didn't want to imply this shouldn't be fixed though 😅

@mfn
Copy link
Collaborator

mfn commented Mar 10, 2020

I double checked with the docs and yep, as long as there's a boot, the deferred is useless the way I see it.

Even at the time the deferred was switched on, there was already a boot method, can be seen at a916da0 when you expand the rest of the file a bit.

Maybe back then it did something but nowadays (I'm "almost" sure) , deferred only works when you truly only register/provides and nothing else.

@barryvdh
Copy link
Owner

'back then' it worked by setting the provides() method to see when it was needed. So it wouldn't be loaded on web requests, only on the console when certain commands were executed. Not sure how deferred works now.

@stale
Copy link

stale bot commented Jul 29, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this issue is still present on the latest version of this library on supported Laravel versions, please let us know by replying to this issue so we can investigate further.
Thank you for your contribution! Apologies for any delayed response on our side.

@stale stale bot added the stale label Jul 29, 2020
@stale stale bot removed the stale label Jul 30, 2020
@barryvdh
Copy link
Owner

I guess we can just remove the property

@mfn
Copy link
Collaborator

mfn commented Jul 31, 2020

We've PR #914 which removes it but also switches to the new way since >= L6 using the marker interface.

However as mentioned there, this can't be merged as long as 5.5 is still supported and we don't even have tests to catch this.

I would suggest to be pragmatic and merge #914 for a release in September were we also bump composer and drop 5.5 for good, as the LTS is definitely over by then:
image

@mfn
Copy link
Collaborator

mfn commented Feb 16, 2024

This was all long ago, merged and released -> property is gone.

@mfn mfn closed this as completed Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants