From c3663866799daa2b8d27edabf83d3211ea2437cf Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 10 Feb 2021 08:05:00 -0800 Subject: [PATCH] js: Convert static/js/templates.js to ES6 module. Signed-off-by: Anders Kaseorg --- .eslintrc.json | 1 - static/js/global.d.ts | 1 - static/js/templates.js | 8 ++------ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 93e9a7122b..db913f8ec6 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -267,7 +267,6 @@ "submessage": false, "subs": false, "message_view_header": false, - "templates": false, "timerender": false, "top_left_corner": false, "topic_list": false, diff --git a/static/js/global.d.ts b/static/js/global.d.ts index 8f6bc843ce..d0c0d6fe01 100644 --- a/static/js/global.d.ts +++ b/static/js/global.d.ts @@ -132,7 +132,6 @@ declare let stream_ui_updates: any; declare let submessage: any; declare let subs: any; declare let message_view_header: any; -declare let templates: any; declare let timerender: any; declare let stream_topic_history: any; declare let topic_list: any; diff --git a/static/js/templates.js b/static/js/templates.js index b2f1bf6c14..31a90a1448 100644 --- a/static/js/templates.js +++ b/static/js/templates.js @@ -1,8 +1,6 @@ -"use strict"; +import Handlebars from "handlebars/runtime"; -const Handlebars = require("handlebars/runtime"); - -const util = require("./util"); +import * as util from "./util"; // Below, we register Zulip-specific extensions to the handlebars API. // @@ -109,5 +107,3 @@ Handlebars.registerHelper( ); Handlebars.registerHelper("numberFormat", (number) => number.toLocaleString()); - -window.templates = exports;