Skip to content

Conversation

@rogertang619
Copy link

@rogertang619 Roger Tang (rogertang619) commented Jan 26, 2026

Overview

This PR adds comprehensive documentation for migrating Backpack Design System from custom npm scripts to Nx build orchestration.

Purpose: Planning and specification review (no code changes yet)
Status: Ready for review
Migration Duration: 8-10 weeks across 5 milestones

📋 Documentation Added

Core Documents

  • specs/001-nx-migration/spec.md - Complete migration specification

    • 36 functional requirements across build, test, lint, dev workflow, CI/CD
    • 19 non-functional requirements for performance, reliability, compatibility
    • 5 prioritized user stories (developers, CI/CD, new packages)
    • Success criteria and quality gates
  • specs/001-nx-migration/plan.md - Overall implementation plan

    • Technical approach and architecture decisions
    • 5-milestone roadmap with dependencies
    • Risk mitigation strategies
    • Performance targets and validation approach
  • specs/001-nx-migration/README.md - Navigation guide (中文)

    • Quick start and reading order
    • Milestone overview
    • Key decisions summary

Milestone Plans (5 detailed documents)

  1. Milestone 1: Nx Foundation (2-3 weeks) - MVP

    • Initialize Nx workspace
    • Configure 96 packages as Nx projects
    • Enable basic caching
    • Validate build output matches current
  2. Milestone 2: Testing & Linting (2 weeks)

    • Integrate Jest, ESLint, Stylelint
    • Enable test/lint caching
    • Implement affected commands
    • Percy integration
  3. Milestone 3: Development Workflow (1-2 weeks)

    • Storybook integration with Nx
    • Preserve HMR functionality
    • Developer experience optimization
  4. Milestone 4: CI/CD & Caching (2 weeks)

    • Update GitHub Actions workflows
    • Use affected commands in PR validation
    • Optional Nx Cloud integration
    • Target: >20% CI time reduction
  5. Milestone 5: Optimization (1 week)

    • Performance tuning
    • Complete documentation
    • Team training
    • Nx generators for new packages

Quality Assurance

  • checklists/requirements.md - Specification quality validation

🎯 Key Architecture Decisions

AD-001: Nx Cache Strategy

Decision: Hybrid approach (local cache → Nx Cloud)

  • Start with local cache (M1-3) for simplicity
  • Add Nx Cloud (M4) if performance requires
  • Reduces upfront complexity

AD-002: Package Structure

Decision: Preserve current packages/ directory structure

  • Minimizes migration complexity
  • Maintains all import paths
  • No breaking changes to consumers

AD-003: Storybook Integration

Decision: Custom integration (wrap existing config)

  • Keep working Storybook 10 configuration
  • Wrap as Nx targets
  • Lower migration risk

📊 Success Criteria

Metric Target Rationale
Build Time <110% baseline No significant slowdown
Cache Hit Rate >80% Effective caching
CI Time <80% baseline 20%+ improvement
Test Pass Rate 100% No regressions
Developer Satisfaction >80% Team adoption

🔄 Migration Approach

Principles:

  • ✅ Incremental, milestone-based delivery
  • ✅ Zero breaking changes to component APIs
  • ✅ Each milestone independently deployable
  • ✅ Comprehensive rollback procedures
  • ✅ Preserve all existing tooling (Webpack, Babel, Gulp)

Out of Scope (for initial migration):

  • ❌ Build tool replacement
  • ❌ Test framework changes
  • ❌ Package structure reorganization
  • ❌ Component API changes

📚 References

This migration plan is based on the following resources and prior work:

Internal Skyscanner Nx Migrations

Nx Ecosystem Documentation

Backpack-Specific References

Build Tools & Infrastructure

Related Monorepo Projects

🚀 Next Steps After Approval

  1. Milestone 1 Spike (1 week)

    • Create experimental branch
    • Install Nx and test basic integration
    • Validate architecture decisions
    • Measure baseline performance
  2. Milestone 1 Implementation (2-3 weeks)

    • Full Nx initialization
    • Configure all 96 packages
    • Enable build caching
    • Validate build output
  3. Subsequent Milestones (6-8 weeks)

    • Follow detailed milestone plans
    • Weekly progress reviews
    • Continuous validation

📖 How to Review

Quick Review (10-15 min)

  1. Read specs/001-nx-migration/README.md - Overview
  2. Skim spec.md - Requirements and scope
  3. Review architecture decisions in plan.md

Thorough Review (1-2 hours)

  1. Read spec.md - Full requirements
  2. Read plan.md - Technical approach
  3. Review milestone-1-nx-foundation.md - First milestone details
  4. Check other milestones as needed

Focus Areas for Review

  • Scope: Does this cover everything needed?
  • Approach: Are architecture decisions sound?
  • Risk: Are risks adequately mitigated?
  • Timeline: Is 8-10 weeks realistic?
  • Clarity: Can team execute from these docs?
  • References: Any missing context from banana/falcon migrations?

🤔 Open Questions for Discussion

  1. Should we enable Nx Cloud from M1, or wait until M4?
  2. Any concerns about preserving packages/ structure?
  3. Team bandwidth - can we dedicate resources for 8-10 weeks?
  4. Need access to banana/falcon repos for reference implementations?
  5. Any missing requirements or edge cases?
  6. Are the referenced Confluence pages accessible and up-to-date?

✅ Checklist

  • Specification complete with clear requirements
  • Implementation plan with technical approach
  • All 5 milestones planned in detail
  • Architecture decisions documented
  • Success criteria defined
  • Risk mitigation strategies included
  • Rollback procedures for each milestone
  • Performance targets established
  • Documentation navigation guide created
  • References to prior migrations included
  • External documentation links provided

📞 Discussion

Please review and provide feedback on:

  • Overall approach and timeline
  • Architecture decisions (cache strategy, package structure, Storybook)
  • Any missing requirements or concerns
  • Resource availability for implementation
  • Lessons from banana/falcon migrations that should be incorporated

Note: This PR contains documentation only - no code changes. Implementation will happen in subsequent PRs following milestone approval.


Ready for review! 🎉

- Add comprehensive migration guide with 5 milestones
- Document current state, blockers, and risks
- Provide detailed task breakdowns for each milestone
- No time/personnel estimates as requested
Add comprehensive documentation for Backpack's migration to Nx build
orchestration, including:

- Complete migration specification with requirements and success criteria
- 5-milestone implementation plan (8-10 weeks total)
- Detailed milestone plans with tasks, validation, and rollback procedures
- Architecture decisions resolving cache strategy, package structure, and
  Storybook integration
- Performance targets and quality gates
- Risk mitigation and rollback strategies

Migration approach:
- Incremental, non-breaking migration preserving all 96 packages
- Local cache first (M1-3), optional Nx Cloud later (M4)
- Keep existing build tools (Webpack, Babel, Gulp) as Nx targets
- Maintain packages/ directory structure for minimal disruption

Key milestones:
- M1 (2-3w): Nx Foundation - Basic build orchestration + caching
- M2 (2w): Testing & Linting - Jest, ESLint, Stylelint integration
- M3 (1-2w): Dev Workflow - Storybook integration + HMR
- M4 (2w): CI/CD - GitHub Actions + distributed caching
- M5 (1w): Optimization - Documentation + team training

Targets:
- Build time: <110% baseline
- Cache hit rate: >80%
- CI time reduction: >20%
- Zero breaking changes

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 26, 2026 09:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive documentation for migrating the Backpack Design System from custom npm scripts to Nx build orchestration. The documentation establishes a detailed 5-milestone plan spanning 8-10 weeks, with architectural decisions, risk mitigation strategies, and success criteria.

Changes:

  • Complete migration specification with 55 functional/non-functional requirements
  • Overall implementation plan with technical approach and architecture decisions
  • 5 detailed milestone plans with tasks, validation criteria, and rollback procedures
  • Quality checklists and navigation guides in both English and Chinese

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
specs/001-nx-migration/spec.md Migration specification with requirements, user stories, and success criteria
specs/001-nx-migration/plan.md Technical approach with architecture decisions and milestone overview
specs/001-nx-migration/README.md Navigation guide (Chinese) with quick start and milestone summary
specs/001-nx-migration/milestones/*.md 5 detailed milestone plans with tasks, validation, and rollback procedures
specs/001-nx-migration/checklists/requirements.md Specification quality validation checklist
docs/nx-migration/*.md Parallel documentation set with different technical approach
.mcp.json MCP server configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@skyscanner-backpack-bot
Copy link

Visit https://backpack.github.io/storybook-prs/4141 to see this build running in a browser.

These files were generated in a separate session and should not be
part of this PR. This PR should only include the specs/001-nx-migration
documentation for the new migration plan.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@rogertang619 Roger Tang (rogertang619) changed the base branch from main to WOODPECKER-4021 January 26, 2026 09:54
@rogertang619 Roger Tang (rogertang619) added the patch Patch production bug label Jan 26, 2026
@skyscanner-backpack-bot
Copy link

Visit https://backpack.github.io/storybook-prs/4141 to see this build running in a browser.

Keep the MCP server configuration in this PR.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…s to README

Enhanced the README with comprehensive sections:
- Migration background explaining current challenges
- Goals and requirements overview
- Technical approach with key architecture decisions
- Main blockers and risk mitigation strategies

This provides readers with quick context before diving into detailed docs.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Only banana monorepo exists for integration, not "future".
Corrected all 4 occurrences in the README.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Clarify that HMR stands for Hot Module Replacement (热模块替换)
to help readers unfamiliar with the term.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Patch production bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants