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

Add renderer field to frameworks, and use to drive v6 store entrypoints #19595

Merged
merged 14 commits into from
Oct 25, 2022

Conversation

tmeasday
Copy link
Member

@tmeasday tmeasday commented Oct 24, 2022

Telescoping on #19594

Issue: v6 store needs to import various client APIs from the renderer not the framework.

What I did

  • Add renderer core option
  • Set in all frameworks (except angular+ember, see below)
  • Read similar to builder in build process so it is included as preset, without having to declare twice.
  • Import in v6 story entrypoints, via getRendererName
  • Update all frameworks

What I didn't do:

  • Update ember & angular as they don't appear to be split into frameworks+renderers yet. What should I do @shilman @ndelangen ?
  • Deal with the inconsistency in frameworks -- some seem to pass options to the builder, others don't, some see to resolve dependencies, others don't.

How to test

Run a sandbox in v6 mode, should work.

No longer try and do docs-page manager side.
Also ensure that the ClientAPI calculates the index correctly
@tmeasday tmeasday mentioned this pull request Oct 24, 2022
2 tasks
@tmeasday
Copy link
Member Author

@shilman I'm seeing this error in the build process (for both v6+v7 SB's) (not sure why we didn't see it before):

image

I think it's because the magic "preview.js" handling isn't applying to these presets.

const frameworkInitEntry = path.resolve(
path.join(workingDir, 'storybook-init-framework-entry.js')
);
virtualModuleMapping[frameworkInitEntry] = `import '${frameworkName}';`;
virtualModuleMapping[frameworkInitEntry] = `import '${rendererName}';`;
Copy link
Member

Choose a reason for hiding this comment

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

Should this be rendererInitEntry?

Copy link
Member Author

Choose a reason for hiding this comment

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

OK

Base automatically changed from tom/sb-849-cant-run-the-v6-store-in-sandboxes to next October 25, 2022 04:46
@tmeasday tmeasday merged commit 39662b1 into next Oct 25, 2022
@tmeasday tmeasday deleted the tom/sb-849-cant-run-the-v6-store-in-sandboxes-2 branch October 25, 2022 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants