Use Rolldown in build-tools#1359
Conversation
build-tools
…packages themselves.
| expect( buildTools.rawImport ).toBeTypeOf( 'function' ); | ||
| expect( buildTools.splitCss ).toBeTypeOf( 'function' ); | ||
| expect( buildTools.translations ).toBeTypeOf( 'function' ); | ||
| } ); |
There was a problem hiding this comment.
New declarationFiles export missing from API test
Low Severity
The declarationFiles function is newly exported from index.ts and is part of the public API, but it's not verified in the index.test.ts API surface test. The test checks all other exports (build, addBanner, bundleCss, loadSourcemaps, rawImport, splitCss, translations) but omits declarationFiles, which means a future accidental removal wouldn't be caught by this test.
Reviewed by Cursor Bugbot for commit d29b3ed. Configure here.
There was a problem hiding this comment.
This is still a valid point.
| /** | ||
| * 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. |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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.
…n-for-build-tools
…isolated-declarations' into ci/4316-use-rolldown-for-build-tools
…isolated-declarations' into ci/4316-use-rolldown-for-build-tools
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 ); |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 8fbeea9. Configure here.
There was a problem hiding this comment.
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.
| } ); | ||
|
|
||
| test( 'Resolves absolute and relative CSS imports without Rollup results', async () => { | ||
| test( 'Resolves absolute and relative CSS imports without Rolldown results', async () => { |
There was a problem hiding this comment.
This test fails on Windows:
FAIL tests/plugins/bundleCss/bundleCss.mocked.test.ts > Resolves absolute and relative CSS imports without Rolldown results
AssertionError: expected 'D:\src\components\nested\local.css' to be '/src/components/nested/local.css' // Object.is equality
Expected: "/src/components/nested/local.css"
Received: "D:\src\components\nested\local.css"
❯ tests/plugins/bundleCss/bundleCss.mocked.test.ts:184:5
182| .toBe( '/styles/absolute.css' );
183| expect( await options.resolver.resolve( './nested/local.css', '/src/components/source.css?inline' ) )
184| .toBe( '/src/components/nested/local.css' );
| ^
185|
186| return {
I know this test wasn't added in this PR, but would it be possible to fix it here? 🙏


🚀 Summary
Migrate the repository tooling to Rolldown and isolated declarations.
📌 Related issues
💡 Additional information
N/A