js: Convert static/js/server_events_dispatch.js to ES6 module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-02-10 08:02:31 -08:00 committed by Tim Abbott
parent 5655e326c9
commit 6775715b9f
6 changed files with 8 additions and 15 deletions

View File

@ -235,7 +235,6 @@
"search_suggestion": false,
"sent_messages": false,
"server_events": false,
"server_events_dispatch": false,
"settings": false,
"settings_account": false,
"settings_bots": false,

View File

@ -12,7 +12,6 @@ set_global("addEventListener", noop);
stub_out_jquery();
zrequire("message_store");
zrequire("server_events_dispatch");
const server_events = zrequire("server_events");
zrequire("sent_messages");

View File

@ -110,7 +110,6 @@ import "../message_util";
import "../message_events";
import "../message_fetch";
import "../server_events";
import "../server_events_dispatch";
import "../zulip";
import "../presence";
import "../user_search";

View File

@ -103,7 +103,6 @@ declare let search_pill_widget: any;
declare let search_suggestion: any;
declare let sent_messages: any;
declare let server_events: any;
declare let server_events_dispatch: any;
declare let settings: any;
declare let settings_account: any;
declare let settings_bots: any;

View File

@ -3,6 +3,7 @@
const _ = require("lodash");
const echo = require("./echo");
const server_events_dispatch = require("./server_events_dispatch");
// Docs: https://zulip.readthedocs.io/en/latest/subsystems/events-system.html
let waiting_on_homeview_load = true;

View File

@ -1,13 +1,11 @@
"use strict";
import * as emoji from "../shared/js/emoji";
const emoji = require("../shared/js/emoji");
import * as alert_words from "./alert_words";
import * as peer_data from "./peer_data";
import * as people from "./people";
import * as settings_config from "./settings_config";
const alert_words = require("./alert_words");
const peer_data = require("./peer_data");
const people = require("./people");
const settings_config = require("./settings_config");
exports.dispatch_normal_event = function dispatch_normal_event(event) {
export function dispatch_normal_event(event) {
const noop = function () {};
switch (event.type) {
case "alert_words":
@ -546,6 +544,4 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) {
settings_exports.populate_exports_table(event.exports);
break;
}
};
window.server_events_dispatch = exports;
}