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

Smarter bundling strategy #60

Merged
merged 13 commits into from Nov 9, 2023
Merged

Conversation

JReinhold
Copy link
Collaborator

@JReinhold JReinhold commented Nov 8, 2023

Telescopes on top of #59

Works on storybookjs/storybook#24490

This PR splits bundling of the entry points into three different types of entries: manager entries, preview entries and export entries. The reason for this should be written in the README. If anything is unclear about that we should update the README accordingly.

"@storybook/blocks": "7.0.0",
"@storybook/components": "7.0.0",
"@storybook/core-events": "7.0.0",
"@storybook/manager": "0.0.0-pr-24676-sha-214a6f84",
Copy link
Collaborator Author

@JReinhold JReinhold Nov 8, 2023

Choose a reason for hiding this comment

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

temporarily reference canary release until storybookjs/storybook#24676 has been released.

This doesn't have an affect on any addon's bundling as they should only reference these packages in the tsup config, not in their sources.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Now that Storybook 7.6 has been released, these should be 7.6.0 instead of the canary versions. This was adressed in #62

Copy link

Copy link

socket-security bot commented Nov 8, 2023

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: @storybook/manager@0.0.0-pr-24676-sha-214a6f84, @storybook/preview@0.0.0-pr-24676-sha-214a6f84

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

Comment on lines +86 to +90
"bundler": {
"exportEntries": ["src/index.ts"],
"managerEntries": ["src/manager.ts"],
"previewEntries": ["src/preview.ts"]
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is referenced by the tsup config, and can be modified by addon authors if they want, as long as the export map above is kept in sync.

We could also not do this and just keep these lists directly in the tsup config like we currently do. I don't have a strong oppinion.

@JReinhold JReinhold marked this pull request as ready for review November 8, 2023 13:08
@JReinhold JReinhold self-assigned this Nov 8, 2023
Copy link
Contributor

@kylegach kylegach left a comment

Choose a reason for hiding this comment

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

Reviewed the README updates. What's there is clear well-written. Hard to judge what might not be missing without gaining a lot more context on the work. We can always improve it as we discover those gaps. Nicely done!

@JReinhold
Copy link
Collaborator Author

@SocketSecurity ignore @storybook/manager@* @storybook/preview@*

@JReinhold JReinhold merged commit c4f81d7 into upgrade-packages Nov 9, 2023
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants