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

fix(connector): authEndpoint backward compatibility #410

Closed
wants to merge 12 commits into from

Conversation

@021-projects 021-projects marked this pull request as draft January 20, 2025 11:34
…orization&userAuthentication to pusher connector; full backward compatibility with deprecated pusher authEndpoint, authTransport, auth and authorizer options
@crynobone
Copy link
Member

Should we add peerDependency for pusher-js?

@021-projects
Copy link
Author

Should we add peerDependency for pusher-js?

I don't think so, because this dependency is currently optional, since Laravel Echo can use different connectors and Pusher may not always be needed. If we import Pusher from a dependency, it will increase the final bundle size for those using the socket.io connector. It would be nice to add type hints for options in the future, which would require add pusher-js, but that's later

@021-projects
Copy link
Author

Maybe we should add a warning for deprecated options to the console?

@kirkbushell
Copy link

kirkbushell commented Jan 21, 2025

As good as it is to see this PR, this appears to break the standards and conventions set up within package, using ES6 classes instead of functions to manage the complexity. It would appear that moving those options out of that class is a mistake, and should be managed as part of the Connector API, as that manages the options.

I think it's a relatively straight-forward change - if authorizer is present as part of the options, use that, else default to the other options for connectivity.

@021-projects
Copy link
Author

As good as it is to see this PR, this appears to break the standards and conventions set up within package, using ES6 classes instead of functions to manage the complexity. It would appear that moving those options out of that class is a mistake, and should be managed as part of the Connector API, as that manages the options.

In essence, options are still managed by classes - they just use utilities to improve code organization, which already happened with the isConstructor utility. Do you think this is a fundamental change? It seems like it's just code reuse. This makes the PusherConnector look much cleaner while still maintaining the same functionality. Also, the authorization options were moved to PusherConnector because Connector is an abstraction that is also used by other connectors that do not support Pusher options, which means that the abstraction only has code for one specific case. I thought this needed to be improved.

I think it's a relatively straight-forward change - if authorizer is present as part of the options, use that, else default to the other options for connectivity.

It's not just the authorizer, but several other options that stop working when the channelAuthorization property is provided, so the commit fad5599 essentially breaks the authorization functionality entirely, despite the fact that the properties have been deprecated for almost three years.

@021-projects 021-projects marked this pull request as ready for review January 22, 2025 10:31
@taylorotwell
Copy link
Member

This feels like a really big change?

@taylorotwell
Copy link
Member

@ProjektGopher can you take a look at this if you have a chance?

@021-projects
Copy link
Author

This feels like a really big change?

Not really big, just some refactoring to move Pusher options to the Pusher connector and fix backward compatibility

@taylorotwell
Copy link
Member

Reverted the original PR for now. cc @ProjektGopher

@ProjektGopher
Copy link
Contributor

Reverted the original PR for now. cc @ProjektGopher

That's what I was going to suggest as the easiest temporary solution. I agree that this PR looks like more work than necessary for now

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.

Latest Update broke auth
5 participants