Skip to content

Comments

fix: fix unused export panic when hmr: true#5237

Closed
RomanHotsiy wants to merge 1 commit intorolldown:mainfrom
RomanHotsiy:fix-barrel-unused
Closed

fix: fix unused export panic when hmr: true#5237
RomanHotsiy wants to merge 1 commit intorolldown:mainfrom
RomanHotsiy:fix-barrel-unused

Conversation

@RomanHotsiy
Copy link

@RomanHotsiy RomanHotsiy commented Jul 10, 2025

Attempt to fix #5235

Disclosure: this is AI-assisted as it's my first contribution into this repo and I'm not familiar with the code to be confident.

I confirmed that the test-case crashes before the fix and passes after the fix.

Comment on lines +326 to +327
.iter()
.any(|id| m.stmt_infos[*id].is_included),
Copy link
Author

Choose a reason for hiding this comment

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

I'm worried if this won't affect performance. Maybe the filtering needs to be done if only HMR is enabled?

@hyf0
Copy link
Member

hyf0 commented Jul 10, 2025

Thanks for your work on this. It's not good that we're too busy to make some clarifications. HMR is an experitmental and incomplete core feature. The current focus is to make it work in rolldown-vite. So we currently don't have the bandwidth to accept contributions or deal with community issues.

@hyf0 hyf0 closed this Jul 10, 2025
@hyf0
Copy link
Member

hyf0 commented Jul 10, 2025

HMR doesn't work with treeshaking is expected so far. To fix it, it requires a considerate design, we don't want to fix/handle it case by case at current stage, which might solves the problem for now but increase the complexity of handling it in the future.

@RomanHotsiy
Copy link
Author

Understood.

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.

[Bug]: panics for unused barrel exports when hmr: true

2 participants