-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Core: Migrate from express
to polka
#29230
Conversation
Migrates away from express, instead using connect and the underlying node server directly. Both express and connect support the same middleware structure, which means most middleware packages work for both and have remained the same in this change. A few notes: - Express' router has been replaced by basic connect mount points (though the two are not equivalent exactly) - Express static has been replaced by sirv This trims a large sub-tree of dependencies from our packages which express was pulling in. We in fact use very little of the functionality express gives us, only really making use of the connect-style API anyway.
Migrates from express to polka 1.x.
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 6c3a0bb. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
@JReinhold this is where I got to with polka I may not have much time over the next few days, so if you do get time, feel free to use and push to this branch few things to note:
|
Thank you! 🙏 I'll make sure it gets over the finish line next week. |
express
to polka
Couldn't test rsbuild because of rspack-contrib/storybook-rsbuild#136, but looking at the source it doesn't look like they're depending on any express-specific behavior in the Same story for Modern Web, they don't yet support Storybook 8 so I couldn't test it, but their https://github.com/modernweb-dev/web/blob/master/packages/storybook-builder/src/index.ts#L60-L133 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
30 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings
🎉 |
Closes #29083
What I did
Migrates from
express
topolka
as the internal web server.Work in progress
Still WIP as there's some leftover changes from the old
connect
branch we can probably discard/revert now.Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
N/A yet
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal
,ci:merged
orci:daily
GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli/src/sandbox-templates.ts
Make sure this PR contains one of the labels below:
Available labels
bug
: Internal changes that fixes incorrect behavior.maintenance
: User-facing maintenance tasks.dependencies
: Upgrading (sometimes downgrading) dependencies.build
: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup
: Minor cleanup style change. Will not show up in release changelog.documentation
: Documentation only changes. Will not show up in release changelog.feature request
: Introducing a new feature.BREAKING CHANGE
: Changes that break compatibility in some way with current major version.other
: Changes that don't fit in the above categories.🦋 Canary release
This pull request has been released as version
0.0.0-pr-29230-sha-6c3a0bb1
. Try it out in a new sandbox by runningnpx [email protected] sandbox
or in an existing project withnpx [email protected] upgrade
.More information
0.0.0-pr-29230-sha-6c3a0bb1
without-express-polka
6c3a0bb1
1728379118
)To request a new release of this pull request, mention the
@storybookjs/core
team.core team members can create a new canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=29230
Greptile Summary
This PR migrates Storybook's internal web server from Express to Polka, aiming to reduce transitive dependencies and potentially improve performance.
code/core/src/core-server/dev-server.ts
, updating server initialization and middleware usagesirv
instead ofexpress.static
in multiple files