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

Create channel url on client from window.location #22055

Merged
merged 1 commit into from
Apr 20, 2023
Merged

Create channel url on client from window.location #22055

merged 1 commit into from
Apr 20, 2023

Conversation

medihack
Copy link
Contributor

Closes #20068

What I did

Create channels URL dynamically on the client by using the window location object. I got rid of SERVER_CHANNEL_URL. I don't see a case where it is really needed anymore, but not sure about that.

How to test

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["bug"]

@g1r0
Copy link

g1r0 commented Apr 13, 2023

Just run into the server channel issue after upgrading to SB7.0.4. We are using it behind nginx proxies. Is it possible to opt out of using server channels at all? Thanks!

const getProjectAnnotations = () =>
composeConfigs([{{#each previewAnnotations}}require('{{this}}'),{{/each}}]);

const channel = createPostMessageChannel({ page: 'preview' });
addons.setChannel(channel);

if (SERVER_CHANNEL_URL) {
Copy link
Member

Choose a reason for hiding this comment

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

At first I was worried that removing this if-statement might cause it to run more often, but it looks like it was always true already, because getServerChannelUrl always returns a non-empty string already.

@ndelangen ndelangen merged commit d760a5a into storybookjs:next Apr 20, 2023
@medihack medihack deleted the fix_client_channel_url branch April 20, 2023 12:05
@ndelangen ndelangen added the patch:yes Bugfix & documentation PR that need to be picked to main branch label May 23, 2023
@shilman shilman added patch:done Patch/release PRs already cherry-picked to main/release branch maintenance User-facing maintenance tasks and removed feature request labels May 23, 2023
shilman pushed a commit that referenced this pull request May 23, 2023
Create channel url on client from window.location
@shilman shilman mentioned this pull request May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core maintenance User-facing maintenance tasks patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Hardcoded host for server channel url prevents usage of custom host
4 participants