Skip to content

Use Rolldown in build-tools#1359

Open
filipsobol wants to merge 15 commits into
ci/4293-migrate-to-rolldown-and-isolated-declarationsfrom
ci/4316-use-rolldown-for-build-tools
Open

Use Rolldown in build-tools#1359
filipsobol wants to merge 15 commits into
ci/4293-migrate-to-rolldown-and-isolated-declarationsfrom
ci/4316-use-rolldown-for-build-tools

Conversation

@filipsobol
Copy link
Copy Markdown
Member

@filipsobol filipsobol commented May 14, 2026

🚀 Summary

Migrate the repository tooling to Rolldown and isolated declarations.


📌 Related issues


💡 Additional information

N/A

@filipsobol filipsobol changed the title Ci/4316 use rolldown for build tools Use Rolldown for build-tools May 14, 2026
Comment thread packages/ckeditor5-dev-build-tools/src/plugins/declarations.ts Outdated
Comment thread packages/ckeditor5-dev-build-tools/src/plugins/splitCss.ts
Comment thread packages/ckeditor5-dev-build-tools/tests/index.test.ts
Comment thread tsconfig.json Outdated
/**
* Restores the `@preserve` marker removed by Rolldown when it normalizes pure annotations.
*
* This plugin can be removed once https://github.com/rolldown/rolldown/issues/9408 is fixed.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The mentioned issue already has a PR that fixes it, so we may be able to remove this plugin before this PR gets merged.

} );
}

function getDirectParentClasses(
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The current implementation works fine when the mixins are used like this:

class FileUploader extends /* #__PURE__ */ EmitterMixin() { /* ... */ }

However, it doesn't work when we use the following approach required by TypeScript's isolated declarations:

const FileUploaderBase: EmitterMixinConstructor = /* #__PURE__ */ EmitterMixin();

class FileUploader extends FileUploaderBase { /* ... */ }

This change fixes it.

@filipsobol filipsobol changed the title Use Rolldown for build-tools Use Rolldown in build-tools May 19, 2026
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8fbeea9. Configure here.


async generateBundle() {
const sourceFilePaths = getTypeScriptSourceFiles( sourceDirectoryPath );
const sourceFilePaths = getTypeScriptSourceFiles( pluginOptions.sourceDirectory );
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Declarations ignore tsconfig scope

Medium Severity

With declarations enabled, .d.ts files are generated by globbing every *.{ts,tsx,mts,cts} under path.dirname(input), not by honoring the provided tsconfig include/exclude. Files excluded from the project (or only reachable via a broader include) can still be processed or skipped incorrectly, unlike the removed TypeScript plugin.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8fbeea9. Configure here.

Copy link
Copy Markdown
Member Author

@filipsobol filipsobol May 19, 2026

Choose a reason for hiding this comment

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

I think this is acceptable for this PR. The declaration plugin intentionally works from the build input directory and mirrors source files into declaration assets. The build still passes the tsconfig to Rolldown, and declarations are only enabled when the tsconfig exists.

Fully matching TypeScript project file discovery would require implementing files/include/exclude, extends, default excludes, and TypeScript glob semantics. A partial implementation would likely be more fragile than the current explicit source-directory behavior.

If this becomes necessary, we would handle it as a separate improvement.

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.

1 participant