open-stage-control/src/server
Matthijs Kooijman c5314fe17a custom-module: Call reload() function on auto-reload
This allows modules to re-initialize any state they need whenever the
module is reloaded.

Without this, any such initialization can also be done in the top
level of the custom module, but this has two problems:

 1. Top-level module code runs on load and reload, and for the initial
    load, it runs *before* the connections are set up, so trying to use
    send() would produce an error on load (not reload).

 2. Top-level module code runs for the primary custom module, but also
    for any nested modules, removing control about the process and
    ordering from the primary custom module. In addition, a module that
    can be used both as primary and nested module, there is no clean way
    to distinguish between these cases.

Both of these problems can be solved by doing some bookkeeping in the
global object, but that produces messy code.

This commit allows modules to define a reload() function, which is
called (for the primary module only) after the module is reloaded. This
means that any initialization for the first load can be done in init()
and for reloads in reload(), and in both cases all connections will
already have been set up solving issue 1. In addition, neither of these
functions are called for nested modules, solving issue 2 (and the
primary module can then stil explicitly call a reload function on nested
modules if needed, as shown in the examples).
2024-06-18 09:37:01 +02:00
..
ipc ipc: fix --authentication on iOS clients (don't rely on headers to pass credentials) 2023-09-06 23:44:21 +02:00
osc custom-module: expose tcpServer 2024-02-21 10:52:40 +01:00
address.js server: add --use-ssl option 2020-05-05 14:50:17 +02:00
auth.js server: lint 2020-05-05 12:11:11 +02:00
callbacks.js misc: add css classes to some notification popups to allow targetting them with css themes 2023-03-10 10:09:06 +01:00
custom-module.js custom-module: Call reload() function on auto-reload 2024-06-18 09:37:01 +02:00
docs-server.js server: add --use-ssl option 2020-05-05 14:50:17 +02:00
electron-app.js package: upate most dependencies 2022-05-22 16:44:32 +02:00
electron-window.js mac: unable to show launcher windows when starting minimized 2024-02-22 09:29:35 +01:00
fragment-manager.js fragment: add fallback property 2022-11-09 10:14:54 +01:00
index.js server: print multiple qrcodes if multiple network interfaces are available and prevent printing a qrcode for the localhost address 2023-04-06 00:35:11 +02:00
midi.js midi: bump version 2023-03-15 08:42:05 +01:00
options.js server: --client-size and --client-position options not parsed correctly 2023-04-15 13:23:12 +02:00
server.js lint 2024-04-03 10:01:05 +02:00
settings.js server: fix config file read/write initial check 2024-02-04 09:57:22 +01:00
ssl.js ssl: fix certificate for recent chrome 2020-11-24 10:47:38 +01:00
theme.js theme: avoid server-side parsing error with --color-background 2022-10-22 21:31:09 +02:00
utils.js fragment: server cache / relative path resolve / auto reload 2021-04-03 18:22:41 +02:00
zeroconf.js package: rename browser to client and main to server 2018-10-28 15:06:36 +01:00