-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
mkSProxies generates a LOT of boilerplate code #75
Comments
I'm pretty sure this large amount of code is expected. It's the major
drawback of using that function. I believe it's provided for convenience,
not for performance, because doing it by hand is tedious.
|
I thought that maybe this one flew under the radar. It's not a big deal, maybe just worth explaining this in the docs since the impact of using it is so big |
Sorry for such a late response -- I'm probably going to remove this function altogether because it really is terrible. At the time I wrote it (while learning PureScript) I didn't understand the ridiculous code bloat that came along with it, and just enjoyed the reduced boilerplate, but it's really not worth it and I wouldn't advise anyone use it outside of a toy situation. |
@dariooddenino What do you think of #77? |
@thomashoneyman I think that it's a good solution! |
Environment
purescript-halogen
6.1.0purescript-halogen-formless
2.0.1Hi!
While doing some profiling for one of my purescript webapps, I found out that one single formless component was generating a 180kb js file on its own. A ~300LOC ps component was generating almost 3k LOC of javascript code.
I found out that the main culprit was
mkSProxies
. Every time one of the proxies is used, a huge block of code is generated.For example by just using
prx.maxUsages
the js code would result in:By replacing
mkSproxies
with a manually written record of proxies the file size went down from ~180K to ~90K.Similar things happen in other places (for example when defining
render
,handleAction
andhandleEvent
) but I guess that's a consequence of how this library was designed and are probably not as easily solvable as this one.For now I'm replacing all of
mkSproxies
usages, but I was wondering if I'm doing anything wrong on my end.Thanks!
The text was updated successfully, but these errors were encountered: