react-native icon indicating copy to clipboard operation
react-native copied to clipboard

[6.0] Remove unused params from getStorybookUI

Open levino opened this issue 3 years ago • 4 comments

In version 6 when I call

export const StorybookUIRoot = getStorybookUI({
    host: '192.168.1.167',
    isUIHidden: true,
})

both values are ignored.

levino avatar Apr 01 '22 12:04 levino

Thats because the server isn't yet supported in 6.0 so it does nothing.

dannyhw avatar Apr 01 '22 13:04 dannyhw

Okay. We should then remove the property from the config for getStorybookUI so TS gives an error when people try to set this. Maybe it should even throw an error "Server still unsupported!". Finding this out wasted quite some time for me.

levino avatar Apr 01 '22 13:04 levino

@Levino thats a good point! thanks for the feedback 🙏 . I would like to say though that some rough edges are expected in beta however I understand it can be frustrating.

dannyhw avatar Apr 01 '22 13:04 dannyhw

My pleasure. I suggest to use a whitelist for the options parameters which are currently supported and throw if any excess / unsupported values are set by the user.

levino avatar Apr 04 '22 07:04 levino

@dannyhw Hey there! I'm trying to make the first contribution to this project and this seems to be simple enough!

Is this a matter of removing server-related params from getStorybookUI? But I'm not sure which one I should remove—there seem a few:


export type Params = {
  onDeviceUI?: boolean;
  resetStorybook?: boolean;
  disableWebsockets?: boolean;
  query?: string;
  host?: string;
  port?: number;
  secured?: boolean;
  initialSelection?: InitialSelection;
  shouldPersistSelection?: boolean;
  tabOpen?: number;
  isUIHidden?: boolean;
  shouldDisableKeyboardAvoidingView?: boolean;
  keyboardAvoidingViewVerticalOffset?: number;
} & { theme?: typeof theme };

I guess we are removing host and port. How about query and disableWebsockets?

sunkibaek avatar Oct 07 '22 00:10 sunkibaek

Sorry for not responding before, I've been really busy recently. I just merged a big refactor that removes many unused ones. Then now I just remembered about this issue so sorry for doing it without saying anything. If you want another issue to work on I'd be happy to find another for you.

dannyhw avatar Nov 02 '22 19:11 dannyhw

Thats because the server isn't yet supported in 6.0 so it does nothing.

I've been trying to start a storybook server in our react-native solution, to be able to run loki. Are you saying that running a storybook server is now impossible?

Mellbourn avatar Feb 22 '23 09:02 Mellbourn

@Mellbourn this was previously the case but a few months ago I was able to get the server working so now the server is supported for v6.5

dannyhw avatar Feb 22 '23 10:02 dannyhw

@dannyhw thank you! Correcting the version of @storybook/core-server to 6.5.16 worked for me.

Mellbourn avatar Feb 22 '23 18:02 Mellbourn