aidenybai / million

Optimize React performance and make your React 70% faster in minutes, not months.
https://million.dev
MIT License
15.89k stars 558 forks source link

I see that components exported as default export getting wrapped into slot tag #985

Closed JustFly1984 closed 2 months ago

JustFly1984 commented 4 months ago

What version of million are you using?

3.0.3

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

yarn

What operating system are you using?

Mac

What browser are you using?

Chrome

Describe the Bug

I'm using gatsby integration and I have almost all components exported as `export const Component: ComponentType = memo(_Component)

but I've noticed a bug in one of my custom component, analyzing it I've found that it is wrapped in <slot> tag The only difference I've found - it was export default memo(Component) I've changed export to export const and it fixed the bug and removed the slot tag from html

I've went through whole app codebase and replaced default exports everywhere, except template files, cos I'm using createPages API instead of limited pages dir routing Anyway, gatsby requires template files to export component as export default, and src/html.tsx too. Setting disable million comments doesn't help and I see at least one slot at the top of html tree.

What's the expected result?

disable slot optimization for some export default components, or disable it at all.

Link to Minimal Reproducible Example

sorry

Participation

github-actions[bot] commented 4 months ago

Thanks for opening this issue! A maintainer will review it soon.

tobySolutions commented 4 months ago

Hello @JustFly1984, thank you again. Can you please make sure to provide reproduction along with issues you report?

JustFly1984 commented 4 months ago

@tobySolutions I’ve added you to my private project. You can test there, please find an invitation from ospm in your mailbox.

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days.

JustFly1984 commented 3 months ago

not stale

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days.

JustFly1984 commented 2 months ago

Not stale

JustFly1984 commented 2 months ago

I've provided access to my repository with Gatsby project

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days.