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

Build: Bundle lib/preview-web with ts-up #19319

Closed
wants to merge 7 commits into from
Closed

Build: Bundle lib/preview-web with ts-up #19319

wants to merge 7 commits into from

Conversation

javier-arango
Copy link
Contributor

Issue: #18732

What I did

Migrated lib/preview-web to use the ts-up bundler.

How to test

  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

@IanVS IanVS added the maintenance User-facing maintenance tasks label Oct 3, 2022
@IanVS
Copy link
Member

IanVS commented Oct 3, 2022

@javier-arango I pulled your branch and ran yarn bootstrap --build, and saw that preview-web was failing, with a message of:

src/PreviewWeb.tsx(65,3): error TS2612: Property 'previewEntryError' will overwrite the base property in 'Preview<TFramework>'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration.

So, I removed the duplicate previewEntryError, and was able to build successfully. Let's see what happens in CI 🤞.

@javier-arango
Copy link
Contributor Author

@IanVS Thank you for the help. Now I don't know why the lint check is failing. I am getting this error /tmp/storybook/code/lib/core-client/src/preview/start.test.ts 10:8 error Unexpected use of file extension "mockdata" for "@storybook/preview-web/dist/cjs/PreviewWeb.mockdata" import/extensions. Also, the unit-test is failing with this error Cannot find module '@storybook/preview-web/dist/cjs/WebView' from 'lib/core-client/src/preview/start.test.ts'. When I try to edit the import to @storybook/preview-web/dist/WebView and I try to commit it I get the same lint error. I don't know how to fix it.

@ndelangen ndelangen self-assigned this Oct 5, 2022
@ndelangen
Copy link
Member

Both the linting error and the unit-test failures are correct.

in lib/core-client direct references are made to files deep in the dist folder of lib/preview-web. Moving the bundling breaks this.

We either have to expose multiple entrypoints, or update the usage in lib/core-client in some form.

@javier-arango
Copy link
Contributor Author

@IanVS I saw that you were helping with this issue too. Saw your changes, but we still failing the unit-test. I was trying to figure it out how to fix it, but I couldn't find a way to do it. In the mean time, I am going to try to help with a different package. Let me know if I should do something to help with this issue.

@IanVS IanVS changed the title Build lib/preview-web with tsup Build: Bundle lib/preview-web with ts-up Oct 13, 2022
@IanVS IanVS added build Internal-facing build tooling & test updates and removed maintenance User-facing maintenance tasks labels Oct 13, 2022
@ndelangen
Copy link
Member

ndelangen commented Oct 28, 2022

@javier-arango I finally was able to get to this, but to not have to deal with merge conflicts I created a new branch off next branch. #19655

I'm sorry that I was not able to merge in your work, I really really appreciate the time, energy and skill you put into making this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Internal-facing build tooling & test updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants