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 explicit ws dependency #861

Closed
wants to merge 5 commits into from
Closed

Add explicit ws dependency #861

wants to merge 5 commits into from

Conversation

raiyaj
Copy link
Contributor

@raiyaj raiyaj commented Dec 12, 2022

#789 added a tail-logs command that uses ws, but doesn't add it to package.json. As a result, a project that installs pwa-kit-dev as a dependency (like when they generate a project with pwa-kit-create-app), it might come installed with an older version of ws with a different API contract that doesn't accept a URL instance as the address argument in the WebSocket constructor, breaking the log tailing functionality.

This adds ws as an explicit dependency to fix that!

Description

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

  • Add ws to package.json and update package-lock.json

How to Test-Drive This PR

  • Checkout this branch and run npm ci from the repo root
  • Assuming your production Runtime Admin API Key is in ~/.mobify, make sure you can tail logs with node packages/pwa-kit-dev/bin/pwa-kit-dev.js tail-logs -p scaffold-pwa -e production
  • Retry the same command, but with a typo in the project slug, causing a 403. The error message should link to this docs URL

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

@raiyaj raiyaj requested a review from a team as a code owner December 12, 2022 23:44
@raiyaj
Copy link
Contributor Author

raiyaj commented Dec 13, 2022

@@ -104,7 +104,8 @@
"webpack-dev-middleware": "^5.2.2",
"webpack-hot-middleware": "^2.25.1",
"webpack-hot-server-middleware": "^0.6.1",
"webpack-notifier": "^1.12.0"
"webpack-notifier": "^1.12.0",
"ws": "^8.11.0"
Copy link
Contributor Author

@raiyaj raiyaj Dec 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version definitely supports a URL instance for the address argument: https://github.com/websockets/ws/blob/master/lib/websocket.js#L666-L677

@raiyaj raiyaj changed the base branch from develop to release-2.4.x December 16, 2022 17:12
@raiyaj raiyaj changed the base branch from release-2.4.x to develop December 16, 2022 17:13
@raiyaj raiyaj closed this Dec 16, 2022
@wjhsf wjhsf deleted the fix-ws-dependency branch March 17, 2023 16:27
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.

1 participant