-
-
Notifications
You must be signed in to change notification settings - Fork 736
feat: support shorthand function for module factory to reduce bundle size #12226
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
Conversation
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.
Pull Request Overview
This PR introduces support for ES2015 object method shorthand syntax in module factory definitions to reduce bundle size. When the target environment supports this feature, module factories are rendered using shorthand notation instead of the traditional function property syntax.
Key Changes
- Module factories now use shorthand syntax (
"./src/app.ts"() {}) instead of traditional function properties ("./src/app.ts": function() {}) - This optimization reduces bundle size by eliminating the
: functionportion of each module factory definition
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
✅ Deploy Preview for rspack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📦 Binary Size-limit
❌ Size increased by 8.00KB from 47.67MB to 47.68MB (⬆️0.02%) |
CodSpeed Performance ReportMerging #12226 will not alter performanceComparing Summary
|
1d24028 to
27674f7
Compare
4dae46c to
3851b3c
Compare
chenjiahan
left a comment
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.
LGTM 👍
e856fce to
5ca2a3b
Compare
Summary
Introducing new
output.environment.methodShorthand. If target environment support this, module factories will be rendered as object method shorthand form.Before
This PR:
Related links
Checklist