mistercrunch commented on PR #31996:
URL: https://github.com/apache/superset/pull/31996#issuecomment-2617469743

   I kind of needed a refresher on what's in there or not:
   - [root 
call](https://github.com/apache/superset/blob/827042f12fb4710f75c26abbc3ea67c10a942ede/superset/views/base.py#L208-L212)
   - 
[user-related](https://github.com/apache/superset/blob/827042f12fb4710f75c26abbc3ea67c10a942ede/superset/views/utils.py#L71-L99)
   - 
[common](https://github.com/apache/superset/blob/827042f12fb4710f75c26abbc3ea67c10a942ede/superset/views/base.py#L325-L337)
   
   Quite a bit of junk in there. Trying to summarize:
   - basic user info (unclear why it's needed)
   - perms (optionally?), guessing perms can be quite large at times (!), 
probably used to check whether we should enable/disable action buttons and/or 
menu items (?)
   - some users preferences + locale-related stuff
   - dynamic menu configs, probably based on user-permissions, like only show 
subset of the Settings menu with what the user has access to - probably should 
be merged with the perm-related portion and served by a different mechanism
   - flash user messages (this is used for toasts, build on top of 
flask.flash), this is legacy and we should probably kill this eventually and 
have the frontend fully handle API calls and user messaging. Low volume, but 
the real issue here is that really can't count on the next round trip to flash 
a message to a user in the context of a SPA
   - language_pack, probably the most concerning thing here, meaning if you 
pick a language other than `en` you get a massive payload with all translated 
strings through this mechanism. That belongs in its own blocking, pre-render 
fetch, with proper browser caching set up. Here no caching would apply/work I 
think or lead to large memory usage. Ideally would be served as a static asset 
from a CDN.
   
   Unclear how dated/bad of a pattern this is in more modern app design... My 
take would be that it's somewhat reasonable for minimal 
must-have-data-to-render-anything stuff. Clearly has been abused here... 
Screams for modern server-side rendering, maybe or just a set of sensible 
refactor(s).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to