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

fix(v6): stub @storybook/react types till @redwoodjs/cli-storybook is installed #9027

Merged
merged 8 commits into from
Aug 28, 2023

Conversation

jtoar
Copy link
Contributor

@jtoar jtoar commented Aug 9, 2023

Supersedes #9015.

In v6, we decoupled Storybook from the framework. But generators still generate stories. If a user hasn't set up Storybook, but generates a page, etc (which is pretty much what happens in the tutorial), they'll see a type error in the *.stories.{tsx,jsx} file. See https://community.redwoodjs.com/t/redwood-v6-0-0-upgrade-guide/5044/35.

Ideally, we just wouldn't generate stories if a user hasn't set up Storybook. But the tutorial is written as if these story files were just around this whole time, which is how the framework has worked and works.

I think we can eventually get to the point where Storybook is fully decoupled, but I don't have a good idea of the amount of work that would need to be done, and am already focused on other projects (Docker). So this seems like the simplest fix for now without undoing the work we did.

@Tobbe had the idea here of stubbing the types till the @redwoodjs/cli-storybook is installed.

@jtoar jtoar added the release:fix This PR is a fix label Aug 9, 2023
@jtoar jtoar added this to the next-release-patch milestone Aug 9, 2023
@jtoar jtoar changed the title fix(v6): stub @storybookreact types till storybook is installed fix(v6): stub @storybook/react types till storybook is installed Aug 9, 2023
@jtoar jtoar changed the title fix(v6): stub @storybook/react types till storybook is installed fix(v6): stub @storybook/react types till @redwoodjs/cli-storybook is installed Aug 9, 2023
@jtoar jtoar modified the milestones: next-release-patch, v6.0.6 Aug 11, 2023
@dac09
Copy link
Collaborator

dac09 commented Aug 22, 2023

Thanks for humoring my questions both 👍👍👍. I'll let you merge!

@jtoar jtoar enabled auto-merge (squash) August 28, 2023 16:36
@jtoar jtoar merged commit 44b4a90 into main Aug 28, 2023
29 checks passed
@jtoar jtoar deleted the ds-v6/fix-storybook-typing-issue branch August 28, 2023 17:01
jtoar added a commit that referenced this pull request Sep 2, 2023
…` is installed (#9027)

Supersedes #9015.

In v6, we decoupled Storybook from the framework. But generators still
generate stories. If a user hasn't set up Storybook, but generates a
page, etc (which is pretty much what happens in the tutorial), they'll
see a type error in the `*.stories.{tsx,jsx}` file. See
https://community.redwoodjs.com/t/redwood-v6-0-0-upgrade-guide/5044/35.

Ideally, we just wouldn't generate stories if a user hasn't set up
Storybook. But the tutorial is written as if these story files were just
around this whole time, which is how the framework has worked and works.

I think we can eventually get to the point where Storybook is fully
decoupled, but I don't have a good idea of the amount of work that would
need to be done, and am already focused on other projects (Docker). So
this seems like the simplest fix for now without undoing the work we
did.

@Tobbe had the idea here of stubbing the types till the
`@redwoodjs/cli-storybook` is installed.

---------

Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>
Co-authored-by: Daniel Choudhury <dannychoudhury@gmail.com>
@jtoar jtoar removed this from the next-release-patch milestone Sep 2, 2023
@jtoar jtoar added this to the v6.1.1 milestone Sep 2, 2023
jtoar added a commit that referenced this pull request Sep 2, 2023
…` is installed (#9027)

Supersedes #9015.

In v6, we decoupled Storybook from the framework. But generators still
generate stories. If a user hasn't set up Storybook, but generates a
page, etc (which is pretty much what happens in the tutorial), they'll
see a type error in the `*.stories.{tsx,jsx}` file. See
https://community.redwoodjs.com/t/redwood-v6-0-0-upgrade-guide/5044/35.

Ideally, we just wouldn't generate stories if a user hasn't set up
Storybook. But the tutorial is written as if these story files were just
around this whole time, which is how the framework has worked and works.

I think we can eventually get to the point where Storybook is fully
decoupled, but I don't have a good idea of the amount of work that would
need to be done, and am already focused on other projects (Docker). So
this seems like the simplest fix for now without undoing the work we
did.

@Tobbe had the idea here of stubbing the types till the
`@redwoodjs/cli-storybook` is installed.

---------

Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>
Co-authored-by: Daniel Choudhury <dannychoudhury@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix This PR is a fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants