For Engineers
Storybook
Storybook is a crucial tool in our development process, allowing to iterate on components and explore all their variations. We utilize both web and native versions of Storybook, which can be initiated locally:
# Web Storybook
yarn workspace @alaneu/storybook dev
# Mobile Storybook
yarn workspace alan-mobile dev:install-client -p ios # or android
yarn workspace alan-mobile dev:storybook
Any Pull Request that modifies a story will automatically trigger a deployment of a preview version of Storybook. The link to this preview can be found in the PR comments.
Making a component universal
If you encounter the need for a component existing on web or mobile, while you need it on the other platform, it should be made universal. This means that the component will be available on both platforms, and will be rendered using the same codebase.
Before making a component universal, please reach out to Murray Eng Owners to discuss the implications.
murray-contrib
While the core of Murray is not currently open for all contributions, we are actively enhancing our contribution process to empower everyone to contribute components.
We invite engineers to contribute to the murray-contrib package. This package serves as a repository for components that are not yet mature enough for inclusion in Murray's core. With fewer constraints (e.g., synchronization with Figma, accessibility, etc.), it provides a sandbox for experimenting with new ideas. The Murray team will review these components and provide guidance for improvement. Depending on their use cases, these components may eventually be incorporated into Murray's core.
To generate a new component in murray-contrib, run:
yarn workspace murray-contrib generate
The script will ask for the name of your component and some more info. Files will be generated automatically for you:
- new file for the component
- a story for Storybook
- automatic documentation of the component
alan-web/
├─ shared/murray-contrib/components/
│ ├─ NEW_COMPONENT
│ │ ├─ index.tsx
│ │ ├─ NEW_COMPONENT.tsx
│ │ ├─ NEW_COMPONENT.stories.tsx
All Murray Contrib components appear in the documentation under the "Documentation → Contrib" section
Promoting a component to Murray
When a component in murray-contrib has proven its value and maturity, it may be promoted to Murray's core. This process ensures that components meet our quality standards and are ready for wide adoption across the platform.
When to promote a component
Consider promoting a component when:
- It has been used successfully in production by multiple teams
- It has a clear, well-defined API
- It addresses a common use case that would benefit other teams
- It has been tested and refined through real-world usage
Prerequisites
Before starting the promotion process, ensure the component meets these requirements:
1. Health Check
- Figma integration: Add a link to the corresponding Figma component
- Accessibility: Verify full accessibility compliance (WCAG guidelines)
- 100% Figma compliance: Ensure the component matches the Figma design exactly
- Figma CodeConnect: Ideally integrate with Figma CodeConnect for seamless design-to-code workflow
You can rely on the Health page to check if basic requirement are met
2. Documentation
- Complete and accurate component documentation
- Clear usage examples and API documentation
- Storybook stories covering all component variations
3. Testing
- Comprehensive test coverage
- Accessibility testing
- Cross-platform compatibility (if applicable)
Promotion Process
Step 1: Preparation
- Coordinate with Murray team: Reach out to
@murray_ownersto discuss the promotion - Component audit: Review the component against the prerequisites above
- Impact assessment: Identify existing components that might be replaced
Step 2: Migration
- Move component to Murray: Transfer the component from
murray-contribto the appropriate location in Murray core - Add documentation: Create or update component documentation in Murray docs
- Update exports: Ensure the component is properly exported from Murray
Step 3: Deprecation (if replacing existing component)
- Rename existing component: Add
Deprecatedsuffix to the old component (e.g.,SelectOptionItem→SelectOptionItemDeprecated) - Mark as deprecated: Add TSDoc
@deprecatedannotation with migration instructions - Remove suffix: Rename the new component to remove the
Nextsuffix (e.g.,SelectOptionItemNext→SelectOptionItem)
Step 4: Communication
- Announce the promotion: Communicate the new component availability to relevant teams
- Migration guide: Provide clear migration instructions for teams using the old component
- Timeline: Establish a deprecation timeline for the old component
Ownership and Support
Distributed ownership is key: The team requesting the promotion should own the process, with support from @murray_owners at every step.
The Murray team will provide:
- Technical guidance on component standards
- Support during the migration process
- Code review and quality assurance
- Documentation review