-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Goal
Eliminate the @remix-run/router dependency from the Fusion Framework repository by completing the migration to our unified router solution (@equinor/fusion-framework-react-router). This will reduce external dependencies, simplify the codebase, and ensure all applications use a consistent, framework-integrated routing approach.
Why
Reduced Dependency Surface Area: Removing @remix-run/router eliminates an external dependency that is no longer needed once all apps migrate. This reduces maintenance burden, security exposure, and potential version conflicts.
Unified Router Strategy: @equinor/fusion-framework-react-router provides a purpose-built solution that integrates seamlessly with Fusion Framework's navigation module, context system, and module architecture. It offers route schema support for documentation and manifests, type-safe route definitions, and automatic Fusion context injection—features that are essential for our framework but not available in the generic @remix-run/router package.
Code Simplification: The current dual-router approach creates confusion and maintenance overhead. By removing @remix-run/router, we eliminate deprecated code paths (like NavigationProvider.createRouter()) and reduce the cognitive load for developers choosing routing solutions.
Framework Consistency: All Fusion applications should use the same routing solution to ensure consistent behavior, shared patterns, and easier cross-team collaboration. Removing the old dependency enforces this consistency.
How
This goal will be achieved through a phased approach:
Phase 1: Migration Monitoring & Outreach (Prerequisite)
- Monitor telemetry: Track usage of
NavigationProvider.createRouter()via telemetry events (Navigation::createRouter) to identify applications still using legacy routing - Contact app teams: Reach out to teams identified through telemetry monitoring to:
- Understand their migration timeline and blockers
- Provide migration support and documentation
- Coordinate migration efforts to ensure smooth transition
- Verify migration status: Ensure all applications and cookbooks have migrated to
@equinor/fusion-framework-react-router - Confirm DSL adoption: Verify all route definitions use the new router's DSL (
layout,index,route,prefix)
Phase 2: Code Removal
- Remove deprecated API: Delete the
createRouter()method fromNavigationProvider.ts(currently marked as@deprecated) - Remove type dependencies: Remove
AgnosticRouteObjectandRoutertype imports fromNavigationProvider.interface.ts - Remove implementation dependencies: Remove
createRouterimport and usage fromNavigationProvider.ts - Update package configuration: Remove
@remix-run/routerfrom bothdependenciesandpeerDependenciesinpackages/modules/navigation/package.json
Phase 3: Cleanup
- Remove from cookbooks: Remove any remaining
@remix-run/routerreferences from cookbook examples - Update lockfile: Run
pnpm installto clean uppnpm-lock.yaml - Remove TODO comments: Clean up migration-related TODO comments in the codebase
Phase 4: Verification
- Run full test suite to ensure no regressions
- Verify no TypeScript errors related to missing
@remix-run/routertypes - Confirm build and CI pipelines pass successfully
Current State
The @remix-run/router package is currently used in:
@equinor/fusion-framework-module-navigation- Used for router creation and type definitionsNavigationProvider.createRouter()is marked as@deprecatedwith telemetry tracking
- Some cookbooks/apps may still reference it (to be verified during migration phase)
Success Criteria
- Telemetry shows zero usage of
NavigationProvider.createRouter()across all applications - All app teams confirmed migration to
@equinor/fusion-framework-react-router - Zero references to
@remix-run/routerin the codebase -
@remix-run/routerremoved from allpackage.jsonfiles - All tests passing
- No TypeScript compilation errors
- Documentation updated to reflect router migration completion
Related
- Related Implementation: #3716 - React 19 - React Router Module (delivered the new router solution)
@equinor/fusion-framework-react-routerpackage- Migration guide:
packages/react/router/README.md