Skip to content

Conversation

@david-macpherson
Copy link
Contributor

Relevant components:

  • Scalable Pixel Streaming Frontend library
  • Examples
  • Docs

Problem statement:

If building for Prod the WEBSOCKET_URL supplied by the .env will be still be bundled into the generated files
The value of the WEBSOCKET_URL should only be bundled if built for dev

Solution

Move the logic for setting the WEBSOCKET_URL from the .env file to the webpack dev configuration
Set the WEBSOCKET_URL to undefined when building for prod

Documentation

Test Plan and Compatibility

Built for dev while setting the WEBSOCKET_URL var in the .env file and ensured the frontend was connecting to the supplied value
Built for dev without setting the value in the .env file and deployed to an sps install and ensured it was connecting to the generated websocket address
Built for prod while setting a value in the .env value and ensured it was connecting to the websocket generated address

@david-macpherson david-macpherson added the bug Something isn't working label Feb 22, 2024
@david-macpherson david-macpherson self-assigned this Feb 22, 2024
@david-macpherson david-macpherson changed the title Bf prod dev websocket url Bug Fix: Setting the WEBSOCKET_URL var prod and dev Feb 22, 2024
Copy link
Collaborator

@lukehb lukehb left a comment

Choose a reason for hiding this comment

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

lgtm

@dan-tw dan-tw merged commit bbb4578 into ScalablePixelStreaming:main Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants