Skip to content

Refactor to reduce Rollup 5 upgrade diff#6246

Merged
lukastaegert merged 1 commit into
masterfrom
refactor-for-rollup-5
Jan 24, 2026
Merged

Refactor to reduce Rollup 5 upgrade diff#6246
lukastaegert merged 1 commit into
masterfrom
refactor-for-rollup-5

Conversation

@lukastaegert

@lukastaegert lukastaegert commented Jan 24, 2026

Copy link
Copy Markdown
Member

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

In order to reduce the friction in the code base for the Rollup 5 update, this refactors to consistently use declare over "!".

Copilot AI review requested due to automatic review settings January 24, 2026 09:22
@vercel

vercel Bot commented Jan 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
rollup Ready Ready Preview, Comment Jan 24, 2026 1:31pm

Request Review

@github-actions

github-actions Bot commented Jan 24, 2026

Copy link
Copy Markdown

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install rollup/rollup#refactor-for-rollup-5

Notice: Ensure you have installed the latest nightly Rust toolchain. If you haven't installed it yet, please see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust.

or load it into the REPL:
https://rollup-o0bgolabx-rollup-js.vercel.app/repl/?pr=6246

@github-actions

github-actions Bot commented Jan 24, 2026

Copy link
Copy Markdown

Performance report

  • BUILD: 6882ms, 832 MB
    • initialize: 0ms, 24.6 MB (+7%)
    • generate module graph: 2621ms, 632 MB
      • generate ast: 1412ms, 626 MB
    • sort and bind modules: 394ms (-11ms, -2.8%), 685 MB
    • mark included statements: 3865ms, 832 MB
      • treeshaking pass 1: 2243ms, 835 MB (+2%)
      • treeshaking pass 2: 454ms, 843 MB
      • treeshaking pass 3: 393ms, 842 MB (+2%)
      • treeshaking pass 4: 381ms, 851 MB
      • treeshaking pass 5: 379ms, 832 MB
  • GENERATE: 685ms, 931 MB
    • initialize render: 0ms, 832 MB
    • generate chunks: 37ms, 842 MB
      • optimize chunks: 0ms, 834 MB
    • render chunks: 630ms, 905 MB
    • transform chunks: 17ms, 931 MB
    • generate bundle: 0ms, 931 MB

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Refactors TypeScript class property declarations to more closely match the Rollup 5 code style by replacing declare properties with definite assignment assertions (!:), aiming to reduce the eventual Rollup 5 upgrade diff.

Changes:

  • Replaced many declare class properties with definite assignment assertions (!:) across AST nodes, scopes, variables, and Module.
  • Minor import cleanup in UpdateExpression.
  • package-lock.json updated with substantial metadata/structure churn.

Reviewed changes

Copilot reviewed 83 out of 84 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
src/ast/variables/NamespaceVariable.ts Converts declare properties to !: for Rollup 5 alignment.
src/ast/scopes/ModuleScope.ts Converts declare property to !: for Rollup 5 alignment.
src/ast/nodes/shared/Node.ts Converts core node declare properties to !:.
src/ast/nodes/shared/MethodBase.ts Converts declare properties to !:.
src/ast/nodes/shared/JSXElementBase.ts Converts declare property to !:.
src/ast/nodes/shared/FunctionNode.ts Converts declare properties to !:.
src/ast/nodes/shared/FunctionBase.ts Converts declare properties to !:.
src/ast/nodes/shared/ClassNode.ts Converts declare properties to !:.
src/ast/nodes/shared/CallExpressionBase.ts Converts declare property to !:.
src/ast/nodes/YieldExpression.ts Converts declare properties to !:.
src/ast/nodes/WhileStatement.ts Converts declare properties to !:.
src/ast/nodes/VariableDeclarator.ts Converts declare properties to !:.
src/ast/nodes/VariableDeclaration.ts Converts declare properties to !:.
src/ast/nodes/UpdateExpression.ts Converts declare properties to !: and removes an unused type import.
src/ast/nodes/UnaryExpression.ts Converts declare properties to !:.
src/ast/nodes/TryStatement.ts Converts declare properties to !:.
src/ast/nodes/ThrowStatement.ts Converts declare properties to !:.
src/ast/nodes/ThisExpression.ts Converts declare properties to !:.
src/ast/nodes/TemplateLiteral.ts Converts declare properties to !:.
src/ast/nodes/TemplateElement.ts Converts declare properties to !:.
src/ast/nodes/TaggedTemplateExpression.ts Converts declare properties to !:.
src/ast/nodes/SwitchStatement.ts Converts declare properties to !:.
src/ast/nodes/SwitchCase.ts Converts declare properties to !:.
src/ast/nodes/Super.ts Converts declare properties to !:.
src/ast/nodes/StaticBlock.ts Converts declare properties to !:.
src/ast/nodes/SpreadElement.ts Converts declare properties to !:.
src/ast/nodes/SequenceExpression.ts Converts declare properties to !:.
src/ast/nodes/ReturnStatement.ts Converts declare properties to !:.
src/ast/nodes/RestElement.ts Converts declare properties to !:.
src/ast/nodes/PropertyDefinition.ts Converts declare properties to !:.
src/ast/nodes/Property.ts Converts declare properties to !: and updates commented placeholders.
src/ast/nodes/Program.ts Converts declare properties to !:.
src/ast/nodes/PrivateIdentifier.ts Converts declare properties to !:.
src/ast/nodes/ParseError.ts Converts declare properties to !:.
src/ast/nodes/PanicError.ts Converts declare properties to !:.
src/ast/nodes/ObjectPattern.ts Converts declare properties to !:.
src/ast/nodes/ObjectExpression.ts Converts declare properties to !:.
src/ast/nodes/NewExpression.ts Converts declare properties to !:.
src/ast/nodes/MethodDefinition.ts Converts declare properties to !:.
src/ast/nodes/MetaProperty.ts Converts declare properties to !:.
src/ast/nodes/MemberExpression.ts Converts declare properties to !:.
src/ast/nodes/LogicalExpression.ts Converts declare properties to !:.
src/ast/nodes/Literal.ts Converts declare properties to !:.
src/ast/nodes/LabeledStatement.ts Converts declare properties to !:.
src/ast/nodes/ImportSpecifier.ts Converts declare properties to !:.
src/ast/nodes/ImportNamespaceSpecifier.ts Converts declare properties to !:.
src/ast/nodes/ImportExpression.ts Converts declare properties to !:.
src/ast/nodes/ImportDefaultSpecifier.ts Converts declare properties to !:.
src/ast/nodes/ImportDeclaration.ts Converts declare properties to !:.
src/ast/nodes/ImportAttribute.ts Converts declare properties to !:.
src/ast/nodes/IfStatement.ts Converts declare properties to !:.
src/ast/nodes/FunctionExpression.ts Converts declare properties to !:.
src/ast/nodes/FunctionDeclaration.ts Converts declare property to !:.
src/ast/nodes/ForStatement.ts Converts declare properties to !:.
src/ast/nodes/ForOfStatement.ts Converts declare properties to !:.
src/ast/nodes/ForInStatement.ts Converts declare properties to !:.
src/ast/nodes/ExpressionStatement.ts Converts declare property to !:.
src/ast/nodes/ExportSpecifier.ts Converts declare properties to !:.
src/ast/nodes/ExportNamedDeclaration.ts Converts declare properties to !:.
src/ast/nodes/ExportDefaultDeclaration.ts Converts declare properties to !:.
src/ast/nodes/ExportAllDeclaration.ts Converts declare properties to !:.
src/ast/nodes/EmptyStatement.ts Converts declare property to !:.
src/ast/nodes/DoWhileStatement.ts Converts declare properties to !:.
src/ast/nodes/Decorator.ts Converts declare properties to !:.
src/ast/nodes/DebuggerStatement.ts Converts declare property to !:.
src/ast/nodes/ContinueStatement.ts Converts declare properties to !:.
src/ast/nodes/ConditionalExpression.ts Converts declare properties to !:.
src/ast/nodes/ClassExpression.ts Converts declare property to !:.
src/ast/nodes/ClassDeclaration.ts Converts declare properties to !:.
src/ast/nodes/ClassBody.ts Converts declare properties to !:.
src/ast/nodes/ChainExpression.ts Converts declare properties to !:.
src/ast/nodes/CatchClause.ts Converts declare properties to !:.
src/ast/nodes/CallExpression.ts Converts declare properties to !:.
src/ast/nodes/BreakStatement.ts Converts declare properties to !:.
src/ast/nodes/BlockStatement.ts Converts declare properties to !:.
src/ast/nodes/BinaryExpression.ts Converts declare properties to !:.
src/ast/nodes/AwaitExpression.ts Converts declare properties to !:.
src/ast/nodes/AssignmentPattern.ts Converts declare properties to !:.
src/ast/nodes/AssignmentExpression.ts Converts declare properties to !:.
src/ast/nodes/ArrowFunctionExpression.ts Converts declare properties to !:.
src/ast/nodes/ArrayPattern.ts Converts declare properties to !:.
src/ast/nodes/ArrayExpression.ts Converts declare properties to !:.
src/Module.ts Converts declare properties to !: on the Module class.
package-lock.json Lockfile rewritten/normalized with many metadata/flag changes.

Comment thread src/ast/nodes/CatchClause.ts Outdated
Comment thread src/ast/nodes/shared/Node.ts Outdated
Comment thread src/ast/scopes/ModuleScope.ts Outdated
Comment thread src/ast/nodes/SwitchCase.ts Outdated
Comment thread src/ast/nodes/shared/FunctionBase.ts Outdated
Comment thread src/ast/variables/NamespaceVariable.ts
Comment thread src/ast/nodes/ImportDeclaration.ts Outdated
Comment thread src/ast/nodes/ExportAllDeclaration.ts Outdated
Comment thread src/ast/nodes/ExportNamedDeclaration.ts Outdated
Comment thread src/ast/nodes/ExportDefaultDeclaration.ts Outdated
@codecov

codecov Bot commented Jan 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.83%. Comparing base (7af842b) to head (9eec19b).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6246   +/-   ##
=======================================
  Coverage   98.83%   98.83%           
=======================================
  Files         273      273           
  Lines       10692    10692           
  Branches     2849     2849           
=======================================
  Hits        10567    10567           
  Misses         82       82           
  Partials       43       43           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lukastaegert

Copy link
Copy Markdown
Member Author

The AI has some good points, I thought they would be mostly equivalent. I guess I will instead refactor in the Rollup-5 branch

@lukastaegert lukastaegert deleted the refactor-for-rollup-5 branch January 24, 2026 13:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 20 changed files in this pull request and generated 1 comment.

Comment thread src/ast/nodes/shared/JSXElementBase.ts
@lukastaegert lukastaegert merged commit c519d82 into master Jan 24, 2026
54 checks passed
@lukastaegert lukastaegert deleted the refactor-for-rollup-5 branch January 24, 2026 13:52
@github-actions

Copy link
Copy Markdown

This PR has been released as part of [email protected]. You can test it via npm install rollup.

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.

2 participants