Skip to content

Comments

test: mark output.dynamicImportInCjs tests as passed#8125

Merged
shulaoda merged 4 commits intomainfrom
01-30-test_mark_output.dynamicimportincjs_tests_as_passed
Jan 30, 2026
Merged

test: mark output.dynamicImportInCjs tests as passed#8125
shulaoda merged 4 commits intomainfrom
01-30-test_mark_output.dynamicimportincjs_tests_as_passed

Conversation

@shulaoda
Copy link
Member

@shulaoda shulaoda commented Jan 29, 2026

closes #7784

rollup@function@dynamic-import-this-function and rollup@function@dynamic-import-this-arrow are passing. rollup@function@dynamic-import-expression fails because we do not support resolveDynamicImport(specifier) when the specifier is an AST node.

Below test case config is rollup@function@dynamic-import-expression:

const assert = require('node:assert');

module.exports = defineTest({
	description: 'Dynamic import expression replacement',
	options: {
		plugins: [
			{
				resolveDynamicImport(specifier) {
					if (
						typeof specifier !== 'string' && // string literal concatenation
						specifier.type === 'BinaryExpression' &&
						specifier.operator === '+' &&
						specifier.left.type === 'Literal' &&
						specifier.right.type === 'Literal' &&
						typeof specifier.left.value === 'string' &&
						typeof specifier.right.value === 'string'
					) {
						return '"' + specifier.left.value + specifier.right.value + '"';
					}
				}
			}
		],
		output: { dynamicImportInCjs: false }
	},
	exports(exports) {
		const expectedError = "Cannot find module 'x/y'";
		return exports.catch(error =>
			assert.strictEqual(error.message.slice(0, expectedError.length), expectedError)
		);
	}
});

Copy link
Member Author


How to use the Graphite Merge Queue

Add the label graphite: merge-when-ready to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@shulaoda shulaoda changed the title test: mark output.dynamicImportInCjs tests as passed test: mark output.dynamicImportInCjs tests as passed Jan 29, 2026
@shulaoda shulaoda requested a review from sapphi-red January 29, 2026 16:05
@shulaoda shulaoda marked this pull request as ready for review January 29, 2026 16:05
Copilot AI review requested due to automatic review settings January 29, 2026 16:05
@netlify
Copy link

netlify bot commented Jan 29, 2026

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit cdbcd71
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/697c1da479dc230008c725cb

Copy link
Contributor

Copilot AI left a 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 marks three tests related to output.dynamicImportInCjs as passed, resolving issue #7784. The tests were previously categorized as unsupported, but are now working correctly in rolldown.

Changes:

  • Removed the output.dynamicImportInCjs section from unsupported features documentation
  • Marked two tests as fully passed (dynamic-import-this-function and dynamic-import-this-arrow)
  • Moved one test (dynamic-import-expression) to the "behavior passed, snapshot different" category with an explanatory comment
  • Updated test statistics to reflect these changes

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/rollup-tests/src/status.md Updated test counts: reduced unsupported features by 3, increased snapshot-different by 1, increased passed by 2
packages/rollup-tests/src/status.json Updated test counts in JSON format to match the markdown changes
packages/rollup-tests/src/ignored-passed-snapshot-different-tests.js Added dynamic-import-expression test with explanatory comment about AST node limitation
packages/rollup-tests/src/ignored-by-unsupported-features.md Removed entire section documenting output.dynamicImportInCjs incompatibility with its 3 associated tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@shulaoda shulaoda force-pushed the 01-30-test_mark_output.dynamicimportincjs_tests_as_passed branch from b3f6457 to 05bdbcb Compare January 30, 2026 02:43
@shulaoda shulaoda requested a review from sapphi-red January 30, 2026 02:44
Signed-off-by: 翠 <[email protected]>
Copilot AI review requested due to automatic review settings January 30, 2026 02:54
Signed-off-by: 翠 <[email protected]>
Signed-off-by: 翠 <[email protected]>
Copy link
Contributor

Copilot AI left a comment

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 3 out of 3 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (2)

packages/rollup-tests/src/ignored-by-unsupported-features.md:25

  • The list item formatting is inconsistent. Line 21 and lines 24-25 use - without a leading space after the pipe character, while other list items in the file use - (with a space). For consistency with the rest of the file, these should have a space after the pipe character.
 - rollup@function@dynamic-import-expression: Dynamic import expression replacement

### The plugin `sequential` is not supported
 - rollup@function@enforce-sequential-plugin-order: allows to enforce sequential plugin hook order for parallel plugin hooks
 - rollup@hooks@allows to enforce sequential plugin hook order in watch mode

packages/rollup-tests/src/ignored-by-unsupported-features.md:17

  • The test rollup@function@dynamic-import-expression is duplicated in two locations:
  1. Line 17 under "The shouldTransformCachedModule hook is not supported"
  2. Line 25 under "The resolveDynamicImport hook specifier: AstNode not supported"

According to the PR description, this test fails because of the unsupported resolveDynamicImport(specifier) with AST node specifier, so it should only be listed under the second section (line 25) and removed from line 17.

 - rollup@function@plugin-error-should-transform: errors in shouldTransformCachedModule abort the build

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@shulaoda
Copy link
Member Author

Sorry, I misread it. 😅

@shulaoda shulaoda merged commit 22cc1b7 into main Jan 30, 2026
32 checks passed
@shulaoda shulaoda deleted the 01-30-test_mark_output.dynamicimportincjs_tests_as_passed branch January 30, 2026 03:07
This was referenced Feb 4, 2026
shulaoda added a commit that referenced this pull request Feb 4, 2026
## [1.0.0-rc.3] - 2026-02-04

⚡ Remove Unnecessary Default Export Assignment

- Eliminates redundant variable assignments when exporting default values
- Reduces output bundle size and improves code clarity
```js
// index.js
var x = 42;
export default x;

// Before
var x = 42;
var entry_default = x;
export { entry_default as default };

// After
var x = 42;
export { x as default };
```

🐛 Avoid Unnecessary Facade Chunks

- Keep user-defined entry modules in their own chunks
- Reduces HTTP round trips and improves startup performance

```js
// main.js (entry module)
import { a } from './lib.js'
console.log(a)

// lib.js
export * from './counter.js'

// counter.js (entry module)
export const a = 100

// Before
dist/
├── main.js           → import { a } from './counter-chunk.js'; console.log(a)
├── counter.js        → export { a } from './counter-chunk.js' // ❌ facade chunk
└── counter-chunk.js  → export const a = 100

// After
dist/
├── main.js    → import { a } from './counter.js'; console.log(a)
└── counter.js → export const a = 100
```

### 🚀 Features

- expose `RUNTIME_MODULE_ID` constant for plugin authors (#8199) by @shulaoda
- warn unsupported combination of `preserveValueImports` and `importsNotUsedAsValues` in tsconfig.json (#8169) by @sapphi-red
- sophisticated watch tracking for load dependencies (#8092) by @sapphi-red
- add `inputMap` option to `minify` / `minifySync` functions (#8138) by @sapphi-red
- consolidate same tsconfig errors (#8119) by @sapphi-red
- include tsconfig file path in error messages (#8107) by @Copilot
- lazy-barrel: support incremental build mode (#8114) by @shulaoda

### 🐛 Bug Fixes

- rust: preserve dependencies added by `this.addWatchFile` (#8198) by @hyf0
- spawn `RuntimeModuleTask` after `build_start` to avoid race condition (#8182) by @shulaoda
- rust/dev: only close after the ongoing task finished (#8147) by @hyf0
- ensure `\0rolldown/runtime.js` will go through transform hook and add test (#8093) by @hyf0
- `[name]` in `assetFileNames` does not include the directory part (#8098) by @IWANABETHATGUY
- handle external module properties in namespace imports (#8124) by @IWANABETHATGUY
- keep user-defined entry modules in their own chunks (#8047) by @IWANABETHATGUY
- avoid `Unknown resolve error` error message (#8111) by @sapphi-red

### 💼 Other

- remove warnings  for building rolldown with `not(feature = "experimental")` (#8110) by @coolreader18

### 🚜 Refactor

- move `VERSION` to `constants` directory (#8200) by @shulaoda
- simplify import symbol check using `SymbolFlags` (#8193) by @shulaoda
- extract tsconfig option and transform options merging logic (#8168) by @sapphi-red
- filter empty module_groups before sorting (#8149) by @ShroXd
- lazy-barrel: use single `remove` instead of `contains_key` + `remove` (#8123) by @shulaoda
- lazy-barrel: avoid redundant call and inline `get_barrel_normal_module` (#8122) by @shulaoda
- use logger instead of console.log for warnings (#8117) by @IWANABETHATGUY
- module-loader: remove intermediate ModuleTaskOwnerRef type (#8113) by @shulaoda
- rename ReExportExternalModule to ReExportDynamicExports (#8104) by @IWANABETHATGUY

### 📚 Documentation

- add dynamic OG image generation (#8192) by @sapphi-red
- add dynamic OG image generation (#8191) by @sapphi-red
- add dynamic OG image generation (#8179) by @Copilot
- apis: add links to option descriptions in JSDoc comments (#8167) by @sapphi-red
- apis: clarify parameters of `resolveDynamicImport` hook (#8137) by @sapphi-red
- lazy-barrel: clarify default export behavior (#8128) by @shulaoda

### ⚡ Performance

- remove unnecessary assignment for default export (#8127) by @shulaoda

### 🧪 Testing

- dev: `this.addWatchFile` dependency should be preserved after reload (#8165) by @sapphi-red
- mark flaky `transform_runtime_module` test as ignored (#8178) by @Copilot
- rolldown_sourcemap: add test for coarse segments (#8166) by @sapphi-red
- dev: correctly assert file change (#8164) by @sapphi-red
- rust: `transform_runtime_module` test shouldn't panic inside (#8151) by @hyf0
- rust: fix flakiness of rust tests (#8150) by @hyf0
- mark `output.dynamicImportInCjs` tests as passed (#8125) by @shulaoda
- lazy-barrel: add test cases for default export (#8129) by @shulaoda
- rolldown_plugin_vite_manifest: use relative path for outPath (#8101) by @shulaoda

### ⚙️ Miscellaneous Tasks

- deps: update crate-ci/typos action to v1.43.1 (#8188) by @renovate[bot]
- deps: update rust crate ts-rs to v12 (#8160) by @renovate[bot]
- deps: update crate-ci/typos action to v1.43.0 (#8175) by @renovate[bot]
- deps: update rust crates (#8157) by @renovate[bot]
- deps: update oxc to v0.112.0 (#8171) by @renovate[bot]
- deps: update rollup submodule for tests to v4.57.1 (#8176) by @sapphi-red
- deps: update test262 submodule for tests (#8177) by @sapphi-red
- deps: update dependency oxlint to v1.43.0 (#8173) by @renovate[bot]
- deps: update dependency oxfmt to ^0.28.0 (#8170) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.21.8 (#8163) by @renovate[bot]
- deps: update dependency vue-router to v5 (#8159) by @renovate[bot]
- deps: update github-actions (#8158) by @renovate[bot]
- deps: update npm packages (#8156) by @renovate[bot]
- deps: update dependency oxlint-tsgolint to v0.11.4 (#8140) by @renovate[bot]
- fix clippy replacement typo (#8136) by @IWANABETHATGUY
- disallow `HashMap::new` and `HashSet::new` by clippy (#8135) by @sapphi-red
- deps: update dependency rolldown-plugin-dts to v0.21.7 (#8126) by @renovate[bot]
- deps: update oxc resolver to v11.17.0 (#8121) by @renovate[bot]
- deps: update dependency oxlint-tsgolint to v0.11.3 (#8109) by @renovate[bot]

### ❤️ New Contributors

* @coolreader18 made their first contribution in [#8110](#8110)

Co-authored-by: shulaoda <[email protected]>
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.

Investigate and resolve incompatibility with output.dynamicImportInCjs

2 participants