Surya Hebbar has uploaded this change for review. ( http://gerrit.cloudera.org:8080/21851
Change subject: IMPALA-13389: Refactor all webUI JS to use ES6 syntax ...................................................................... IMPALA-13389: Refactor all webUI JS to use ES6 syntax Currently, the scripts in the entire webUI contain variable declarations using only the 'var' keyword. In such declarations, all the variables are attached to the browser's window object, polluting the global scope. In contrast, now the ES6 syntax with 'let' and 'const' has been used, greatly improving the scoping, immutability and readability, aiding in easier maintenance. Additionally, due to the scoping, browser's memory utilization is greatly improved. The webUI scripts also contain many unnamed function declarations, which have been represented in a more cleaner and concise syntax using ES6's arrow functions, where 'this' object within the function definition is bound to the surrounding context. In many instances across the scripts, no particular naming scheme was being followed for variable and function declarations. Now, the variable and function names have been revised to follow a single naming scheme. In all browsers, all elements on the page with assigned 'id' attributes are attached to the browser's window object resulting in global scope. Hence, redundant 'getElementById' function calls have now been removed. 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, 538 insertions(+), 549 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/51/21851/1 -- 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: newchange Gerrit-Change-Id: Ie38f2c642ede14956a2c6d551a58e42538204768 Gerrit-Change-Number: 21851 Gerrit-PatchSet: 1 Gerrit-Owner: Surya Hebbar <[email protected]>
