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

add more type information to the 'webSocketHandler' method #463

Merged
merged 4 commits into from
Dec 9, 2024

Conversation

devoncarew
Copy link
Member

We'll need to update several packages (test, dds, ...) before this can land and be published. We can do that thuswise:

  • update the webSocketHandler calls to pass in a closure taking two params (see the changelog for an example)
  • widen their dep. range to take both shelf_web_socket v2 and v3 (the change above will retain compatibility w/ v2, and will make it future proof for the anticipated v3 version)
  • publish test, dds, ...
  • land and publish this

  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

devoncarew added a commit to dart-lang/test that referenced this pull request Dec 3, 2024
…od (#2421)

- add a 2nd argument to the closure passed into
package:shelf_web_socket's `webSocketHandler` method
- widen the dep on package:shelf_web_socket

This will allow us to add more type info to the closure that
`webSocketHandler` expects; it's currently an untyped Function. See also
dart-lang/shelf#457 and
dart-lang/shelf#463.

This forward declares compatibility with `3.0` of
`package:shelf_web_socket`; I _think_ this is necessary - as `dart test`
uses both package:test and package:shelf_web_socket - but happy to hear
otherwise.

---

- [x] I’ve reviewed the contributor guide and applied the relevant
portions to this PR.

<details>
  <summary>Contribution guidelines:</summary><br>

- See our [contributor
guide](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md)
for general expectations for PRs.
- Larger or significant changes should be discussed in an issue before
creating a PR.
- Contributions to our repos should follow the [Dart style
guide](https://dart.dev/guides/language/effective-dart) and use `dart
format`.
- Most changes should add an entry to the changelog and may need to [rev
the pubspec package
version](https://github.com/dart-lang/sdk/blob/main/docs/External-Package-Maintenance.md#making-a-change).
- Changes to packages require [corresponding
tests](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md#Testing).

Note that many Dart repos have a weekly cadence for reviewing PRs -
please allow for some latency before initial review feedback.
</details>

---------

Co-authored-by: Jacob MacDonald <[email protected]>
@github-actions github-actions bot added the type-infra A repository infrastructure change or enhancement label Dec 3, 2024
@devoncarew devoncarew changed the title [shelf_web_socket] add more type information to the 'webSocketHandler' method add more type information to the 'webSocketHandler' method Dec 3, 2024
@devoncarew
Copy link
Member Author

ping @brianquinlan (not sure if you saw this as it landed while you were OOO)

@devoncarew devoncarew merged commit e3975a8 into master Dec 9, 2024
25 checks passed
@devoncarew devoncarew deleted the more_types_shelf_web_socket branch December 9, 2024 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:shelf_test_handler package:shelf_web_socket type-infra A repository infrastructure change or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants