Skip to content
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

WIP [Workstream] Behaviors #963

Closed
emplums opened this issue Jan 14, 2021 · 0 comments
Closed

WIP [Workstream] Behaviors #963

emplums opened this issue Jan 14, 2021 · 0 comments

Comments

@emplums
Copy link

emplums commented Jan 14, 2021

Description

This issue tracks the work needed to develop a new system of behaviors in Primer React Components. This idea was proposed by @T-Hugs in https://github.com/github/design-systems/issues/1178 and further brainstormed during our ramp week (see notes here: ). As a result of our ramp up week session, we've decided to move forward with building a collection of React Hooks that can provide behaviors to our Primer React Components and also be imported individually.

One change in strategy to note is that we still intend to ship PRC components with these hooks initialized automatically (vs some of the approaches mentioned in #1178 suggesting shipping PRC without behaviors and expecting consumers to initialize behavior hooks themselves).

Part of this workstream also includes creating guidelines to follow for building out highly reusable components with behaviors, and suggesting some common API patterns to use when doing so. Right now in PRC, we use a mixture of managing state, letting consumers manage state, render props patterns, hook behavior patterns, etc. A deliverable of this workstream should be to standardize our approach to building behavioral components so that engineers contributing to PRC know exactly how to build a great component + consumers of the library know what to expect in terms of behavior APIs and state management.

Steps

  1. Create engineering guidelines for how behaviors should work in PRC so that behaviors are consistent across components
  • When should we manage state vs let consumers manage state vs a mix of both
  • What event handlers & state change hooks should generally be provided
  • Adding in ref forwarding
  • General guidelines for making a component reusable
  • The result of this work should be a new markdown document in this repo
  1. Create prioritized list of behaviors
  • Should take into account needs from other teams using PRC at GitHub
  • Involves meeting with engineers from other teams to gather feedback for prioritization
  1. Lift behaviors from Memex into Primer Components

  2. Implement new needed behaviors

  3. Refactor old behaviors to follow new system

List of components with behaviors in PRC currently:

Resources need + scope

This workstream should be considered continuous throughout the year as we add more and more behaviors to PRC, but a generic breakdown of scope involved is as follows:

  1. Create engineering guidelines
  • 1 week of research & writing guidelines for 2 engineers collaborating together, plus input from engineers across DS, UI Frameworks & Memex during the review process.
  1. Create prioritized list of behaviors
  • 2-3 days of work from 1-2 engineers
  1. Lift behaviors from Memex into Primer Components
    1-2 weeks of work, for 2-3 engineers + more resources needed for reviews

  2. Implement new needed behaviors

  • The scope of this depends on the list of behaviors needed created in Step 2. I imagine this chunk of work to be an ongoing effort throughout the quarter + year as we continue to add more and more behaviors
  1. Refactor old behaviors to follow new system
@emplums emplums closed this as completed Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant