-
Notifications
You must be signed in to change notification settings - Fork 4
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
MessageTranslator refactor issues #284
Comments
@sgzsh269 thoughts about this as well? |
Re: map of components, I agree that the map should be created once as that would be a more efficient and cleaner approach. Re: recursive rendering using widgetize approach, it does simplify the logic and has worked well but my one concern here is that it may be tightly coupling the widgets as layout/styling could differ when a widget is stand-alone vs nested so keeping it de-coupled would allow for greater flexibility in rendering the components. |
@kahkeng I agree with you on your points. A couple of things to note :
|
@sgzsh269 I think the layout issues could be addressed in the recursive style if there is a parameter or options dict that is passed into the recursive call, e.g. @brucedonovan I didn't look closely, but I think I saw that there is different handling for ListContainer and StreamingListContainer etc, so only those kinds of containers can hold other containers (i.e. only one level deep vs arbitrary configuration). Previously, we had something like NFTCollectionAssetsContainer which is a container that contains an NFTCollection and a ListContainer of NFTAssets, each of these are also containers. So how would you plan to support these kinds of configs, if we don't have a recursive approach? I think one major benefit of supporting recursive containers natively (first class support) is that we decouple the frontend implementation from backend, so the backend can (more or less) decide how to structure the data it wants to present, and the frontend will just render it. There is no need to push a frontend change to support new components, and backend can mix-and-match as needed if there are lots of kinds of information that it might want to eventually display (e.g. a larger display consisting of lists, carousels, panels, etc), as long as frontend has first-class support for common paradigms of containers. |
I was looking at the new MessageTranslator_, and saw this part below. I guess this is trying to address #105, but this approach I think won't work for the recursive function call pieces, which are used in various places like containers/streaming containers.
Note that we're also creating/re-creating this Map for each call to Widget, and we are instantiating all components/widgets no matter what, even if only one ends up getting rendered.
I think we should instead be creating this map once, and instead of the component itself, it should be a function call that will accept
widget
, and theWidget
function itself (to allow for recursive function calls).Something like
The text was updated successfully, but these errors were encountered: