Skip to content

Instantly share code, notes, and snippets.

@priyank-p
Last active August 22, 2021 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save priyank-p/e297d61f4b2886684a8f967b3cef7a01 to your computer and use it in GitHub Desktop.
Save priyank-p/e297d61f4b2886684a8f967b3cef7a01 to your computer and use it in GitHub Desktop.
GSoC 2021 Work Product — Zulip

GSoC 2021 — Zulip

This summer, I worked on migrating our JavaScript codebase to TypeScript. This involved refactoring code, adding more strict checks for types, updating tests, and resolving circular dependencies in our codebase.

TypeScript

Below are the PRs that converted a bunch of modules to TypeScript. So far, most of the modules with zero or a couple of dependencies are converted to TypeScript. Currently, the migration is stuck, making the codebase use message[TOPIC_NAME] where TOPIC_NAME is subject instead of message.topic. After that, the util module (PR #19247) followed by the people module can be converted to TypeScript allowing us to convert other modules that depend on people.

  • #18566: Convert most modules with zero module imports to typescript.
  • #18595: Convert keydown_util to TypeScript.
  • #18840: Convert page_params, i18n, common, ui_report, and blueslip modules to TS.
  • #18932: Convert more modules to TypeScript.
  • #19010: Convert padded_widget, csrf, loading, components, and ui_util to TS.
  • #19178: Convert message_parser, password_quality, watchdog, composer_error and upload_widget to TS
  • #19419: ts: Convert settings_config, settings_data modules to TypeScript.

Other PRs that are awating review:

  • #19504: ts: Convert timerender, sub_store module to TypeScript.
  • #19463: ts: Convert user_groups module to TypeScript.

Below are is the list of PRs that worked on breaking circular dependencies, general code refactors and migrations to newer APIs that using deprecated API:

  • #18674: Use Event.key, Event.button instead of deprecated Event.keyCode and Event.which.
  • #19317: settings_data: Break circular dependency with people.
  • #19050: js: Split out muting_users module from muting.
  • #19195: js: Split muting_ui into muted_topics_ui and muted_users_ui.
  • #18958: js: Export variables instead of setting them on window.
  • #19099: util: Remove unused code for lower_bound.
  • #18660: settings_org: Fix incorrect selector for the save changes button.
  • #18924: github-actions: Ensure cancel previous run job never fails.
  • #18689: Follow-up cleanups
List of all the commits (80):
  • 3c84a883c: ts: Convert feature_flags to typescript.
  • 1325b2570: ts: Convert message_user_ids to typescript.
  • e18377162: ts: Convert search_utils to typescript.
  • cafe2b4d1: colorspace: Remove unused methods.
  • 3b46ec0e5: ts: Convert colorspace to typescript.
  • f4524467e: ts: Convert reload_state to typescript.
  • 6ab66ea17: keydown_util: Use Event.key instead of deprecated properties.
  • 7999d5240: ts: Convert keydown_util to TypeScript.
  • 6e59d08a7: settings_org: Fix incorrect selector for the save changes button.
  • 2cb71ccc7: emoji_picker: Use e.key instead of deprecated e.keyCode.
  • c292ade96: message_edit: Use e.key instead of deprecated e.keyCode.
  • 121e21d3b: poll_widget: Use e.key instead of deprecated e.keyCode.
  • 63cf47b63: stream_create: Use e.key instead of deprecated e.keyCode.
  • 53d271202: settings_org: Use e.key instead of deprecated e.keyCode.
  • 5fdcf7b53: click_handlers: Use e.button instead of deceprated e.which.
  • 98cb0e339: click_handlers: Use e.key instead of deprecated e.which.
  • 969874d63: alert_words_ui: Use e.key instead of deprecated e.which.
  • baad87468: integrations: Use e.key instead of deprecated e.which.
  • 607abc0b7: signup: Use e.key instead of deprecated e.which.
  • a218143db: search: Use e.key instead of deprecated e.which.
  • 08f534966: settings_streams: Use e.key instead of deprecated e.which.
  • 7f87ea7e7: settings_user_groups: Use e.key instead of deprecated e.which.
  • f2aae91cc: stream_edit: Use e.key instead of deprecated e.which.
  • 90bd3e912: stream_popover: Use e.key instead of deprecated e.which.
  • a7a9f3eb9: subs: Use e.key instead of deprecated e.which.
  • 283412a5b: ui_util: Use e.key instead of deprecated e.which.
  • 94459f142: dropdown_list_widget: Use e.key instead of deprecated e.keyCode.
  • e5005cf4c: input_pill: Use e.key instead of deprecated e.keyCode.
  • 37f96e85f: compose: Use event.key instead of deprecated event.keyCode.
  • bf179b7d2: composebox_typeahead: Use e.key instead of deprecated e.keyCode.
  • cee94654d: minor: Use Array.includes instead of a regex to check for values.
  • 2441138a7: settings_orgs: Use button element for save-discard button.
  • 75034bb76: settings_orgs: Add hover like effects on focus for save-discard buttons.
  • 607110ca3: github-actions: Ensure cancel previous run job never fails.
  • 05510a8c0: github-actions: Upgrade styfle/cancel-workflow-action.
  • 97c8987e0: blueslip: Declare log properties directly on the Logger class.
  • 5ae523891: ui_report: Use numerical check for request status code.
  • 9e08c6db9: ui_report: Correctly check if remove_after is passed.
  • fd45ef57f: ui_report: Do not pass jQuery element to the html method.
  • 2a21f626a: refactor: Use object destructuring for function parameter.
  • 43da43701: refactor: Use variables to get TypeScript type narrowing.
  • ec2ab1eb8: lint: Correctly detect the use of style attribute.
  • f1a0a790f: ts: Convert page_params module to TypeScript.
  • 9418ae51f: ts: Convert i18n module to TypeScript.
  • 8a6f57d75: ts: Convert common module to TypeScript.
  • f7235912f: ts: Convert ui_report module to TypeScript.
  • c862c673a: ts: Convert blueslip module to TypeScript.
  • 31abcaafb: ts: Convert ready module to TypeScript.
  • 6ed635b5e: ts: Convert night_mode module to TypeScript.
  • d660f512f: ts: Convert list_util module to TypeScript.
  • adf83c6eb: ts: Convert color_class module to TypeScript.
  • 91573531b: ts: Convert color_data module to TypeScript.
  • 043b0c6ef: ts: Convert spoilers module to TypeScript.
  • 81e2c3825: js: Export variables instead of setting them on window.
  • 88b83de5b: muting: Refactor get_time_from_date_muted to util module.
  • 4dac12144: refactor: Rename variables that conflict with muting modules rename.
  • 968a8c4e5: js: Split out muted_users module from muting.
  • 5f74e78be: js: Rename muting module to muted_topics.
  • cfc2d7c84: util: Remove unused code for lower_bound.
  • 0aff593ed: blueslip: Correctly type more_info parameter as optional.
  • 35738e148: ts: Convert padded_widget module to TypeScript.
  • a8cdc968c: ts: Convert csrf module to TypeScript.
  • 4fa430933: ts: Convert loading module to TypeScript.
  • 31893d9e1: ts: Convert components module to TypeScript.
  • 3f0110d9c: ts: Convert ui_util module to TypeScript.
  • 05c3164bb: js: Split out muted_users_ui from muting_ui module.
  • 261df2b4d: js: Rename muting_ui module to muted_topics_ui.
  • 5a65a47b2: ts: Convert message_parser module to TypeScript.
  • fdedced52: ts: Convert password_quality module to TypeScript.
  • 97a27eb23: ts: Convert watchdog module to TypeScript.
  • 92912a3b1: ts: Convert compose_error module to TypeScript.
  • 519e8471c: ts: Convert upload_widget to TypeScript.
  • 231c536ca: settings_data: Break circular dependency with people.
  • 288fe6d38: js: Use method chaining for multiple array operations.
  • 899d7bba5: util: Cleanup CachedValue class.
  • bf3aa8bd2: rtl: Use _.sortedIndex instead of util.lower_bound.
  • c37cde120: util: Make less function required for lower_bound.
  • 1e94f6ac9: util: Rewrite same_recipents to not use switch.
  • 6b93fe0cd: ts: Convert settings_config module to TypeScript.
  • 1711dcbc6: ts: Convert settings_data module to TypeScript.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment