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

Attempt to add support for CSF3 render preset #76

Closed
wants to merge 6 commits into from

Conversation

shilman
Copy link
Member

@shilman shilman commented Jul 23, 2021

Issue: N/A

What I did

What I need

Trying to test it out, but the example is failing with the error:

Uncaught SyntaxError: The requested module '/node_modules/.vite/@storybook_client-api.js?v=c67b5dc5' does not provide an export named 'setGlobalRender'

This is strange because AFAIK that export exists, even in 6.3

@shilman shilman added the enhancement New feature or request label Jul 23, 2021
@@ -57,7 +57,7 @@ module.exports.generateIframeScriptCode =
.map((entry) => `// preview entry\nimport '${entry}';`)
.join('\n')} */

import { addDecorator, addParameters, addLoader, addArgTypesEnhancer, addArgsEnhancer } from '@storybook/client-api';
import { addDecorator, addParameters, addLoader, addArgTypesEnhancer, addArgsEnhancer, setGlobalRender } from '@storybook/client-api';
Copy link
Member

Choose a reason for hiding this comment

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

It looks like setGlobalRender is not exported by https://github.com/storybookjs/storybook/blob/c1befe4b2400920a6c52fdc947d8e598cc7e35e1/lib/client-api/src/index.ts#L1-L7.

Copy link
Member Author

Choose a reason for hiding this comment

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

@shilman shilman changed the title Attempt to add support for CSF3 global render function Attempt to add support for CSF3 render preset Jul 26, 2021
@thebuilder
Copy link

Should we bump the Storybook version?
https://github.com/eirslett/storybook-builder-vite/blob/main/packages/example-react/package.json#L18-L21

Seems like the Github Action installed 6.3.3.

@IanVS
Copy link
Member

IanVS commented Nov 17, 2021

Hi @shilman, what's the status on this PR?

@PascalAOMS
Copy link

Looking forward to make use of this feature.

Keep up the great work! 🙂

@IanVS IanVS force-pushed the fix/csf3-global-render-fn branch from 25a72fa to cfbeccd Compare December 29, 2021 18:22
@IanVS
Copy link
Member

IanVS commented Dec 29, 2021

I rebased this on master and tested it out. But the story seems to render fine with and without the changes in this PR. It would be good to have an example of a story example that fails without this PR and which should work correctly with it.

@IanVS IanVS force-pushed the fix/csf3-global-render-fn branch from 52e7949 to cc2ba9e Compare January 5, 2022 03:39
@IanVS
Copy link
Member

IanVS commented Jan 5, 2022

Well, I think this PR is "working", but I'm not really sure what it's supposed to be doing. I thought this would allow us to use automatic title generation, but that doesn't seem to be the case. I've removed the storyStoreV7 flag from the react example, and also removed the title, and the story no longer appears, and I get this message in the browser console:

Unexpected default export without title in 'exports-map-1': {"argTypes":{"backgroundColor":{"control":"color"}}}

@shilman
Copy link
Member Author

shilman commented Jan 5, 2022

closing in favor of #194

@shilman shilman closed this Jan 5, 2022
@shilman shilman deleted the fix/csf3-global-render-fn branch January 5, 2022 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants