pacificclimate / pdp

The PCIC Data Portal - Server software to run the entire web application
GNU General Public License v3.0
1 stars 2 forks source link

Reorganize static code to make working with it easier #134

Open rod-glover opened 5 years ago

rod-glover commented 5 years ago

The static code is hard to navigate, and a little reorganization could make this a lot easier. Suggest reorganizing as follows:

static/
    js/
        libs/
            d3/
            jquery/
            lodash/
            OL/
            etc....
        local/
            common/
                __test__/
                calendars.js
                classes.js
                condExport.js
                pdp_controls.js
                pdp_dom_library.js
                etc.
            apps/
                __test__/
                    globals-helpers.js
                    mock-helpers.js
                    etc.
                canada_ex_app/
                     __test__/
                     canada_ex_app.js
                     canada_ex_map.js
                crmp_app/
                     __test__/
                     crmp_*.js
                etc.

Why bother?

  1. Make it easier to understand the construction of an app.
  2. Reduce mental load.
  3. Simplify searches. You usually don't want results that are from libraries (especially for common terms like 'disable'), you want just results from your own code. This organization makes establishing the scope of a search easier (i.e., possible).