Skip to content

List of proposals for improvement #67

@aralroca

Description

@aralroca

After a review, I add a list of proposals for improvement:

  • Provide directly the useTraversal hook. It is not recommended that the libraries directly expose the context and users have to write useContext(TraversalContext).
  • Consistency between the Form elements. Input, TextArea, FileUpload etc each with its own properties which are different from the standard HTML5. Or they are the same as HTML5 or they should have their own consistent version across all elements. For example: onChange now sometimes receives the value and other times the event.
  • Add source-maps to make it easier to debug for those who use the library.
  • Deprecate Ctx.filterTabs and instead use TabPanel props. Or keep both, but I would make the TabPanel have this controlled by default.

Instead of:

const calculated = ctx.filterTabs(tabs, tabsPermissions);
return <TabsPanel tabs={calculated} {...props} />

Do:

return <TabsPanel tabs={tabs} tabsPermissions={tabsPermissions} {...props} />
  • Change the currentTab prop of the TabPanel behavior. If the currentTab doesn't match with any tab that the user has permissions, then the first tab should be selected.
  • Add types to every configuration and context content. We don't need to convert the project to TypeScript but this way, those who use our API from the IDE itself can know, for example, when doAction what actions are available without having to consult our documentation. 
  • Add a formatter like Prettier to keep the code in a certain order.
  • Add missing files like CONTRIBUTING.md, LICENSE...
  • Remove linkstate dependency (only used in 1 component)
  • Replace react-use to own hooks: It's importing 60kb for 3 simple hooks...
  • Add an example in the repo of a simple admin. This will be useful for two things:
    • Make it easier for users to get started
    • Allow us to test the basic functionalities, either with cypress or in the development environment
  • ... Anything else you would like to add?

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions