Overview

Migrating from a monolithic file to a modular code base can be done as follows:

  • Creation of tests that will be run to ensure nothing is broken or lost in migration
  • Mapping
    • the new structure as in RAFT Modular MVC JavaScript Structure
    • mapping a migration from existing file to new structure
    • prioritizing components for migration
      • ensure new structure can be started up and tested
      • migration views and controllers in priority, deploy and test often

Retain Existing Version

The new code will be in all new files. A new base html file can be created and new scripts can be added to the new file.  This allows the existing application to continue to be available during the period that the new version comes online during migration.

Example Migration Task List Overview

  1. Create automated smoke test that run against existing version
  2. Update existing codebase to use a standardized html id attributes instead of a mix of dashed names and mixed case
  3. Create new html view files
    1. dev.html
      1. Will include all script tags for easy development and maintenance
    2. prod.html
      1. Will include a single combined and minified script built from the module structure by jsbuilder3.
  4. Create JS Boilderplate
    1. Create new modular directory structure
    2. Create JavaScript class files with method stubs
    3. Document script files
  5. Use jsduck to generate documentation of new structure to show exactly what will exist in the new application codebase
  6. Migrate existing code to new files
    1. fill in view and controller logic to get the core components of the app working
    2. add new class files as needed with inline documentation and rebuild jsdocs
    3. execute automated smoke tests to ensure functionality
    4. deploy
    5. add new automated tests as identified
    6. continue to add new view and controller logic, test, deploy and repeat until migration completes
  • No labels