-
Notifications
You must be signed in to change notification settings - Fork 196
[2.x] Remove package imports from .d.ts file #420
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
Conversation
unfortunately the suggested changes does not resolve the problem. Error Logs: https://github.com/fxnm/laravel-echo-bug-report/actions/runs/14138980006/job/39616926410
|
I will try to take a look soon. It looks like the combination of requirements is very hard to bring together. Adding type hints for Pusher and SocketIO while they might not be installed. When a project sets If those packages are not installed, this causes: Solution Options and Trade-offs
|
In my humble option:
So the only viable option in my option is the
The
Unfortunately I was not able to trigger any warnings or errors. |
As of npm v7, peerDependencies are installed by default. So the downside of using peerDependencies is that it will install it by default (bloat) or warn (yarn / pnpm). It might still be an acceptable solution, though. |
I agree in any case of errors this change could be reverted |
Closing in favor of #419 (or accepting the issue) |
Fix: prevent TS errors when unused drivers are not installed
This patch removes global
.d.ts
references tosocket.io-client
andpusher-js
, preventing TypeScript errors in projects that don’t use these drivers.Driver-specific types are now only imported in their respective connector files, so they are only type-checked if the connector is explicitly used.
Fixes: #418