-
Notifications
You must be signed in to change notification settings - Fork 340
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
Custom Types Component #22
Comments
This seems like a step toward re-inventing apps. Isn't the purpose of this template to be an example and starting point for writing dapp-specific UIs? If so the types for the dApp should be hard-coded, not exposed to the end user. |
Could you explain the downside of including such a component? I imagine it would be something that shows up on the "blockchain loading" screen, and where a UI might fail to load, instead it just works. I imagine a use case for this to be when we might have a tutorial telling a user to go directly to: https://substrate.dev/substrate-ui-template/, since it is pre-hosted, and of course, we can't hard code every possible runtime in it It also makes sense for when we add a selector to connect to different endpoints. |
My concern is that it adds extra complexity, and may take away from the simple nature that the template has so far. When a developer forks the template UI to build their dapp-specific UI they will have to strip this feature out (or leave it in despite making the project larger). Your last two points are good, but I it feels like using Apps (which already has both features) would be better. |
@JoshOrndorff I think we should look at the implementation before we say if it is too complex. Statically defined types and dynamically defined types, to my understanding, can both be allowed. Adding this component should not affect anything related to defining static types right now. Further, a user who removes this component would have no behavioral changes around static types. If you know something I don't about why this wouldnt be the case, please call that out explicitly. |
I also think you need see that having a user "go to apps" is not always the right solution here. Any tutorial where we need to introduce Apps, we also need to introduce how a user uses and interacts with Apps. For example in the Kitties tutorial, we tell users to use apps for the first half of the tutorial, and then all of the sudden for UI development, they use an entirely different piece of software. I am not saying that this is not a pattern which we will end up doing, certainly the UI Template will not be able to do everything the Apps can do, but if this enables us to avoid showing a user two UIs, and thus simplify the developer learning curve, then it is totally worth it. |
This is a great template. I think the following improvements could be made:
The reasoning for suggesting the above is summarised below based on my developer experience trying to integrate this front-end into my Substrate Kitties-like custom runtime. I found out about this repo from the Riot chatrooms. |
@ltfschoen See if the latest readme have addressed your four points. And thanks for adding the Custom Type link :). |
@jimmychu0807 do you think it would be possible for each component to have its own "type" configuration right in the file, which then feeds to the API? |
Currently the |
And when the app is loaded, we can't call into other components? I am of course inventing a feature, but it would be cool if each module template kept their types in their code/component file. Then the UI would just pull the type information from each file and combine it together. |
I see. I think we can do it. So a component file also export out a |
If it makes sense, it might be a cool idea to play around with, otherwise, we don't want to over engineer the The ultimately goal is to keep things simple for the user to build on top of (and to understand to some extent). I am mostly talking aloud some ideas :) |
@shawntabrizi Take a look at commit a599517. Is this what you mean by putting But there is no good custom types in the template. So this code cannot be merged into master. I am just illustrating a pattern. |
Related to #16 and 800bd2b
We should see if we can avoid the UI vomiting if there are missing types, and allow users to specify new types right in the UI.
The text was updated successfully, but these errors were encountered: