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

[Documentation]: #22597

Closed
winkerVSbecks opened this issue May 17, 2023 · 7 comments · Fixed by #22701
Closed

[Documentation]: #22597

winkerVSbecks opened this issue May 17, 2023 · 7 comments · Fixed by #22701

Comments

@winkerVSbecks
Copy link
Contributor

Describe the problem

I looks like Storybook no longer supports managerHead and previewHead props in the main.js config. The StorybookConfig type doesn't have those props either. However, manager-head.html and preview-head.html still works.

Not sure if this is intentional. If it is, we should update the docs: https://storybook.js.org/docs/react/addons/writing-presets#previewmanager-templates

Additional context

No response

@kylegach
Copy link
Contributor

managerHead, yes. With the manager being pre-bundled, it makes sense that it is no longer available.

But previewHead is right here: https://github.com/storybookjs/storybook/blob/next/code/lib/types/src/modules/core-common.ts#L387

@maccapakka
Copy link

maccapakka commented May 23, 2023

I shared a custom manager UI via a preset using this option in v6.

What is the guidance on how to share manager-head.html in v7?

@shilman
Copy link
Member

shilman commented May 23, 2023

@ndelangen is this possible to support using prebundling? I.e. is this a bug / oversight in 7.0 or something that's impossible to support in the new setup?

@ndelangen
Copy link
Member

Not intentional, and should not be related to prebundling.
I'll check.

@ndelangen
Copy link
Member

ndelangen commented May 23, 2023

I can confirm managerHead broke un-intentially.
I can also confirm managerHead is missing in the StorybookConfig interface.
previewHead does exist:

/**
* Programmatically modify the preview head/body HTML.
* The previewHead and previewBody functions accept a string,
* which is the existing head/body, and return a modified string.
*/
previewHead?: PresetValue<string>;
previewBody?: PresetValue<string>;

const interpolations = await presets.apply<Record<string, string>>('env');
return getPreviewHeadTemplate(configDir, interpolations);
};


const headHtmlSnippet = await presets.apply<PreviewHtml>('previewHead');

I'll open a PR bringing back support for managerHead and I'll also add the 2 properties to the interface.

@shilman
Copy link
Member

shilman commented May 24, 2023

Yowza!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.1.0-alpha.23 containing PR #22701 that references this issue. Upgrade today to the @future NPM tag to try it out!

npx sb@next upgrade --tag future

@shilman
Copy link
Member

shilman commented May 24, 2023

Huzzah!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.17 containing PR #22701 that references this issue. Upgrade today to the @latest NPM tag to try it out!

npx sb@latest upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants