Skip to content

Rewrite JS in modern-ish (ES6 or newer) Javascript #403

@aaronrudkin

Description

@aaronrudkin

Frankly a lot of the JavaScript on the site needs love, and in addition to being written better, it should also make use of modern JS (ES6 or newer). It could also use documentation. This will make future maintenance easier, and since eventually this site will end up migrated to some kind of React / TypeScript whatever future thing, the best we can do for now is clean up things to get ready.

Changes will be put in the python3 branch

Key changes:

  • Use arrow functions, functional programming (map, etc.), let/const, spreading, template strings
  • Fix line length and tabs, use long line breaks where necessary in strings
  • Comment
  • Break up large functions
  • At least one pass to try to clean up unclear code

File list:

  • colorMap.js
  • congress.js
  • contact.js
  • data.js
  • decorate.js
  • district.js
  • footer.js
  • footerFixed.js
  • mapPanZoom.js
  • memberTable.js
  • nominateHeatMap.js
  • palette.js
  • party.js
  • partyGlance.js
  • personIdeology.js
  • personVotes.js
  • search.js
  • stateMeta.js
  • voteCharts.js
  • voteFilterbar.js
  • voteTable.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions