-
Notifications
You must be signed in to change notification settings - Fork 14k
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
[Proposal] Superset Frontend Style Guidelines #16553
Comments
This is a great starting point! I like
These are hard to capture in linter and formatter but could still help code maintainability, readability and performance. |
thanks for bringing a Proposal. could you highlight some points that is in currently daily development, but preferred to be or will be changed in the further by this proposal? |
@ktmud That's the idea. In the end, what we want to achieve is a Wiki similar to this:
Each section/page should contain specific guidelines like this one already being cooked by @rusackas that falls into the Style/CSS/Theming page. |
@graceguo-supercat it's my understanding that everything in this proposal is already currently agreed to by the team and part of daily development. Let me know if that's incorrect! |
This is great @etr2460! I'm not sure if you want feedback on further development of some of these points, since this is high-level, but on the Redux vs local state with hooks bullet point for example, I assume we'll want to flush that out more soon. Like when is it considered "component" vs "global"? That gray area where local state is being passed around between 2-3 sub components... where does that fall? What do we do with api requests that are only used in one component... should those all be stored in redux even if only used in one component? These are some things that some of us are currently thinking about. :) |
Yup @eschutho , totally agree about clarifying when to use Redux vs. local state. I think we'll probably write a whole dos and don'ts for that question, although it's a bit too low level for this summary proposal. That said, if you asked me to chime in, i'd probably say:
I'm not a huge fan of Redux anyway, so i'll leave the decision making regarding state to those with more experience, more passion, and less angst 😅 |
@eschutho @etr2460 People with experience and interest in Redux can write a proposition of dos and don'ts similar to what @rusackas did for Style/CSS here. Then submit it for lazy consensus. After approval, it will become a page under Front End Guidelines. I think this will be a good process for all the topics. |
@etr2460 and @michael-s-molina thank you both for that feedback. A few of us are going to be working on cleaning up Redux state over the next few months, so we'll also start to write down some guidelines as we go along and share them out to the community to iterate on. |
The following is a proposal for high level frontend style guidelines, distilled from the many past SiPs and proposals. These high level guidelines will be the cover page for Superset's Frontend Style Guide, and we'll propose further Dos and Don'ts that conform to these guidelines and provide more actionable details for contributors. This proposal will be posted to the dev@ email list for lazy consensus before being migrated to the Superset Wiki.
Proposed Superset Frontend Style Guidelines
This is list of statements that describe how we do frontend development in Superset. While they might not be 100% true for all files in the repo, they represent the gold standard we strive towards for frontend quality and style.
References
[SIP-36] Proposal for standardizing use of TypeScript
This SIP formally adopted TypeScript as the main language for Superset frontend, started migration work for JavaScript => TypeScript, and added the requirement that all new frontend JavaScript should be written in TypeScript instead.
[SIP-37] Proposal to implement CSS-in-JS using Emotion
This SIP formally adopted Emotion as the method for adding styling to components, describes alternatives considered, and why migration is valuable.
[SIP-48] Using Ant Design as our primary component library
This SIP replaced Bootstrap with Ant Design as our main component library, and describes how they should interact with style overrides provided by Emotion.
[SIP-56] Adopt React Testing Library for testing React components
This SIP replaced Enzyme with React Testing Library for testing React components, primarily because RTL is the most used testing framework and fully supports the newest React features.
[SIP-61] Improve the organization of front-end folders
This SIP describes how we organize our frontend folders, including how we should group different types of modules and components, where tests should be located, and how files should be named.
to: @rusackas @michael-s-molina @ktmud @graceguo-supercat @eschutho @suddjian @nytai @pkdotson @betodealmeida and anyone else who works on the frontend that I may have missed!
The text was updated successfully, but these errors were encountered: