Surya Hebbar has uploaded a new patch set (#3). ( 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. With this naming scheme, -> All functions have been declared using camel case. -> All constant primitive values and strings are declared in uppercase. -> All general and local variables have been renamed to use underscores instead of camel case. 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, 803 insertions(+), 812 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/51/21851/3 -- 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: 3 Gerrit-Owner: Surya Hebbar <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Kurt Deschler <[email protected]> Gerrit-Reviewer: Michael Smith <[email protected]> Gerrit-Reviewer: Riza Suminto <[email protected]> Gerrit-Reviewer: Surya Hebbar <[email protected]>
