Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@CodewithEvilxd
Copy link

Summary

This PR implements missing Object.defineProperty support in CommonJsExportRequireDependency, fixing a TODO that threw runtime errors.

Changes:

  • Replace throw new Error("TODO") with proper Object.defineProperty implementation
  • Handle both used and unused export cases
  • Follow existing webpack patterns from CommonJsExportsDependency

What kind of change does this PR introduce?

  • Bugfix

Did you add tests for your changes?

  • Yes
  • No (changes are internal bug fixes that don't require new tests - existing test suite covers the functionality)

Does this PR introduce a breaking change?

  • No

If relevant, what needs to be documented once your changes are merged or what have you already documented?

  • Nothing - these are internal improvements that don't affect public APIs

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Please add a test case

<p>(In chronological order)</p>

- [@google](https://github.com/google) for [Google Web Toolkit (GWT)](http://www.gwtproject.org/), which aims to compile Java to JavaScript. It features a similar [Code Splitting](http://www.gwtproject.org/doc/latest/DevGuideCodeSplitting.html) as webpack.
- [@google](https://github.com/google) for [Google Web Toolkit (GWT)](http://www.gwtproject.org/), which aims to compile Java to JavaScript. It features a similar [Code Splitting](http://www.gwtproject.org/doc/latest/DevGuideCodeSplitting.html) to webpack.
Copy link
Member

Choose a reason for hiding this comment

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

Avoid this change, not related to fix

} else {
ranges.push(`${quoteMeta(start)}-${quoteMeta(prev)}`);
}
return `[${ranges.join("")}]`;
Copy link
Member

Choose a reason for hiding this comment

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

Avoid this change, not related to fix

@hai-x
Copy link
Member

hai-x commented Oct 12, 2025

To be honest, I don’t think we currently support parsing reexport for Object.defineProperty, so it’s still a TODO.

@evenstensberg
Copy link
Member

@hai-x Lets keep this open until its fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants