Surya Hebbar has uploaded a new patch set (#13). ( http://gerrit.cloudera.org:8080/21851 )
Change subject: IMPALA-13389: Refactor webUI scripts to use ES6 syntax ...................................................................... IMPALA-13389: Refactor webUI scripts to use ES6 syntax Currently, the scripts in the entire webUI contain variable and function declarations using the ES5 standard. In such declarations, all the variables are attached to the browser's window object, polluting the global scope. Additionally, many unnamed functions can be represented with cleaner and concise syntax. This patch refactors such declarations, using the ES6 syntax. -> Replacing 'var' declarations with 'let' and 'const' - To improve browser's memory utilization - For better scoping, immutability and readability -> Replacing unnamed function declarations with arrow functions - Better scoping by binding 'this' object to the surrounding context These improve maintainability and browser's memory utilization. Across many instances within the webUI scripts, no particular naming scheme is being followed for variable and function identifiers. Hence, they have been revised with the following naming scheme. -> All function names have been declared using camel case. -> All constant primitive values and strings have been declared in uppercase. -> All other types of variables have been declared using snake case. This naming scheme allows easier distinction between functions, constants and other variables, based on the identifiers. These changes to code style are further enforced during code review through IMPALA-13473. Change-Id: Ie38f2c642ede14956a2c6d551a58e42538204768 --- M www/admission_controller.tmpl M www/backends.tmpl M www/catalog.tmpl M www/catalog_ha_info.tmpl M www/catalog_operations.tmpl M www/common-header.tmpl M www/flags.tmpl M www/hadoop-varz.tmpl M www/jvm-threadz.tmpl M www/log_level.tmpl M www/metric_group.tmpl M www/profile_docs.tmpl M www/queries.tmpl M www/query_backends.tmpl M www/query_detail_tabs.tmpl M www/query_finstances.tmpl M www/query_plan.tmpl M www/query_plan_text.tmpl M www/query_profile.tmpl M www/query_stmt.tmpl M www/query_summary.tmpl M www/query_timeline.tmpl M www/rpcz.tmpl M www/scripts/common_util.js M www/scripts/queries/profileParseWorker.js M www/scripts/query_timeline/chart_commons.js M www/scripts/query_timeline/fragment_diagram.js M www/scripts/query_timeline/fragment_metrics_diagram.js M www/scripts/query_timeline/global_members.js M www/scripts/query_timeline/host_utilization_diagram.js M www/scripts/tests/queries/profileParseWorker.test.js M www/scripts/tests/query_timeline/chart_commons.test.js M www/scripts/tests/query_timeline/fragment_diagram.test.js M www/scripts/tests/query_timeline/fragment_metrics_diagram.test.js M www/scripts/tests/query_timeline/host_utilization_diagram.test.js M www/sessions.tmpl M www/thread-group.tmpl 37 files changed, 788 insertions(+), 783 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/51/21851/13 -- To view, visit http://gerrit.cloudera.org:8080/21851 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie38f2c642ede14956a2c6d551a58e42538204768 Gerrit-Change-Number: 21851 Gerrit-PatchSet: 13 Gerrit-Owner: Surya Hebbar <sheb...@cloudera.com> Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Gerrit-Reviewer: Kurt Deschler <kdesc...@cloudera.com> Gerrit-Reviewer: Michael Smith <michael.sm...@cloudera.com> Gerrit-Reviewer: Riza Suminto <riza.sumi...@cloudera.com> Gerrit-Reviewer: Surya Hebbar <sheb...@cloudera.com>