balanced / balanced-dashboard

The Balanced dashboard.
https://dashboard.balancedpayments.com/
Other
2.29k stars 385 forks source link

Template extensibility #1388

Open mjallday opened 9 years ago

mjallday commented 9 years ago

I've been watching how we extend the dashboard for admin purposes and I think we're building debt by allowing or encouraging engineers to write html outside of the parent project.

The issue in a nutshell is that if we change the markup of a template, and recent experience shows we do this often, then we break the layout provided by any external libraries that provided templates that used the old markup.

This is a pretty common problem and is often solved by versioning, so it doesn't need to mean we break the projects if we increment the minor build number for these sorts of changes. But I think we can greatly reduce the scenarios where this happens by reducing the need for writing html.

I think external projects should use components provided by the core dashboard project.

Eg instead of writing a table to display my tabular data a developer would use a table view component that the dashboard provides.

If a project wants to add a button it should say "here's my button, here's the code to run when it's clicked, and here's where I want you to display it."

This seems more sustainable since it provides a cleaner api when extending the dashboard.

Ping @cohitre @kyungminkim @remear @mahmoudimus for thoughts. You've all played with the admin project so have valuable feedback about an approach like this.

Originally inspired by https://github.com/balanced/balanced-admin/pull/39#discussion_r15503063

cohitre commented 9 years ago

We've been slowly componentizing the templates and detail-views work focused on creating reusable views.

Next steps:

mjallday commented 9 years ago

this is being worked on over at https://github.com/balanced/balanced_kit