summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-11-03 14:12:35 +0100
committerYorhel <git@yorhel.nl>2019-11-10 12:44:55 +0100
commitcc4607635279792b59953bba2e3cb4a3928e76df (patch)
tree227627601aa35df51e2ca10ff0006495bb933e9e /Makefile
parent6ae025a405ea6e40c37a183ba7f3a98c4d9e39cb (diff)
Reorganize JS and Elm instantiation + more efficient ulist loading
The order in which .js files are concatenated is (and always has been) important, so rather than relying on name order I've changed that to an explicit $JS_FILES list in the Makefile. Less convenient, but at least we have more freedom regarding .js file naming and organization now. Rather than encoding the Elm flags as JSON in 'data-' attributes, I've added a system for global page variables (pagevars) where the Elm flags are now stored separately from their HTML tags. This has the advantage of more efficient encoding (no more &quot;s), faster parsing (just a single JSON.parse()), and easier/more efficient modification of the Elm arguments from JS. The pagevars provide a unified way of passing other variables to JS as well, which I've used to deduplicate the list of labels on the new ulist page. That shaves off a good 40 KiB on the page size for a typical listing. Whether all of this actually improves the page loading time, I don't really know. Most of the slowness in Firefox seems to come from simply instantiating many <input time="date"> objects.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 11 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 9b928b9d..9fe5a933 100644
--- a/Makefile
+++ b/Makefile
@@ -116,7 +116,17 @@ static/f/vndb.min.js: static/f/vndb.js
# v2-rw
-JS_FILES=elm/*.js elm/*/*.js
+# Order matters!
+JS_FILES=\
+ elm/polyfills.js \
+ elm/pagevars.js \
+ elm/ULists/ManageLabels.js \
+ elm/ULists/LabelEdit.js \
+ elm/Lib/Ffi.js \
+ elm/elm-init.js \
+ elm/checkall.js \
+ elm/checkhidden.js
+
ELM_FILES=elm/*.elm elm/*/*.elm
ELM_MODULES=$(shell grep -l '^main =' ${ELM_FILES} | sed 's/^elm\///')