Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the purpose of [<Erase>] in Feliz? #40

Closed
cmeeren opened this issue Aug 27, 2019 · 6 comments
Closed

What is the purpose of [<Erase>] in Feliz? #40

cmeeren opened this issue Aug 27, 2019 · 6 comments

Comments

@cmeeren
Copy link
Contributor

cmeeren commented Aug 27, 2019

I notice that some types have [<Erase>] (but not all; notably, not prop).

https://github.com/Zaid-Ajaj/Feliz/search?q=%5B%3CErase%3E%5D&unscoped_q=%5B%3CErase%3E%5D

What is the point of [<Erase>] when members are generally inline anyway?

I'm asking because I need to know what to [<Erase>] in Feliz.MaterialUI, if anything.

@MangelMaxime
Copy link
Contributor

This is to reduce the impact of Feliz to bundle size to the minimum.

More info here: #1 (comment)

@cmeeren
Copy link
Contributor Author

cmeeren commented Aug 27, 2019

Thanks! Shouldn't it be on all types, then? E.g. prop?

type prop =

@MangelMaxime
Copy link
Contributor

No, because prop contains at least one member that is not inlined: Souce

Because inlining, this member would have a worst impact compare not inlined version.

@cmeeren
Copy link
Contributor Author

cmeeren commented Aug 27, 2019

Ah, so the general rule in the context of Feliz is "erase only types where ALL members are inline"?

@MangelMaxime
Copy link
Contributor

Yes, in theory, this rule should in 98% (not a precise number 😉 ) reduce the final bundle size.

You can always use the REPL if unsure or look at the webpack size output.

@cmeeren
Copy link
Contributor Author

cmeeren commented Aug 27, 2019

Great, thanks!

@cmeeren cmeeren closed this as completed Aug 27, 2019
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

No branches or pull requests

2 participants